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