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_FAKE_CONTENT_LAYER_CLIENT_H_ | 5 #ifndef CC_TEST_FAKE_CONTENT_LAYER_CLIENT_H_ |
6 #define CC_TEST_FAKE_CONTENT_LAYER_CLIENT_H_ | 6 #define CC_TEST_FAKE_CONTENT_LAYER_CLIENT_H_ |
7 | 7 |
| 8 #include <vector> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "cc/content_layer_client.h" | 11 #include "cc/content_layer_client.h" |
| 12 #include "ui/gfx/rect.h" |
10 | 13 |
11 namespace cc { | 14 namespace cc { |
12 | 15 |
13 class FakeContentLayerClient : public cc::ContentLayerClient { | 16 class FakeContentLayerClient : public cc::ContentLayerClient { |
14 public: | 17 public: |
15 FakeContentLayerClient(); | 18 FakeContentLayerClient(); |
| 19 virtual ~FakeContentLayerClient(); |
16 | 20 |
17 virtual void paintContents(SkCanvas*, const gfx::Rect& rect, gfx::RectF& opa
queRect) OVERRIDE; | 21 virtual void paintContents(SkCanvas*, const gfx::Rect& rect, |
| 22 gfx::RectF& opaque_rect) OVERRIDE; |
18 | 23 |
19 void setPaintAllOpaque(bool opaque) { m_paintAllOpaque = opaque; } | 24 void setPaintAllOpaque(bool opaque) { paint_all_opaque_ = opaque; } |
| 25 |
| 26 void addDrawRect(const gfx::Rect& rect) { draw_rects_.push_back(rect); } |
20 | 27 |
21 private: | 28 private: |
22 bool m_paintAllOpaque; | 29 typedef std::vector<gfx::Rect> RectVector; |
| 30 |
| 31 bool paint_all_opaque_; |
| 32 RectVector draw_rects_; |
23 }; | 33 }; |
24 | 34 |
25 } // namespace cc | 35 } // namespace cc |
26 | 36 |
27 #endif // CC_TEST_FAKE_CONTENT_LAYER_CLIENT_H_ | 37 #endif // CC_TEST_FAKE_CONTENT_LAYER_CLIENT_H_ |
OLD | NEW |