OLD | NEW |
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 #ifndef CCOcclusionTracker_h | 5 #ifndef CCOcclusionTracker_h |
6 #define CCOcclusionTracker_h | 6 #define CCOcclusionTracker_h |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "CCLayerIterator.h" | 9 #include "CCLayerIterator.h" |
10 #include "FloatQuad.h" | 10 #include "FloatQuad.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 CCOcclusionTrackerBase(IntRect rootTargetRect, bool recordMetricsForFrame); | 28 CCOcclusionTrackerBase(IntRect rootTargetRect, bool recordMetricsForFrame); |
29 | 29 |
30 // Called at the beginning of each step in the CCLayerIterator's front-to-ba
ck traversal. | 30 // Called at the beginning of each step in the CCLayerIterator's front-to-ba
ck traversal. |
31 void enterLayer(const CCLayerIteratorPosition<LayerType>&); | 31 void enterLayer(const CCLayerIteratorPosition<LayerType>&); |
32 // Called at the end of each step in the CCLayerIterator's front-to-back tra
versal. | 32 // Called at the end of each step in the CCLayerIterator's front-to-back tra
versal. |
33 void leaveLayer(const CCLayerIteratorPosition<LayerType>&); | 33 void leaveLayer(const CCLayerIteratorPosition<LayerType>&); |
34 | 34 |
35 // Returns true if the given rect in content space for the layer is fully oc
cluded in either screen space or the layer's target surface. | 35 // Returns true if the given rect in content space for the layer is fully oc
cluded in either screen space or the layer's target surface. |
36 bool occluded(const LayerType*, const IntRect& contentRect, bool* hasOcclusi
onFromOutsideTargetSurface = 0) const; | 36 bool occluded(const LayerType*, const IntRect& contentRect, bool* hasOcclusi
onFromOutsideTargetSurface = 0) const; |
37 // Gives an unoccluded sub-rect of |contentRect| in the content space of the
layer. Used when considering occlusion for a layer that paints/draws something. | 37 // Gives an unoccluded sub-rect of |contentRect| in the content space of the
layer. Used when considering occlusion for a layer that paints/draws something. |
38 IntRect unoccludedContentRect(const LayerType*, const IntRect& contentRect,
bool* hasOcclusionFromOutsideTargetSurface = 0) const; | 38 IntRect unoccludedContentRect(const LayerType*, const IntRect& contentRect,
const WebKit::WebTransformationMatrix& drawTransform, bool transformsToTargetKno
wn, const IntRect& clipRectInTarget, bool* hasOcclusionFromOutsideTargetSurface
= 0) const; |
39 | 39 |
40 // Gives an unoccluded sub-rect of |contentRect| in the content space of the
renderTarget owned by the layer. | 40 // Gives an unoccluded sub-rect of |contentRect| in the content space of the
renderTarget owned by the layer. |
41 // Used when considering occlusion for a contributing surface that is render
ing into another target. | 41 // Used when considering occlusion for a contributing surface that is render
ing into another target. |
42 IntRect unoccludedContributingSurfaceContentRect(const LayerType*, bool forR
eplica, const IntRect& contentRect, bool* hasOcclusionFromOutsideTargetSurface =
0) const; | 42 IntRect unoccludedContributingSurfaceContentRect(const LayerType*, bool forR
eplica, const IntRect& contentRect, bool* hasOcclusionFromOutsideTargetSurface =
0) const; |
43 | 43 |
44 // Report operations for recording overdraw metrics. | 44 // Report operations for recording overdraw metrics. |
45 CCOverdrawMetrics& overdrawMetrics() const { return *m_overdrawMetrics.get()
; } | 45 CCOverdrawMetrics& overdrawMetrics() const { return *m_overdrawMetrics.get()
; } |
46 | 46 |
47 // Gives the region of the screen that is not occluded by something opaque. | 47 // Gives the region of the screen that is not occluded by something opaque. |
48 Region computeVisibleRegionInScreen() const { return subtract(Region(m_rootT
argetRect), m_stack.last().occlusionInScreen); } | 48 Region computeVisibleRegionInScreen() const { return subtract(Region(m_rootT
argetRect), m_stack.last().occlusionInScreen); } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 Vector<IntRect>* m_occludingScreenSpaceRects; | 96 Vector<IntRect>* m_occludingScreenSpaceRects; |
97 | 97 |
98 DISALLOW_COPY_AND_ASSIGN(CCOcclusionTrackerBase); | 98 DISALLOW_COPY_AND_ASSIGN(CCOcclusionTrackerBase); |
99 }; | 99 }; |
100 | 100 |
101 typedef CCOcclusionTrackerBase<LayerChromium, RenderSurfaceChromium> CCOcclusion
Tracker; | 101 typedef CCOcclusionTrackerBase<LayerChromium, RenderSurfaceChromium> CCOcclusion
Tracker; |
102 typedef CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface> CCOcclusionTrackerI
mpl; | 102 typedef CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface> CCOcclusionTrackerI
mpl; |
103 | 103 |
104 } | 104 } |
105 #endif // CCOcclusionTracker_h | 105 #endif // CCOcclusionTracker_h |
OLD | NEW |