diff options
Diffstat (limited to 'cc/test/fake_picture_pile_impl.h')
-rw-r--r-- | cc/test/fake_picture_pile_impl.h | 59 |
1 files changed, 10 insertions, 49 deletions
diff --git a/cc/test/fake_picture_pile_impl.h b/cc/test/fake_picture_pile_impl.h index 3a43702..a21509a0 100644 --- a/cc/test/fake_picture_pile_impl.h +++ b/cc/test/fake_picture_pile_impl.h @@ -7,7 +7,7 @@ #include "base/memory/ref_counted.h" #include "cc/resources/picture_pile_impl.h" -#include "cc/test/fake_content_layer_client.h" +#include "cc/test/fake_picture_pile.h" namespace base { class WaitableEvent; @@ -17,6 +17,11 @@ namespace cc { class FakePicturePileImpl : public PicturePileImpl { public: + static scoped_refptr<FakePicturePileImpl> CreatePile( + const gfx::Size& tile_size, + const gfx::Size& layer_bounds, + bool is_filled); + static scoped_refptr<FakePicturePileImpl> CreateFilledPileWithDefaultTileSize( const gfx::Size& layer_bounds) { return CreateFilledPile(gfx::Size(512, 512), layer_bounds); @@ -32,8 +37,9 @@ class FakePicturePileImpl : public PicturePileImpl { const gfx::Size& tile_size, const gfx::Size& layer_bounds); static scoped_refptr<FakePicturePileImpl> - CreateEmptyPileThatThinksItHasRecordings(const gfx::Size& tile_size, - const gfx::Size& layer_bounds); + CreateEmptyPileThatThinksItHasRecordings(const gfx::Size& tile_size, + const gfx::Size& layer_bounds, + bool is_solid_color); static scoped_refptr<FakePicturePileImpl> CreateInfiniteFilledPile(); static scoped_refptr<FakePicturePileImpl> CreateFromPile( const PicturePile* other, @@ -44,63 +50,18 @@ class FakePicturePileImpl : public PicturePileImpl { const gfx::Rect& canvas_rect, float contents_scale) const override; - TilingData& tiling() { return tiling_; } - - void AddRecordingAt(int x, int y); - void RemoveRecordingAt(int x, int y); - void RerecordPile(); - - void add_draw_rect(const gfx::RectF& rect) { - client_.add_draw_rect(rect, default_paint_); - } - - void add_draw_bitmap(const SkBitmap& bitmap, const gfx::Point& point) { - client_.add_draw_bitmap(bitmap, point, default_paint_); - } - - void add_draw_rect_with_paint(const gfx::RectF& rect, const SkPaint& paint) { - client_.add_draw_rect(rect, paint); - } - - void add_draw_bitmap_with_paint(const SkBitmap& bitmap, - const gfx::Point& point, - const SkPaint& paint) { - client_.add_draw_bitmap(bitmap, point, paint); - } - - void set_default_paint(const SkPaint& paint) { - default_paint_ = paint; - } - - void set_background_color(SkColor color) { - background_color_ = color; - } - - void set_clear_canvas_with_debug_color(bool clear) { - clear_canvas_with_debug_color_ = clear; - } - - void set_is_solid_color(bool is_solid_color) { - is_solid_color_ = is_solid_color; - } + const TilingData& tiling() { return tiling_; } bool HasRecordingAt(int x, int y) const; - int num_tiles_x() const { return tiling_.num_tiles_x(); } int num_tiles_y() const { return tiling_.num_tiles_y(); } - void SetMinContentsScale(float scale); - void SetBufferPixels(int new_buffer_pixels); - void Clear(); - protected: FakePicturePileImpl(); FakePicturePileImpl(const PicturePile* other, base::WaitableEvent* playback_allowed_event); ~FakePicturePileImpl() override; - FakeContentLayerClient client_; - SkPaint default_paint_; base::WaitableEvent* playback_allowed_event_; gfx::Size tile_grid_size_; }; |