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

Unified Diff: cc/trees/occlusion_tracker.cc

Issue 2099743002: cc: Move background filters to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ' 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/occlusion_tracker.cc
diff --git a/cc/trees/occlusion_tracker.cc b/cc/trees/occlusion_tracker.cc
index 2cc2b168a05d11aadf6b2e3ecc74be9d2c770c97..fe5b0a355e7d0e6ebb0e7535d4a4450b7b9a6ea7 100644
--- a/cc/trees/occlusion_tracker.cc
+++ b/cc/trees/occlusion_tracker.cc
@@ -191,25 +191,23 @@ void OcclusionTracker::FinishedRenderTarget(const LayerImpl* finished_target) {
}
static void ReduceOcclusionBelowSurface(
- const LayerImpl* contributing_layer,
+ const RenderSurfaceImpl* contributing_surface,
const gfx::Rect& surface_rect,
const gfx::Transform& surface_transform,
- const LayerImpl* render_target,
SimpleEnclosedRegion* occlusion_from_inside_target) {
if (surface_rect.IsEmpty())
return;
gfx::Rect affected_area_in_target =
MathUtil::MapEnclosingClippedRect(surface_transform, surface_rect);
- if (contributing_layer->render_surface()->is_clipped()) {
- affected_area_in_target.Intersect(
- contributing_layer->render_surface()->clip_rect());
+ if (contributing_surface->is_clipped()) {
+ affected_area_in_target.Intersect(contributing_surface->clip_rect());
}
if (affected_area_in_target.IsEmpty())
return;
int outset_top, outset_right, outset_bottom, outset_left;
- contributing_layer->background_filters().GetOutsets(
+ contributing_surface->BackgroundFilters().GetOutsets(
&outset_top, &outset_right, &outset_bottom, &outset_left);
// The filter can move pixels from outside of the clip, so allow affected_area
@@ -257,8 +255,6 @@ void OcclusionTracker::LeaveToRenderTarget(const LayerImpl* new_target) {
// merged out as well but needs to be transformed to the new target.
const RenderSurfaceImpl* old_surface = stack_[last_index].target;
- const LayerImpl* old_target =
- new_target->layer_tree_impl()->LayerById(old_surface->OwningLayerId());
SimpleEnclosedRegion old_occlusion_from_inside_target_in_new_target =
TransformSurfaceOpaqueRegion(
@@ -280,7 +276,7 @@ void OcclusionTracker::LeaveToRenderTarget(const LayerImpl* new_target) {
gfx::Rect unoccluded_surface_rect;
gfx::Rect unoccluded_replica_rect;
- if (old_target->background_filters().HasFilterThatMovesPixels()) {
+ if (old_surface->BackgroundFilters().HasFilterThatMovesPixels()) {
Occlusion surface_occlusion = GetCurrentOcclusionForContributingSurface(
old_surface->draw_transform());
unoccluded_surface_rect =
@@ -317,31 +313,23 @@ void OcclusionTracker::LeaveToRenderTarget(const LayerImpl* new_target) {
}
}
- if (!old_target->background_filters().HasFilterThatMovesPixels())
+ if (!old_surface->BackgroundFilters().HasFilterThatMovesPixels())
return;
- ReduceOcclusionBelowSurface(old_target,
- unoccluded_surface_rect,
+ ReduceOcclusionBelowSurface(old_surface, unoccluded_surface_rect,
old_surface->draw_transform(),
- new_target,
&stack_.back().occlusion_from_inside_target);
- ReduceOcclusionBelowSurface(old_target,
- unoccluded_surface_rect,
+ ReduceOcclusionBelowSurface(old_surface, unoccluded_surface_rect,
old_surface->draw_transform(),
- new_target,
&stack_.back().occlusion_from_outside_target);
if (!old_surface->HasReplica())
return;
- ReduceOcclusionBelowSurface(old_target,
- unoccluded_replica_rect,
+ ReduceOcclusionBelowSurface(old_surface, unoccluded_replica_rect,
old_surface->replica_draw_transform(),
- new_target,
&stack_.back().occlusion_from_inside_target);
- ReduceOcclusionBelowSurface(old_target,
- unoccluded_replica_rect,
+ ReduceOcclusionBelowSurface(old_surface, unoccluded_replica_rect,
old_surface->replica_draw_transform(),
- new_target,
&stack_.back().occlusion_from_outside_target);
}
« 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