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

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

Issue 18202006: Make scrollable viewport size no longer depend on clip layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove DCHECK(IsActiveTree()) on RootScrollLayer Created 7 years, 5 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
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 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 } 1284 }
1285 1285
1286 float LayerTreeHostImpl::DeviceScaleFactor() const { 1286 float LayerTreeHostImpl::DeviceScaleFactor() const {
1287 return device_scale_factor_; 1287 return device_scale_factor_;
1288 } 1288 }
1289 1289
1290 gfx::SizeF LayerTreeHostImpl::VisibleViewportSize() const { 1290 gfx::SizeF LayerTreeHostImpl::VisibleViewportSize() const {
1291 gfx::SizeF dip_size = 1291 gfx::SizeF dip_size =
1292 gfx::ScaleSize(device_viewport_size(), 1.f / device_scale_factor()); 1292 gfx::ScaleSize(device_viewport_size(), 1.f / device_scale_factor());
1293 1293
1294 // The clip layer should be used if non-overlay scrollbars may exist since
1295 // it adjusts for them.
1296 LayerImpl* clip_layer = active_tree_->RootClipLayer();
1297 if (!Settings().solid_color_scrollbars && clip_layer &&
enne (OOO) 2013/07/12 17:19:27 I didn't even know this code existed, but I am hap
1298 clip_layer->masks_to_bounds())
1299 dip_size = clip_layer->bounds();
1300
1301 float top_offset = 1294 float top_offset =
1302 top_controls_manager_ ? top_controls_manager_->content_top_offset() : 0.f; 1295 top_controls_manager_ ? top_controls_manager_->content_top_offset() : 0.f;
1303 return gfx::SizeF(dip_size.width(), 1296 return gfx::SizeF(dip_size.width(),
1304 dip_size.height() - top_offset - overdraw_bottom_height_); 1297 dip_size.height() - top_offset - overdraw_bottom_height_);
1305 } 1298 }
1306 1299
1307 const LayerTreeSettings& LayerTreeHostImpl::Settings() const { 1300 const LayerTreeSettings& LayerTreeHostImpl::Settings() const {
1308 return settings(); 1301 return settings();
1309 } 1302 }
1310 1303
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
2373 if (LayerTreeDebugState::Equal(debug_state_, new_debug_state)) 2366 if (LayerTreeDebugState::Equal(debug_state_, new_debug_state))
2374 return; 2367 return;
2375 if (debug_state_.continuous_painting != new_debug_state.continuous_painting) 2368 if (debug_state_.continuous_painting != new_debug_state.continuous_painting)
2376 paint_time_counter_->ClearHistory(); 2369 paint_time_counter_->ClearHistory();
2377 2370
2378 debug_state_ = new_debug_state; 2371 debug_state_ = new_debug_state;
2379 SetFullRootLayerDamage(); 2372 SetFullRootLayerDamage();
2380 } 2373 }
2381 2374
2382 } // namespace cc 2375 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698