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

Unified Diff: cc/contents_scaling_layer.cc

Issue 11644035: cc: Invalidate the full tiled layer when contents scale changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
Index: cc/contents_scaling_layer.cc
diff --git a/cc/contents_scaling_layer.cc b/cc/contents_scaling_layer.cc
index 579af3476991b2b3fbb234bb73cef0af65f0fdd8..a9a8befec014616fe8be19a3c2da93378dd75c4f 100644
--- a/cc/contents_scaling_layer.cc
+++ b/cc/contents_scaling_layer.cc
@@ -11,7 +11,10 @@ gfx::Size ContentsScalingLayer::computeContentBoundsForScale(float scaleX, float
return gfx::ToCeiledSize(gfx::ScaleSize(bounds(), scaleX, scaleY));
}
-ContentsScalingLayer::ContentsScalingLayer() {
+ContentsScalingLayer::ContentsScalingLayer()
+ : last_update_contents_scale_x_(0.f)
+ , last_update_contents_scale_y_(0.f)
+ {
}
ContentsScalingLayer::~ContentsScalingLayer() {
@@ -35,4 +38,18 @@ void ContentsScalingLayer::didUpdateBounds() {
contentsScaleY());
}
+void ContentsScalingLayer::update(
+ ResourceUpdateQueue& queue,
+ const OcclusionTracker* occlusion,
+ RenderingStats& stats) {
+ if (drawProperties().contents_scale_x == last_update_contents_scale_x_ &&
+ drawProperties().contents_scale_y == last_update_contents_scale_y_)
+ return;
+
+ last_update_contents_scale_x_ = drawProperties().contents_scale_x;
+ last_update_contents_scale_y_ = drawProperties().contents_scale_y;
+ // Invalidate the whole layer if scale changed.
+ setNeedsDisplayRect(gfx::Rect(bounds()));
+}
+
} // namespace cc
« no previous file with comments | « cc/contents_scaling_layer.h ('k') | cc/tiled_layer.cc » ('j') | cc/tiled_layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698