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

Unified Diff: cc/layer_tree_impl.cc

Issue 12212156: cc: Only allow trees created at the current viewport size to draw. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« cc/layer_tree_host_impl.cc ('K') | « cc/layer_tree_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_impl.cc
diff --git a/cc/layer_tree_impl.cc b/cc/layer_tree_impl.cc
index 38a40f315cab2288e0fa14718754aad2427e8ec2..535dea78f5834b567623e4c239d160b2eb28a1b5 100644
--- a/cc/layer_tree_impl.cc
+++ b/cc/layer_tree_impl.cc
@@ -92,6 +92,7 @@ void LayerTreeImpl::pushPropertiesTo(LayerTreeImpl* target_tree) {
target_tree->SetPageScaleDelta(
target_tree->page_scale_delta() / target_tree->sent_page_scale_delta());
target_tree->set_sent_page_scale_delta(1);
+ target_tree->SetDeviceViewportSize(device_viewport_size_);
// This should match the property synchronization in
// LayerTreeHost::finishCommitOnImplThread().
@@ -269,6 +270,18 @@ void LayerTreeImpl::ClearRenderSurfaces() {
set_needs_update_draw_properties();
}
+void LayerTreeImpl::SetDeviceViewportSize(const gfx::Size& device_viewport_size)
+{
+ if (device_viewport_size_ == device_viewport_size)
+ return;
+
+ device_viewport_size_ = device_viewport_size;
+
+ UpdateMaxScrollOffset();
+
+ layer_tree_host_impl_->OnCanDrawStateChangedForTree(this);
+}
+
bool LayerTreeImpl::AreVisibleResourcesReady() const {
TRACE_EVENT0("cc", "LayerTreeImpl::AreVisibleResourcesReady");
@@ -428,14 +441,6 @@ float LayerTreeImpl::device_scale_factor() const {
return layer_tree_host_impl_->deviceScaleFactor();
}
-const gfx::Size& LayerTreeImpl::device_viewport_size() const {
- return layer_tree_host_impl_->deviceViewportSize();
-}
-
-const gfx::Size& LayerTreeImpl::layout_viewport_size() const {
- return layer_tree_host_impl_->layoutViewportSize();
-}
-
std::string LayerTreeImpl::layer_tree_as_text() const {
return layer_tree_host_impl_->layerTreeAsText();
}
« cc/layer_tree_host_impl.cc ('K') | « cc/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698