Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3317)

Unified Diff: cc/test/fake_picture_pile.h

Issue 714203006: cc: Remove PicturePileBase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missed comma Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/recording_source.h ('k') | cc/test/fake_picture_pile_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e486e3b4cd37c63fb53bc38c13f6c9ababb83622
--- /dev/null
+++ b/cc/test/fake_picture_pile.h
@@ -0,0 +1,53 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_TEST_FAKE_PICTURE_PILE_H_
+#define CC_TEST_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_; }
tfarina 2014/11/13 15:33:42 bool has_any_recordings() const { .. } + void set_
danakj 2014/11/13 16:59:13 Meh... they could be formatted that way, but a) th
+
+ void SetRecordedViewport(const gfx::Rect& viewport) {
tfarina 2014/11/13 15:33:42 set_recorded_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_; }
tfarina 2014/11/13 15:33:42 in c++11 you don't need to initialize this member
danakj 2014/11/13 16:59:13 You do need to initialize, looks like that is miss
+ SkColor solid_color() const { return solid_color_; }
+
+ void SetPixelRecordDistance(int d) { pixel_record_distance_ = d; }
tfarina 2014/11/13 15:33:42 set_ ....?
+
+ typedef PicturePile::PictureInfo PictureInfo;
tfarina 2014/11/13 15:33:42 these typedefs should be before the constructor, a
+ typedef PicturePile::PictureMapKey PictureMapKey;
+ typedef PicturePile::PictureMap PictureMap;
+};
tfarina 2014/11/13 15:33:42 DISALLOW_COPY_AND_ASSIGN?
+} // namespace cc
tfarina 2014/11/13 15:33:42 add empty line above?
+
+#endif // CC_TEST_FAKE_PICTURE_PILE_H_
« no previous file with comments | « cc/resources/recording_source.h ('k') | cc/test/fake_picture_pile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698