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

Unified Diff: cc/trees/occlusion_tracker.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | no next file » | 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 4bcb7625353a0d171df2467991d616ede8a92508..a1a3ca0747490fac0d5a1ffa3c4c77d7b46e4d29 100644
--- a/cc/trees/occlusion_tracker.cc
+++ b/cc/trees/occlusion_tracker.cc
@@ -13,6 +13,7 @@
#include "cc/layers/layer.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/render_surface_impl.h"
+#include "cc/trees/layer_tree_impl.h"
#include "ui/gfx/geometry/quad_f.h"
#include "ui/gfx/geometry/rect_conversions.h"
@@ -141,7 +142,8 @@ void OcclusionTracker::EnterRenderTarget(const LayerImpl* new_target) {
new_target->render_surface()->screen_space_transform().GetInverse(
&inverse_new_target_screen_space_transform);
- bool entering_root_target = new_target->parent() == NULL;
+ bool entering_root_target =
+ new_target->layer_tree_impl()->IsRootLayer(new_target);
bool copy_outside_occlusion_forward =
stack_.size() > 1 &&
@@ -293,7 +295,7 @@ void OcclusionTracker::LeaveToRenderTarget(const LayerImpl* new_target) {
old_occlusion_from_inside_target_in_new_target);
// TODO(danakj): Strictly this should subtract the inside target occlusion
// before union.
- if (new_target->parent()) {
+ if (!new_target->layer_tree_impl()->IsRootLayer(new_target)) {
stack_[last_index - 1].occlusion_from_outside_target.Union(
old_occlusion_from_outside_target_in_new_target);
}
@@ -303,7 +305,7 @@ void OcclusionTracker::LeaveToRenderTarget(const LayerImpl* new_target) {
stack_.back().target = new_target;
stack_.back().occlusion_from_inside_target =
old_occlusion_from_inside_target_in_new_target;
- if (new_target->parent()) {
+ if (!new_target->layer_tree_impl()->IsRootLayer(new_target)) {
stack_.back().occlusion_from_outside_target =
old_occlusion_from_outside_target_in_new_target;
} else {
@@ -385,7 +387,8 @@ void OcclusionTracker::MarkOccludedBehindLayer(const LayerImpl* layer) {
}
Region OcclusionTracker::ComputeVisibleRegionInScreen() const {
- DCHECK(!stack_.back().target->parent());
+ DCHECK(stack_.back().target->layer_tree_impl()->IsRootLayer(
+ stack_.back().target));
const SimpleEnclosedRegion& occluded =
stack_.back().occlusion_from_inside_target;
Region visible_region(screen_space_clip_rect_);
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698