OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_RASTER_SOURCE_H_ | 5 #ifndef CC_TEST_FAKE_RASTER_SOURCE_H_ |
6 #define CC_TEST_FAKE_RASTER_SOURCE_H_ | 6 #define CC_TEST_FAKE_RASTER_SOURCE_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "cc/paint/paint_canvas.h" |
9 #include "cc/playback/raster_source.h" | 10 #include "cc/playback/raster_source.h" |
10 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
11 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
12 | 13 |
13 class SkCanvas; | |
14 | |
15 namespace base { | 14 namespace base { |
16 class WaitableEvent; | 15 class WaitableEvent; |
17 } | 16 } |
18 | 17 |
19 namespace cc { | 18 namespace cc { |
20 | 19 |
21 class RecordingSource; | 20 class RecordingSource; |
22 | 21 |
23 class FakeRasterSource : public RasterSource { | 22 class FakeRasterSource : public RasterSource { |
24 public: | 23 public: |
25 static scoped_refptr<FakeRasterSource> CreateInfiniteFilled(); | 24 static scoped_refptr<FakeRasterSource> CreateInfiniteFilled(); |
26 static scoped_refptr<FakeRasterSource> CreateFilled(const gfx::Size& size); | 25 static scoped_refptr<FakeRasterSource> CreateFilled(const gfx::Size& size); |
27 static scoped_refptr<FakeRasterSource> CreateFilledLCD(const gfx::Size& size); | 26 static scoped_refptr<FakeRasterSource> CreateFilledLCD(const gfx::Size& size); |
28 static scoped_refptr<FakeRasterSource> CreateFilledSolidColor( | 27 static scoped_refptr<FakeRasterSource> CreateFilledSolidColor( |
29 const gfx::Size& size); | 28 const gfx::Size& size); |
30 static scoped_refptr<FakeRasterSource> CreatePartiallyFilled( | 29 static scoped_refptr<FakeRasterSource> CreatePartiallyFilled( |
31 const gfx::Size& size, | 30 const gfx::Size& size, |
32 const gfx::Rect& recorded_viewport); | 31 const gfx::Rect& recorded_viewport); |
33 static scoped_refptr<FakeRasterSource> CreateEmpty(const gfx::Size& size); | 32 static scoped_refptr<FakeRasterSource> CreateEmpty(const gfx::Size& size); |
34 static scoped_refptr<FakeRasterSource> CreateFromRecordingSource( | 33 static scoped_refptr<FakeRasterSource> CreateFromRecordingSource( |
35 const RecordingSource* recording_source, | 34 const RecordingSource* recording_source, |
36 bool can_use_lcd); | 35 bool can_use_lcd); |
37 static scoped_refptr<FakeRasterSource> CreateFromRecordingSourceWithWaitable( | 36 static scoped_refptr<FakeRasterSource> CreateFromRecordingSourceWithWaitable( |
38 const RecordingSource* recording_source, | 37 const RecordingSource* recording_source, |
39 bool can_use_lcd, | 38 bool can_use_lcd, |
40 base::WaitableEvent* playback_allowed_event); | 39 base::WaitableEvent* playback_allowed_event); |
41 | 40 |
42 void PlaybackToCanvas(SkCanvas* canvas, | 41 void PlaybackToCanvas(PaintCanvas* canvas, |
43 const PlaybackSettings& settings) const override; | 42 const PlaybackSettings& settings) const override; |
44 | 43 |
45 protected: | 44 protected: |
46 FakeRasterSource(const RecordingSource* recording_source, bool can_use_lcd); | 45 FakeRasterSource(const RecordingSource* recording_source, bool can_use_lcd); |
47 FakeRasterSource(const RecordingSource* recording_source, | 46 FakeRasterSource(const RecordingSource* recording_source, |
48 bool can_use_lcd, | 47 bool can_use_lcd, |
49 base::WaitableEvent* playback_allowed_event); | 48 base::WaitableEvent* playback_allowed_event); |
50 ~FakeRasterSource() override; | 49 ~FakeRasterSource() override; |
51 | 50 |
52 private: | 51 private: |
53 base::WaitableEvent* playback_allowed_event_; | 52 base::WaitableEvent* playback_allowed_event_; |
54 }; | 53 }; |
55 | 54 |
56 } // namespace cc | 55 } // namespace cc |
57 | 56 |
58 #endif // CC_TEST_FAKE_RASTER_SOURCE_H_ | 57 #endif // CC_TEST_FAKE_RASTER_SOURCE_H_ |
OLD | NEW |