Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: ui/compositor/layer.cc

Issue 10414030: Add support for new WebKit::WebFilterOperation construction API behind ifdef (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 return web_layer_.masksToBounds(); 190 return web_layer_.masksToBounds();
191 } 191 }
192 192
193 void Layer::SetOpacity(float opacity) { 193 void Layer::SetOpacity(float opacity) {
194 GetAnimator()->SetOpacity(opacity); 194 GetAnimator()->SetOpacity(opacity);
195 } 195 }
196 196
197 void Layer::SetBackgroundBlur(int blur_radius) 197 void Layer::SetBackgroundBlur(int blur_radius)
198 { 198 {
199 WebKit::WebFilterOperations filters; 199 WebKit::WebFilterOperations filters;
200 if (blur_radius) 200 if (blur_radius) {
201 #if WEBKIT_HAS_NEW_WEBFILTEROPERATION_API
202 filters.append(WebKit::WebFilterOperation::createBlurFilter(blur_radius));
203 #else
201 filters.append(WebKit::WebBlurFilterOperation(blur_radius)); 204 filters.append(WebKit::WebBlurFilterOperation(blur_radius));
205 #endif
206 }
202 web_layer_.setBackgroundFilters(filters); 207 web_layer_.setBackgroundFilters(filters);
203 208
204 background_blur_radius_ = blur_radius; 209 background_blur_radius_ = blur_radius;
205 } 210 }
206 211
207 float Layer::GetTargetOpacity() const { 212 float Layer::GetTargetOpacity() const {
208 if (animator_.get() && animator_->IsAnimatingProperty( 213 if (animator_.get() && animator_->IsAnimatingProperty(
209 LayerAnimationElement::OPACITY)) 214 LayerAnimationElement::OPACITY))
210 return animator_->GetTargetOpacity(); 215 return animator_->GetTargetOpacity();
211 return opacity_; 216 return opacity_;
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 return; 617 return;
613 unsigned int color = 0xFF000000; 618 unsigned int color = 0xFF000000;
614 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; 619 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000;
615 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); 620 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f);
616 if (!opaque) 621 if (!opaque)
617 color |= 0xFF; 622 color |= 0xFF;
618 web_layer_.setDebugBorderColor(color); 623 web_layer_.setDebugBorderColor(color);
619 } 624 }
620 625
621 } // namespace ui 626 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698