Chromium Code Reviews| Index: cc/test/fake_display_list_recording_source.h |
| diff --git a/cc/test/fake_display_list_recording_source.h b/cc/test/fake_display_list_recording_source.h |
| index 3585a7e781c60245f8d5f40781220c9c45d1564d..938ae749b1061974da5cf8cb0a7e091ca0cc4666 100644 |
| --- a/cc/test/fake_display_list_recording_source.h |
| +++ b/cc/test/fake_display_list_recording_source.h |
| @@ -10,6 +10,10 @@ |
| #include "cc/test/fake_content_layer_client.h" |
| #include "cc/trees/layer_tree_settings.h" |
| +namespace base { |
| +class WaitableEvent; |
| +} // namespace base |
| + |
| namespace cc { |
| // This class provides method for test to add bitmap and draw rect to content |
| @@ -19,7 +23,8 @@ class FakeDisplayListRecordingSource : public DisplayListRecordingSource { |
| public: |
| explicit FakeDisplayListRecordingSource(const gfx::Size& grid_cell_size) |
| : DisplayListRecordingSource(grid_cell_size), |
| - force_unsuitable_for_gpu_rasterization_(false) {} |
| + force_unsuitable_for_gpu_rasterization_(false), |
| + playback_allowed_event_(nullptr) {} |
| ~FakeDisplayListRecordingSource() override {} |
| static scoped_ptr<FakeDisplayListRecordingSource> CreateRecordingSource( |
| @@ -43,6 +48,9 @@ class FakeDisplayListRecordingSource : public DisplayListRecordingSource { |
| return recording_source; |
| } |
| + scoped_refptr<RasterSource> CreateRasterSource( |
|
danakj
2015/09/22 21:52:15
// DisplayListResourceSource overrides.
vmpstr
2015/09/22 22:57:50
Done.
|
| + bool can_use_lcd) const override; |
| + |
| void SetRecordedViewport(const gfx::Rect& recorded_viewport) { |
| recorded_viewport_ = recorded_viewport; |
| } |
| @@ -88,21 +96,34 @@ class FakeDisplayListRecordingSource : public DisplayListRecordingSource { |
| client_.add_draw_image_with_transform(image, transform, default_paint_); |
| } |
| + void add_draw_image_with_paint(const SkImage* image, |
| + const gfx::Point& point, |
| + const SkPaint& paint) { |
| + client_.add_draw_image(image, point, paint); |
| + } |
| + |
| void set_default_paint(const SkPaint& paint) { default_paint_ = paint; } |
| void set_reported_memory_usage(size_t reported_memory_usage) { |
| client_.set_reported_memory_usage(reported_memory_usage); |
| } |
| + void reset_draws() { client_ = FakeContentLayerClient(); } |
| + |
| bool IsSuitableForGpuRasterization() const override; |
|
danakj
2015/09/22 21:52:15
move this up with the other override.
vmpstr
2015/09/22 22:57:50
Done.
|
| void SetUnsuitableForGpuRasterization() { |
| force_unsuitable_for_gpu_rasterization_ = true; |
| } |
| + void SetPlaybackAllowedEvent(base::WaitableEvent* event) { |
| + playback_allowed_event_ = event; |
| + } |
| + |
| private: |
| FakeContentLayerClient client_; |
| SkPaint default_paint_; |
| bool force_unsuitable_for_gpu_rasterization_; |
| + base::WaitableEvent* playback_allowed_event_; |
| }; |
| } // namespace cc |