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

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

Issue 2017263002: cc: Move copy requests from layers to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo in comment Created 4 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 unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | cc/trees/occlusion_tracker_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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/occlusion_tracker.h" 5 #include "cc/trees/occlusion_tracker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 void OcclusionTracker::FinishedRenderTarget(const LayerImpl* finished_target) { 171 void OcclusionTracker::FinishedRenderTarget(const LayerImpl* finished_target) {
172 // Make sure we know about the target surface. 172 // Make sure we know about the target surface.
173 EnterRenderTarget(finished_target); 173 EnterRenderTarget(finished_target);
174 174
175 RenderSurfaceImpl* surface = finished_target->render_surface(); 175 RenderSurfaceImpl* surface = finished_target->render_surface();
176 176
177 // Readbacks always happen on render targets so we only need to check 177 // Readbacks always happen on render targets so we only need to check
178 // for readbacks here. 178 // for readbacks here.
179 bool target_is_only_for_copy_request = 179 bool target_is_only_for_copy_request =
180 finished_target->HasCopyRequest() && finished_target->IsHidden(); 180 surface->HasCopyRequest() && finished_target->IsHidden();
181 181
182 // If the occlusion within the surface can not be applied to things outside of 182 // If the occlusion within the surface can not be applied to things outside of
183 // the surface's subtree, then clear the occlusion here so it won't be used. 183 // the surface's subtree, then clear the occlusion here so it won't be used.
184 if (finished_target->mask_layer() || surface->draw_opacity() < 1 || 184 if (finished_target->mask_layer() || surface->draw_opacity() < 1 ||
185 !finished_target->uses_default_blend_mode() || 185 !finished_target->uses_default_blend_mode() ||
186 target_is_only_for_copy_request || 186 target_is_only_for_copy_request ||
187 finished_target->filters().HasFilterThatAffectsOpacity()) { 187 finished_target->filters().HasFilterThatAffectsOpacity()) {
188 stack_.back().occlusion_from_outside_target.Clear(); 188 stack_.back().occlusion_from_outside_target.Clear();
189 stack_.back().occlusion_from_inside_target.Clear(); 189 stack_.back().occlusion_from_inside_target.Clear();
190 } 190 }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 DCHECK(layer_tree->root_layer()->render_surface() == stack_.back().target); 394 DCHECK(layer_tree->root_layer()->render_surface() == stack_.back().target);
395 const SimpleEnclosedRegion& occluded = 395 const SimpleEnclosedRegion& occluded =
396 stack_.back().occlusion_from_inside_target; 396 stack_.back().occlusion_from_inside_target;
397 Region visible_region(screen_space_clip_rect_); 397 Region visible_region(screen_space_clip_rect_);
398 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i) 398 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i)
399 visible_region.Subtract(occluded.GetRect(i)); 399 visible_region.Subtract(occluded.GetRect(i));
400 return visible_region; 400 return visible_region;
401 } 401 }
402 402
403 } // namespace cc 403 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | cc/trees/occlusion_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698