Chromium Code Reviews| Index: cc/test/fake_picture_pile.h |
| diff --git a/cc/test/fake_picture_pile.h b/cc/test/fake_picture_pile.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..30250c24b160e928531cef7ba23daafde08b9824 |
| --- /dev/null |
| +++ b/cc/test/fake_picture_pile.h |
| @@ -0,0 +1,53 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
|
danakj
2014/11/12 21:30:49
btw 2014
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CC_FAKE_PICTURE_PILE_H_ |
|
danakj
2014/11/12 21:32:19
oh and CC_TEST_FAKE_PICTURE_PILE_H
you want the f
|
| +#define CC_FAKE_PICTURE_PILE_H_ |
| + |
| +#include "cc/resources/picture_pile.h" |
| + |
| +namespace cc { |
| + |
| +class FakePicturePile : public PicturePile { |
| + public: |
| + ~FakePicturePile() override {} |
| + |
| + using PicturePile::buffer_pixels; |
| + using PicturePile::CanRasterSlowTileCheck; |
| + using PicturePile::Clear; |
| + |
| + PictureMap& picture_map() { return picture_map_; } |
| + const gfx::Rect& recorded_viewport() const { return recorded_viewport_; } |
| + |
| + bool CanRasterLayerRect(gfx::Rect layer_rect) { |
| + layer_rect.Intersect(gfx::Rect(tiling_.tiling_size())); |
| + if (recorded_viewport_.Contains(layer_rect)) |
| + return true; |
| + return CanRasterSlowTileCheck(layer_rect); |
| + } |
| + |
| + bool HasRecordings() const { return has_any_recordings_; } |
| + |
| + void SetRecordedViewport(const gfx::Rect& viewport) { |
| + recorded_viewport_ = viewport; |
| + } |
| + |
| + void SetHasAnyRecordings(bool has_recordings) { |
| + has_any_recordings_ = has_recordings; |
| + } |
| + |
| + TilingData& tiling() { return tiling_; } |
| + |
| + bool is_solid_color() const { return is_solid_color_; } |
| + SkColor solid_color() const { return solid_color_; } |
| + |
| + void SetPixelRecordDistance(int d) { pixel_record_distance_ = d; } |
| + |
| + typedef PicturePile::PictureInfo PictureInfo; |
| + typedef PicturePile::PictureMapKey PictureMapKey; |
| + typedef PicturePile::PictureMap PictureMap; |
| +}; |
| +} // namespace cc |
| + |
| +#endif // CC_FAKE_PICTURE_PILE_H_ |