OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // Report operations for recording overdraw metrics. | 70 // Report operations for recording overdraw metrics. |
71 CCOverdrawMetrics& overdrawMetrics() const { return *m_overdrawMetrics.get()
; } | 71 CCOverdrawMetrics& overdrawMetrics() const { return *m_overdrawMetrics.get()
; } |
72 | 72 |
73 // FIXME: Remove this when paint tracking is on for paint culling. | 73 // FIXME: Remove this when paint tracking is on for paint culling. |
74 void setUsePaintTracking(bool use) { m_usePaintTracking = use; } | 74 void setUsePaintTracking(bool use) { m_usePaintTracking = use; } |
75 | 75 |
76 // FIXME: Remove these in future, they are to make CLs for transitioning to
this easier. | 76 // FIXME: Remove these in future, they are to make CLs for transitioning to
this easier. |
77 const Region& currentOcclusionInScreenSpace() const; | 77 const Region& currentOcclusionInScreenSpace() const; |
78 const Region& currentOcclusionInTargetSurface() const; | 78 const Region& currentOcclusionInTargetSurface() const; |
79 | 79 |
| 80 // Gives the region of the screen that is not occluded by something opaque. |
| 81 Region computeVisibleRegionInScreen() const { return subtract(Region(m_sciss
orRectInScreenSpace), m_stack.last().occlusionInScreen); } |
| 82 |
80 protected: | 83 protected: |
81 struct StackObject { | 84 struct StackObject { |
82 StackObject() : surface(0) { } | 85 StackObject() : surface(0) { } |
83 StackObject(const RenderSurfaceType* surface) : surface(surface) { } | 86 StackObject(const RenderSurfaceType* surface) : surface(surface) { } |
84 const RenderSurfaceType* surface; | 87 const RenderSurfaceType* surface; |
85 Region occlusionInScreen; | 88 Region occlusionInScreen; |
86 Region occlusionInTarget; | 89 Region occlusionInTarget; |
87 }; | 90 }; |
88 | 91 |
89 // The stack holds occluded regions for subtrees in the RenderSurface-Layer
tree, so that when we leave a subtree we may | 92 // The stack holds occluded regions for subtrees in the RenderSurface-Layer
tree, so that when we leave a subtree we may |
(...skipping 12 matching lines...) Expand all Loading... |
102 IntRect m_scissorRectInScreenSpace; | 105 IntRect m_scissorRectInScreenSpace; |
103 OwnPtr<CCOverdrawMetrics> m_overdrawMetrics; | 106 OwnPtr<CCOverdrawMetrics> m_overdrawMetrics; |
104 bool m_usePaintTracking; // FIXME: Remove this when paint tracking is on for
paint culling. | 107 bool m_usePaintTracking; // FIXME: Remove this when paint tracking is on for
paint culling. |
105 }; | 108 }; |
106 | 109 |
107 typedef CCOcclusionTrackerBase<LayerChromium, RenderSurfaceChromium> CCOcclusion
Tracker; | 110 typedef CCOcclusionTrackerBase<LayerChromium, RenderSurfaceChromium> CCOcclusion
Tracker; |
108 typedef CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface> CCOcclusionTrackerI
mpl; | 111 typedef CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface> CCOcclusionTrackerI
mpl; |
109 | 112 |
110 } | 113 } |
111 #endif // CCOcclusionTracker_h | 114 #endif // CCOcclusionTracker_h |
OLD | NEW |