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

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

Issue 1832663002: cc : Determine if a layer is root by using the value in LayerTreeImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_impl.h » ('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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 // Create the render passes in dependency order. 802 // Create the render passes in dependency order.
803 size_t render_surface_layer_list_size = 803 size_t render_surface_layer_list_size =
804 frame->render_surface_layer_list->size(); 804 frame->render_surface_layer_list->size();
805 for (size_t i = 0; i < render_surface_layer_list_size; ++i) { 805 for (size_t i = 0; i < render_surface_layer_list_size; ++i) {
806 size_t surface_index = render_surface_layer_list_size - 1 - i; 806 size_t surface_index = render_surface_layer_list_size - 1 - i;
807 LayerImpl* render_surface_layer = 807 LayerImpl* render_surface_layer =
808 (*frame->render_surface_layer_list)[surface_index]; 808 (*frame->render_surface_layer_list)[surface_index];
809 RenderSurfaceImpl* render_surface = render_surface_layer->render_surface(); 809 RenderSurfaceImpl* render_surface = render_surface_layer->render_surface();
810 810
811 bool should_draw_into_render_pass = 811 bool should_draw_into_render_pass =
812 render_surface_layer->parent() == NULL || 812 active_tree_->IsRootLayer(render_surface_layer) ||
813 render_surface->contributes_to_drawn_surface() || 813 render_surface->contributes_to_drawn_surface() ||
814 render_surface_layer->HasCopyRequest(); 814 render_surface_layer->HasCopyRequest();
815 if (should_draw_into_render_pass) 815 if (should_draw_into_render_pass)
816 render_surface->AppendRenderPasses(frame); 816 render_surface->AppendRenderPasses(frame);
817 } 817 }
818 818
819 // When we are displaying the HUD, change the root damage rect to cover the 819 // When we are displaying the HUD, change the root damage rect to cover the
820 // entire root surface. This will disable partial-swap/scissor optimizations 820 // entire root surface. This will disable partial-swap/scissor optimizations
821 // that would prevent the HUD from updating, since the HUD does not cause 821 // that would prevent the HUD from updating, since the HUD does not cause
822 // damage itself, to prevent it from messing with damage visualizations. Since 822 // damage itself, to prevent it from messing with damage visualizations. Since
(...skipping 3099 matching lines...) Expand 10 before | Expand all | Expand 10 after
3922 return task_runner_provider_->HasImplThread(); 3922 return task_runner_provider_->HasImplThread();
3923 } 3923 }
3924 3924
3925 bool LayerTreeHostImpl::CommitToActiveTree() const { 3925 bool LayerTreeHostImpl::CommitToActiveTree() const {
3926 // In single threaded mode we skip the pending tree and commit directly to the 3926 // In single threaded mode we skip the pending tree and commit directly to the
3927 // active tree. 3927 // active tree.
3928 return !task_runner_provider_->HasImplThread(); 3928 return !task_runner_provider_->HasImplThread();
3929 } 3929 }
3930 3930
3931 } // namespace cc 3931 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698