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 "FloatQuad.h" | 8 #include "FloatQuad.h" |
9 #include "Region.h" | 9 #include "Region.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 gfx::Rect unoccludedContentRect(const LayerType* renderTarget, const gfx::Re
ct& contentRect, const WebKit::WebTransformationMatrix& drawTransform, bool impl
DrawTransformIsUnknown, const gfx::Rect& clippedRectInTarget, bool* hasOcclusion
FromOutsideTargetSurface = 0) const; | 39 gfx::Rect unoccludedContentRect(const LayerType* renderTarget, const gfx::Re
ct& contentRect, const WebKit::WebTransformationMatrix& drawTransform, bool impl
DrawTransformIsUnknown, const gfx::Rect& clippedRectInTarget, bool* hasOcclusion
FromOutsideTargetSurface = 0) const; |
40 | 40 |
41 // Gives an unoccluded sub-rect of |contentRect| in the content space of the
renderTarget owned by the layer. | 41 // Gives an unoccluded sub-rect of |contentRect| in the content space of the
renderTarget owned by the layer. |
42 // Used when considering occlusion for a contributing surface that is render
ing into another target. | 42 // Used when considering occlusion for a contributing surface that is render
ing into another target. |
43 gfx::Rect unoccludedContributingSurfaceContentRect(const LayerType*, bool fo
rReplica, const gfx::Rect& contentRect, bool* hasOcclusionFromOutsideTargetSurfa
ce = 0) const; | 43 gfx::Rect unoccludedContributingSurfaceContentRect(const LayerType*, bool fo
rReplica, const gfx::Rect& contentRect, bool* hasOcclusionFromOutsideTargetSurfa
ce = 0) const; |
44 | 44 |
45 // Report operations for recording overdraw metrics. | 45 // Report operations for recording overdraw metrics. |
46 OverdrawMetrics& overdrawMetrics() const { return *m_overdrawMetrics.get();
} | 46 OverdrawMetrics& overdrawMetrics() const { return *m_overdrawMetrics.get();
} |
47 | 47 |
48 // Gives the region of the screen that is not occluded by something opaque. | 48 // Gives the region of the screen that is not occluded by something opaque. |
49 Region computeVisibleRegionInScreen() const { return subtract(Region(cc::Int
Rect(m_rootTargetRect)), m_stack.last().occlusionInScreen); } | 49 Region computeVisibleRegionInScreen() const { return subtract(Region(m_rootT
argetRect), m_stack.last().occlusionInScreen); } |
50 | 50 |
51 void setMinimumTrackingSize(const gfx::Size& size) { m_minimumTrackingSize =
size; } | 51 void setMinimumTrackingSize(const gfx::Size& size) { m_minimumTrackingSize =
size; } |
52 | 52 |
53 // The following is used for visualization purposes. | 53 // The following is used for visualization purposes. |
54 void setOccludingScreenSpaceRectsContainer(std::vector<gfx::Rect>* rects) {
m_occludingScreenSpaceRects = rects; } | 54 void setOccludingScreenSpaceRectsContainer(std::vector<gfx::Rect>* rects) {
m_occludingScreenSpaceRects = rects; } |
55 | 55 |
56 protected: | 56 protected: |
57 struct StackObject { | 57 struct StackObject { |
58 StackObject() : target(0) { } | 58 StackObject() : target(0) { } |
59 StackObject(const LayerType* target) : target(target) { } | 59 StackObject(const LayerType* target) : target(target) { } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(OcclusionTrackerBase); | 99 DISALLOW_COPY_AND_ASSIGN(OcclusionTrackerBase); |
100 }; | 100 }; |
101 | 101 |
102 typedef OcclusionTrackerBase<Layer, RenderSurface> OcclusionTracker; | 102 typedef OcclusionTrackerBase<Layer, RenderSurface> OcclusionTracker; |
103 typedef OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl> OcclusionTrackerImpl; | 103 typedef OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl> OcclusionTrackerImpl; |
104 | 104 |
105 } // namespace cc | 105 } // namespace cc |
106 | 106 |
107 #endif // CCOcclusionTracker_h | 107 #endif // CCOcclusionTracker_h |
OLD | NEW |