Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #ifndef CC_TEST_PICTURE_PILE_H_ | |
| 6 #define CC_TEST_PICTURE_PILE_H_ | |
| 7 | |
| 8 #include "cc/resources/picture_pile.h" | |
| 9 | |
| 10 namespace cc { | |
| 11 | |
| 12 class TestPicturePile : public PicturePile { | |
|
danakj
2014/11/12 19:56:38
I know this class already existed (and that we hav
hendrikw
2014/11/12 20:25:42
Acknowledged.
| |
| 13 public: | |
| 14 ~TestPicturePile() override {} | |
| 15 | |
| 16 using PicturePile::buffer_pixels; | |
| 17 using PicturePile::CanRasterSlowTileCheck; | |
| 18 using PicturePile::Clear; | |
| 19 | |
| 20 PictureMap& picture_map() { return picture_map_; } | |
| 21 const gfx::Rect& recorded_viewport() const { return recorded_viewport_; } | |
| 22 | |
| 23 bool CanRasterLayerRect(gfx::Rect layer_rect) { | |
| 24 layer_rect.Intersect(gfx::Rect(tiling_.tiling_size())); | |
| 25 if (recorded_viewport_.Contains(layer_rect)) | |
| 26 return true; | |
| 27 return CanRasterSlowTileCheck(layer_rect); | |
| 28 } | |
| 29 | |
| 30 bool HasRecordings() const { return has_any_recordings_; } | |
| 31 | |
| 32 void SetRecordedViewportForTesting(const gfx::Rect& viewport) { | |
| 33 recorded_viewport_ = viewport; | |
| 34 } | |
| 35 | |
| 36 void SetHasAnyRecordingsForTesting(bool has_recordings) { | |
| 37 has_any_recordings_ = has_recordings; | |
| 38 } | |
| 39 | |
| 40 TilingData& tiling() { return tiling_; } | |
| 41 | |
| 42 bool is_solid_color() const { return is_solid_color_; } | |
| 43 SkColor solid_color() const { return solid_color_; } | |
| 44 | |
| 45 void SetPixelRecordDistanceForTesting(int d) { pixel_record_distance_ = d; } | |
|
danakj
2014/11/12 19:56:38
remove ForTesting in a test class
hendrikw
2014/11/12 20:25:42
Acknowledged.
| |
| 46 | |
| 47 typedef PicturePile::PictureInfo PictureInfo; | |
| 48 typedef PicturePile::PictureMapKey PictureMapKey; | |
| 49 typedef PicturePile::PictureMap PictureMap; | |
| 50 }; | |
| 51 } // namespace cc | |
| 52 | |
| 53 #endif // CC_TEST_PICTURE_PILE_H_ | |
| OLD | NEW |