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

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

Issue 2184773002: cc: Move blend_mode to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 RenderSurfaceImpl* surface = finished_target->render_surface(); 183 RenderSurfaceImpl* surface = finished_target->render_surface();
184 184
185 // Readbacks always happen on render targets so we only need to check 185 // Readbacks always happen on render targets so we only need to check
186 // for readbacks here. 186 // for readbacks here.
187 bool target_is_only_for_copy_request = 187 bool target_is_only_for_copy_request =
188 surface->HasCopyRequest() && finished_target->IsHidden(); 188 surface->HasCopyRequest() && finished_target->IsHidden();
189 189
190 // If the occlusion within the surface can not be applied to things outside of 190 // If the occlusion within the surface can not be applied to things outside of
191 // the surface's subtree, then clear the occlusion here so it won't be used. 191 // the surface's subtree, then clear the occlusion here so it won't be used.
192 if (surface->MaskLayer() || surface->draw_opacity() < 1 || 192 if (surface->MaskLayer() || surface->draw_opacity() < 1 ||
193 !finished_target->uses_default_blend_mode() || 193 !surface->UsesDefaultBlendMode() || target_is_only_for_copy_request ||
194 target_is_only_for_copy_request ||
195 surface->Filters().HasFilterThatAffectsOpacity()) { 194 surface->Filters().HasFilterThatAffectsOpacity()) {
196 stack_.back().occlusion_from_outside_target.Clear(); 195 stack_.back().occlusion_from_outside_target.Clear();
197 stack_.back().occlusion_from_inside_target.Clear(); 196 stack_.back().occlusion_from_inside_target.Clear();
198 } 197 }
199 } 198 }
200 199
201 static void ReduceOcclusionBelowSurface( 200 static void ReduceOcclusionBelowSurface(
202 const RenderSurfaceImpl* contributing_surface, 201 const RenderSurfaceImpl* contributing_surface,
203 const gfx::Rect& surface_rect, 202 const gfx::Rect& surface_rect,
204 const gfx::Transform& surface_transform, 203 const gfx::Transform& surface_transform,
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 DCHECK(layer_tree->RootRenderSurface() == stack_.back().target); 392 DCHECK(layer_tree->RootRenderSurface() == stack_.back().target);
394 const SimpleEnclosedRegion& occluded = 393 const SimpleEnclosedRegion& occluded =
395 stack_.back().occlusion_from_inside_target; 394 stack_.back().occlusion_from_inside_target;
396 Region visible_region(screen_space_clip_rect_); 395 Region visible_region(screen_space_clip_rect_);
397 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i) 396 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i)
398 visible_region.Subtract(occluded.GetRect(i)); 397 visible_region.Subtract(occluded.GetRect(i));
399 return visible_region; 398 return visible_region;
400 } 399 }
401 400
402 } // namespace cc 401 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/occlusion_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698