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

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

Issue 547723002: Reland of: cc: Add occlusion checker as a fixed view of occlusion tracker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 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/occlusion_tracker.h ('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 <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/base/region.h" 10 #include "cc/base/region.h"
(...skipping 10 matching lines...) Expand all
21 OcclusionTracker<LayerType>::OcclusionTracker( 21 OcclusionTracker<LayerType>::OcclusionTracker(
22 const gfx::Rect& screen_space_clip_rect) 22 const gfx::Rect& screen_space_clip_rect)
23 : screen_space_clip_rect_(screen_space_clip_rect), 23 : screen_space_clip_rect_(screen_space_clip_rect),
24 occluding_screen_space_rects_(NULL), 24 occluding_screen_space_rects_(NULL),
25 non_occluding_screen_space_rects_(NULL) {} 25 non_occluding_screen_space_rects_(NULL) {}
26 26
27 template <typename LayerType> 27 template <typename LayerType>
28 OcclusionTracker<LayerType>::~OcclusionTracker() {} 28 OcclusionTracker<LayerType>::~OcclusionTracker() {}
29 29
30 template <typename LayerType> 30 template <typename LayerType>
31 Occlusion OcclusionTracker<LayerType>::GetCurrentOcclusionForLayer(
32 const gfx::Transform& draw_transform) const {
33 DCHECK(!stack_.empty());
34 const StackObject& back = stack_.back();
35 return Occlusion(draw_transform,
36 back.occlusion_from_outside_target,
37 back.occlusion_from_inside_target);
38 }
39
40 template <typename LayerType>
31 void OcclusionTracker<LayerType>::EnterLayer( 41 void OcclusionTracker<LayerType>::EnterLayer(
32 const LayerIteratorPosition<LayerType>& layer_iterator) { 42 const LayerIteratorPosition<LayerType>& layer_iterator) {
33 LayerType* render_target = layer_iterator.target_render_surface_layer; 43 LayerType* render_target = layer_iterator.target_render_surface_layer;
34 44
35 if (layer_iterator.represents_itself) 45 if (layer_iterator.represents_itself)
36 EnterRenderTarget(render_target); 46 EnterRenderTarget(render_target);
37 else if (layer_iterator.represents_target_render_surface) 47 else if (layer_iterator.represents_target_render_surface)
38 FinishedRenderTarget(render_target); 48 FinishedRenderTarget(render_target);
39 } 49 }
40 50
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i) 630 for (size_t i = 0; i < occluded.GetRegionComplexity(); ++i)
621 visible_region.Subtract(occluded.GetRect(i)); 631 visible_region.Subtract(occluded.GetRect(i));
622 return visible_region; 632 return visible_region;
623 } 633 }
624 634
625 // Instantiate (and export) templates here for the linker. 635 // Instantiate (and export) templates here for the linker.
626 template class OcclusionTracker<Layer>; 636 template class OcclusionTracker<Layer>;
627 template class OcclusionTracker<LayerImpl>; 637 template class OcclusionTracker<LayerImpl>;
628 638
629 } // namespace cc 639 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/occlusion_tracker.h ('k') | cc/trees/occlusion_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698