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 CC_TEST_LAYER_TEST_COMMON_H_ | 5 #ifndef CC_TEST_LAYER_TEST_COMMON_H_ |
6 #define CC_TEST_LAYER_TEST_COMMON_H_ | 6 #define CC_TEST_LAYER_TEST_COMMON_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/quads/render_pass.h" | 10 #include "cc/quads/render_pass.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 class RenderSurfaceImpl; | 35 class RenderSurfaceImpl; |
36 class ResourceProvider; | 36 class ResourceProvider; |
37 | 37 |
38 class LayerTestCommon { | 38 class LayerTestCommon { |
39 public: | 39 public: |
40 static const char* quad_string; | 40 static const char* quad_string; |
41 | 41 |
42 static void VerifyQuadsExactlyCoverRect(const QuadList& quads, | 42 static void VerifyQuadsExactlyCoverRect(const QuadList& quads, |
43 const gfx::Rect& rect); | 43 const gfx::Rect& rect); |
44 | 44 |
45 static void VerifyQuadsCoverRectWithOcclusion( | 45 static void VerifyQuadsAreOccluded(const QuadList& quads, |
46 const QuadList& quads, | 46 const gfx::Rect& occluded, |
47 const gfx::Rect& rect, | 47 size_t* partially_occluded_count); |
48 const gfx::Rect& occluded, | |
49 size_t* partially_occluded_count); | |
50 | 48 |
51 class LayerImplTest { | 49 class LayerImplTest { |
52 public: | 50 public: |
53 LayerImplTest(); | 51 LayerImplTest(); |
54 ~LayerImplTest(); | 52 ~LayerImplTest(); |
55 | 53 |
56 template <typename T> | 54 template <typename T> |
57 T* AddChildToRoot() { | 55 T* AddChildToRoot() { |
58 scoped_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), 2); | 56 scoped_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), 2); |
59 T* ptr = layer.get(); | 57 T* ptr = layer.get(); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 scoped_ptr<FakeLayerTreeHost> host_; | 127 scoped_ptr<FakeLayerTreeHost> host_; |
130 scoped_ptr<LayerImpl> root_layer_impl_; | 128 scoped_ptr<LayerImpl> root_layer_impl_; |
131 scoped_ptr<RenderPass> render_pass_; | 129 scoped_ptr<RenderPass> render_pass_; |
132 MockOcclusionTracker<LayerImpl> occlusion_tracker_; | 130 MockOcclusionTracker<LayerImpl> occlusion_tracker_; |
133 }; | 131 }; |
134 }; | 132 }; |
135 | 133 |
136 } // namespace cc | 134 } // namespace cc |
137 | 135 |
138 #endif // CC_TEST_LAYER_TEST_COMMON_H_ | 136 #endif // CC_TEST_LAYER_TEST_COMMON_H_ |
OLD | NEW |