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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 332433003: cc: Remove EnsureRenderSurfaceLayerList, do UpdateDrawProps when needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ensurersll: . Created 6 years, 6 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
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 94d2864c696535575997ee2d32c898b0d00816eb..f2ab6404159c72ca5386bd46ab36ab68ec323525 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -474,9 +474,6 @@ bool LayerTreeHostImpl::IsCurrentlyScrollingLayerAt(
if (!CurrentlyScrollingLayer())
return false;
- if (!EnsureRenderSurfaceLayerList())
- return false;
-
gfx::PointF device_viewport_point =
gfx::ScalePoint(viewport_point, device_scale_factor_);
@@ -493,8 +490,6 @@ bool LayerTreeHostImpl::HaveTouchEventHandlersAt(
const gfx::Point& viewport_point) {
if (!settings_.touch_hit_testing)
return true;
- if (!EnsureRenderSurfaceLayerList())
- return false;
gfx::PointF device_viewport_point =
gfx::ScalePoint(viewport_point, device_scale_factor_);
@@ -1094,7 +1089,10 @@ DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) {
}
need_to_update_visible_tiles_before_draw_ = true;
- active_tree_->UpdateDrawProperties();
+ if (active_tree_->needs_update_draw_properties()) {
+ bool ok = active_tree_->UpdateDrawProperties();
+ DCHECK(ok) << "UpdateDrawProperties failed during draw";
+ }
frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList();
frame->render_passes.clear();
@@ -2128,11 +2126,6 @@ void LayerTreeHostImpl::DidChangeTopControlsPosition() {
SetFullRootLayerDamage();
}
-bool LayerTreeHostImpl::EnsureRenderSurfaceLayerList() {
- active_tree_->UpdateDrawProperties();
- return !active_tree_->RenderSurfaceLayerList().empty();
-}
-
void LayerTreeHostImpl::BindToClient(InputHandlerClient* client) {
DCHECK(input_handler_client_ == NULL);
input_handler_client_ = client;
@@ -2153,7 +2146,7 @@ LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint(
DCHECK(scroll_on_main_thread);
// Walk up the hierarchy and look for a scrollable layer.
- LayerImpl* potentially_scrolling_layer_impl = 0;
+ LayerImpl* potentially_scrolling_layer_impl = NULL;
for (; layer_impl; layer_impl = NextScrollLayer(layer_impl)) {
// The content layer can also block attempts to scroll outside the main
// thread.
@@ -2215,9 +2208,6 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
DCHECK(!CurrentlyScrollingLayer());
ClearCurrentlyScrollingLayer();
- if (!EnsureRenderSurfaceLayerList())
- return ScrollIgnored;
-
gfx::PointF device_viewport_point = gfx::ScalePoint(viewport_point,
device_scale_factor_);
LayerImpl* layer_impl =
@@ -2581,9 +2571,6 @@ float LayerTreeHostImpl::DeviceSpaceDistanceToLayer(
}
void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
- if (!EnsureRenderSurfaceLayerList())
- return;
-
gfx::PointF device_viewport_point = gfx::ScalePoint(viewport_point,
device_scale_factor_);
LayerImpl* layer_impl =

Powered by Google App Engine
This is Rietveld 408576698