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

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: Move viewport sizes out of LTHI 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_impl.h ('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..414edceab1c438df1021efd4d964ab392d880d8b 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->SetViewportSize(layout_viewport_size_, device_viewport_size_);
// This should match the property synchronization in
// LayerTreeHost::finishCommitOnImplThread().
@@ -269,6 +270,22 @@ void LayerTreeImpl::ClearRenderSurfaces() {
set_needs_update_draw_properties();
}
+void LayerTreeImpl::SetViewportSize(const gfx::Size& layout_viewport_size, const gfx::Size& device_viewport_size)
+{
danakj 2013/02/13 06:51:36 chromium style in this file
+ if (device_viewport_size_ == device_viewport_size && layout_viewport_size_ == layout_viewport_size)
danakj 2013/02/13 06:51:36 80col
+ return;
+
+ layout_viewport_size_ = layout_viewport_size;
+ device_viewport_size_ = device_viewport_size;
+
+ UpdateMaxScrollOffset();
+
+ if (IsActiveTree() && layer_tree_host_impl_->renderer())
+ layer_tree_host_impl_->renderer()->viewportChanged();
+
+ layer_tree_host_impl_->OnCanDrawStateChangedForTree(this);
+}
+
bool LayerTreeImpl::AreVisibleResourcesReady() const {
TRACE_EVENT0("cc", "LayerTreeImpl::AreVisibleResourcesReady");
@@ -428,14 +445,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_impl.h ('K') | « cc/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698