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 CCOcclusionTrackerTestCommon_h | 5 #ifndef CCOcclusionTrackerTestCommon_h |
6 #define CCOcclusionTrackerTestCommon_h | 6 #define CCOcclusionTrackerTestCommon_h |
7 | 7 |
8 #include "CCOcclusionTracker.h" | 8 #include "CCOcclusionTracker.h" |
9 #include "CCRenderSurface.h" | 9 #include "CCRenderSurface.h" |
10 #include "IntRect.h" | 10 #include "IntRect.h" |
11 #include "Region.h" | 11 #include "Region.h" |
12 #include "RenderSurfaceChromium.h" | 12 #include "cc/render_surface.h" |
13 | 13 |
14 namespace WebKitTests { | 14 namespace WebKitTests { |
15 | 15 |
16 // A subclass to expose the total current occlusion. | 16 // A subclass to expose the total current occlusion. |
17 template<typename LayerType, typename RenderSurfaceType> | 17 template<typename LayerType, typename RenderSurfaceType> |
18 class TestCCOcclusionTrackerBase : public cc::CCOcclusionTrackerBase<LayerType,
RenderSurfaceType> { | 18 class TestCCOcclusionTrackerBase : public cc::CCOcclusionTrackerBase<LayerType,
RenderSurfaceType> { |
19 public: | 19 public: |
20 TestCCOcclusionTrackerBase(cc::IntRect screenScissorRect, bool recordMetrics
ForFrame = false) | 20 TestCCOcclusionTrackerBase(cc::IntRect screenScissorRect, bool recordMetrics
ForFrame = false) |
21 : cc::CCOcclusionTrackerBase<LayerType, RenderSurfaceType>(screenScissor
Rect, recordMetricsForFrame) | 21 : cc::CCOcclusionTrackerBase<LayerType, RenderSurfaceType>(screenScissor
Rect, recordMetricsForFrame) |
22 { | 22 { |
23 } | 23 } |
24 | 24 |
25 cc::Region occlusionInScreenSpace() const { return cc::CCOcclusionTrackerBas
e<LayerType, RenderSurfaceType>::m_stack.last().occlusionInScreen; } | 25 cc::Region occlusionInScreenSpace() const { return cc::CCOcclusionTrackerBas
e<LayerType, RenderSurfaceType>::m_stack.last().occlusionInScreen; } |
26 cc::Region occlusionInTargetSurface() const { return cc::CCOcclusionTrackerB
ase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInTarget; } | 26 cc::Region occlusionInTargetSurface() const { return cc::CCOcclusionTrackerB
ase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInTarget; } |
27 | 27 |
28 void setOcclusionInScreenSpace(const cc::Region& region) { cc::CCOcclusionTr
ackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInScreen = regi
on; } | 28 void setOcclusionInScreenSpace(const cc::Region& region) { cc::CCOcclusionTr
ackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInScreen = regi
on; } |
29 void setOcclusionInTargetSurface(const cc::Region& region) { cc::CCOcclusion
TrackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInTarget = re
gion; } | 29 void setOcclusionInTargetSurface(const cc::Region& region) { cc::CCOcclusion
TrackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInTarget = re
gion; } |
30 }; | 30 }; |
31 | 31 |
32 typedef TestCCOcclusionTrackerBase<cc::LayerChromium, cc::RenderSurfaceChromium>
TestCCOcclusionTracker; | 32 typedef TestCCOcclusionTrackerBase<cc::LayerChromium, cc::RenderSurfaceChromium>
TestCCOcclusionTracker; |
33 typedef TestCCOcclusionTrackerBase<cc::CCLayerImpl, cc::CCRenderSurface> TestCCO
cclusionTrackerImpl; | 33 typedef TestCCOcclusionTrackerBase<cc::CCLayerImpl, cc::CCRenderSurface> TestCCO
cclusionTrackerImpl; |
34 | 34 |
35 } | 35 } |
36 | 36 |
37 #endif // CCOcclusionTrackerTestCommon_h | 37 #endif // CCOcclusionTrackerTestCommon_h |
OLD | NEW |