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

Unified Diff: cc/layers/contents_scaling_layer.cc

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 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/base/tiling_data.cc ('k') | cc/layers/delegated_renderer_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/contents_scaling_layer.cc
diff --git a/cc/layers/contents_scaling_layer.cc b/cc/layers/contents_scaling_layer.cc
index 733bac094f696552d470472ee07b9ee1b47c642e..b44830f5fa70cef857df1daa4b20905603e51152 100644
--- a/cc/layers/contents_scaling_layer.cc
+++ b/cc/layers/contents_scaling_layer.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "cc/layers/contents_scaling_layer.h"
+#include "cc/trees/layer_tree_host.h"
#include "ui/gfx/geometry/size_conversions.h"
namespace cc {
@@ -25,11 +26,23 @@ void ContentsScalingLayer::CalculateContentsScale(
float* contents_scale_x,
float* contents_scale_y,
gfx::Size* content_bounds) {
+ float old_contents_scale_x = *contents_scale_x;
+ float old_contents_scale_y = *contents_scale_y;
+ gfx::Size old_content_bounds = *content_bounds;
*contents_scale_x = ideal_contents_scale;
*contents_scale_y = ideal_contents_scale;
*content_bounds = ComputeContentBoundsForScale(
ideal_contents_scale,
ideal_contents_scale);
+
+ if (!layer_tree_host())
+ return;
+
+ if (old_contents_scale_x != *contents_scale_x ||
+ old_contents_scale_y != *contents_scale_y ||
+ old_content_bounds != *content_bounds) {
+ layer_tree_host()->property_trees()->needs_rebuild = true;
+ }
}
bool ContentsScalingLayer::Update(ResourceUpdateQueue* queue,
« no previous file with comments | « cc/base/tiling_data.cc ('k') | cc/layers/delegated_renderer_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698