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

Unified Diff: ui/compositor/layer.cc

Issue 10833027: aura: apply brightness filter last to improve perf (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Also fix uninitialized value Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 6c30d52b8a4d5367c1310326fec0796b1b6a0588..7b752f79464e4975086f480757c27adea91d553b 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -78,6 +78,7 @@ Layer::Layer(LayerType type)
background_blur_radius_(0),
layer_saturation_(0.0f),
layer_brightness_(0.0f),
+ layer_grayscale_(0.0f),
Nikita (slow) 2012/07/28 01:49:54 Oh, sorry for this one.
layer_inverted_(false),
layer_mask_(NULL),
layer_mask_back_link_(NULL),
@@ -288,16 +289,19 @@ void Layer::SetLayerFilters() {
filters.append(WebKit::WebFilterOperation::createSaturateFilter(
layer_saturation_));
}
- if (layer_brightness_) {
- filters.append(WebKit::WebFilterOperation::createBrightnessFilter(
- layer_brightness_));
- }
if (layer_grayscale_) {
filters.append(WebKit::WebFilterOperation::createGrayscaleFilter(
layer_grayscale_));
}
if (layer_inverted_)
filters.append(WebKit::WebFilterOperation::createInvertFilter(1.0));
+ // Brightness goes last, because the resulting colors neeed clamping, which
+ // cause further color matrix filters to be applied separately. In this order,
+ // they all can be combined in a single pass.
+ if (layer_brightness_) {
+ filters.append(WebKit::WebFilterOperation::createBrightnessFilter(
+ layer_brightness_));
+ }
Mr4D (OOO till 08-26) 2012/07/26 13:57:00 Good old times... I remember when I did this kind
web_layer_.setFilters(filters);
}
« 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