[Do not revert] Roll-back V8 to version 4.4.63.
[chromium-blink-merge.git] / cc / test / fake_picture_pile_impl.h
bloba21509a0800857be14b46df6aad36e5ef6519d83
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_TEST_FAKE_PICTURE_PILE_IMPL_H_
6 #define CC_TEST_FAKE_PICTURE_PILE_IMPL_H_
8 #include "base/memory/ref_counted.h"
9 #include "cc/resources/picture_pile_impl.h"
10 #include "cc/test/fake_picture_pile.h"
12 namespace base {
13 class WaitableEvent;
16 namespace cc {
18 class FakePicturePileImpl : public PicturePileImpl {
19 public:
20 static scoped_refptr<FakePicturePileImpl> CreatePile(
21 const gfx::Size& tile_size,
22 const gfx::Size& layer_bounds,
23 bool is_filled);
25 static scoped_refptr<FakePicturePileImpl> CreateFilledPileWithDefaultTileSize(
26 const gfx::Size& layer_bounds) {
27 return CreateFilledPile(gfx::Size(512, 512), layer_bounds);
29 static scoped_refptr<FakePicturePileImpl> CreateEmptyPileWithDefaultTileSize(
30 const gfx::Size& layer_bounds) {
31 return CreateEmptyPile(gfx::Size(512, 512), layer_bounds);
33 static scoped_refptr<FakePicturePileImpl> CreateFilledPile(
34 const gfx::Size& tile_size,
35 const gfx::Size& layer_bounds);
36 static scoped_refptr<FakePicturePileImpl> CreateEmptyPile(
37 const gfx::Size& tile_size,
38 const gfx::Size& layer_bounds);
39 static scoped_refptr<FakePicturePileImpl>
40 CreateEmptyPileThatThinksItHasRecordings(const gfx::Size& tile_size,
41 const gfx::Size& layer_bounds,
42 bool is_solid_color);
43 static scoped_refptr<FakePicturePileImpl> CreateInfiniteFilledPile();
44 static scoped_refptr<FakePicturePileImpl> CreateFromPile(
45 const PicturePile* other,
46 base::WaitableEvent* playback_allowed_event);
48 // Hi-jack the PlaybackToCanvas method to delay its completion.
49 void PlaybackToCanvas(SkCanvas* canvas,
50 const gfx::Rect& canvas_rect,
51 float contents_scale) const override;
53 const TilingData& tiling() { return tiling_; }
55 bool HasRecordingAt(int x, int y) const;
56 int num_tiles_x() const { return tiling_.num_tiles_x(); }
57 int num_tiles_y() const { return tiling_.num_tiles_y(); }
59 protected:
60 FakePicturePileImpl();
61 FakePicturePileImpl(const PicturePile* other,
62 base::WaitableEvent* playback_allowed_event);
63 ~FakePicturePileImpl() override;
65 base::WaitableEvent* playback_allowed_event_;
66 gfx::Size tile_grid_size_;
69 } // namespace cc
71 #endif // CC_TEST_FAKE_PICTURE_PILE_IMPL_H_