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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 21323002: Bring back setting visible viewport size based on cliprect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 void LayerTreeHostImpl::SetNeedsBeginFrame(bool enable) { 1309 void LayerTreeHostImpl::SetNeedsBeginFrame(bool enable) {
1310 if (output_surface_) 1310 if (output_surface_)
1311 output_surface_->SetNeedsBeginFrame(enable); 1311 output_surface_->SetNeedsBeginFrame(enable);
1312 } 1312 }
1313 1313
1314 float LayerTreeHostImpl::DeviceScaleFactor() const { 1314 float LayerTreeHostImpl::DeviceScaleFactor() const {
1315 return device_scale_factor_; 1315 return device_scale_factor_;
1316 } 1316 }
1317 1317
1318 gfx::SizeF LayerTreeHostImpl::VisibleViewportSize() const { 1318 gfx::SizeF LayerTreeHostImpl::VisibleViewportSize() const {
1319 // The container layer bounds should be used if non-overlay scrollbars may
1320 // exist since it adjusts for them.
1321 LayerImpl* container_layer = active_tree_->RootContainerLayer();
1322 if (!Settings().solid_color_scrollbars && container_layer) {
1323 DCHECK(!top_controls_manager_);
1324 DCHECK_EQ(0, overdraw_bottom_height_);
1325 return container_layer->bounds();
1326 }
1327
1319 gfx::SizeF dip_size = 1328 gfx::SizeF dip_size =
1320 gfx::ScaleSize(device_viewport_size(), 1.f / device_scale_factor()); 1329 gfx::ScaleSize(device_viewport_size(), 1.f / device_scale_factor());
1321 1330
1322 float top_offset = 1331 float top_offset =
1323 top_controls_manager_ ? top_controls_manager_->content_top_offset() : 0.f; 1332 top_controls_manager_ ? top_controls_manager_->content_top_offset() : 0.f;
1324 return gfx::SizeF(dip_size.width(), 1333 return gfx::SizeF(dip_size.width(),
1325 dip_size.height() - top_offset - overdraw_bottom_height_); 1334 dip_size.height() - top_offset - overdraw_bottom_height_);
1326 } 1335 }
1327 1336
1328 const LayerTreeSettings& LayerTreeHostImpl::Settings() const { 1337 const LayerTreeSettings& LayerTreeHostImpl::Settings() const {
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
2425 if (LayerTreeDebugState::Equal(debug_state_, new_debug_state)) 2434 if (LayerTreeDebugState::Equal(debug_state_, new_debug_state))
2426 return; 2435 return;
2427 if (debug_state_.continuous_painting != new_debug_state.continuous_painting) 2436 if (debug_state_.continuous_painting != new_debug_state.continuous_painting)
2428 paint_time_counter_->ClearHistory(); 2437 paint_time_counter_->ClearHistory();
2429 2438
2430 debug_state_ = new_debug_state; 2439 debug_state_ = new_debug_state;
2431 SetFullRootLayerDamage(); 2440 SetFullRootLayerDamage();
2432 } 2441 }
2433 2442
2434 } // namespace cc 2443 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698