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

Unified Diff: cc/layers/texture_layer.cc

Issue 13910011: Add optimization to TextureLayer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved define to layer_test_common.h Created 7 years, 8 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 | « cc/layers/layer_unittest.cc ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/texture_layer.cc
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index e1ce978e8f234f979cd9b8192b4d8ae21366f9ae..35956b0b7947d0640ab352307af04a8009d3da61 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -83,11 +83,15 @@ scoped_ptr<LayerImpl> TextureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
}
void TextureLayer::SetFlipped(bool flipped) {
+ if (flipped_ == flipped)
+ return;
flipped_ = flipped;
SetNeedsCommit();
}
void TextureLayer::SetUV(gfx::PointF top_left, gfx::PointF bottom_right) {
+ if (uv_top_left_ == top_left && uv_bottom_right_ == bottom_right)
+ return;
uv_top_left_ = top_left;
uv_bottom_right_ = bottom_right;
SetNeedsCommit();
@@ -101,6 +105,11 @@ void TextureLayer::SetVertexOpacity(float bottom_left,
// 1--2
// | |
// 0--3
+ if (vertex_opacity_[0] == bottom_left &&
+ vertex_opacity_[1] == top_left &&
+ vertex_opacity_[2] == top_right &&
+ vertex_opacity_[3] == bottom_right)
+ return;
vertex_opacity_[0] = bottom_left;
vertex_opacity_[1] = top_left;
vertex_opacity_[2] = top_right;
@@ -109,6 +118,8 @@ void TextureLayer::SetVertexOpacity(float bottom_left,
}
void TextureLayer::SetPremultipliedAlpha(bool premultiplied_alpha) {
+ if (premultiplied_alpha_ == premultiplied_alpha)
+ return;
premultiplied_alpha_ = premultiplied_alpha;
SetNeedsCommit();
}
« no previous file with comments | « cc/layers/layer_unittest.cc ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698