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

Unified Diff: cc/test/fake_picture_pile_impl.h

Issue 14205005: cc: Only consider layer clipped content rect for analysis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: linker fixes on windows Created 7 years, 8 months 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/test/fake_content_layer_client.cc ('k') | cc/test/fake_picture_pile_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_picture_pile_impl.h
diff --git a/cc/test/fake_picture_pile_impl.h b/cc/test/fake_picture_pile_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..f3bde7bcc4d649120d1e86ff87f47ff3bc509b8d
--- /dev/null
+++ b/cc/test/fake_picture_pile_impl.h
@@ -0,0 +1,52 @@
+// Copyright 2013 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_IMPL_H_
+#define CC_TEST_FAKE_PICTURE_PILE_IMPL_H_
+
+#include "base/memory/ref_counted.h"
+#include "cc/resources/picture_pile_impl.h"
+#include "cc/test/fake_content_layer_client.h"
+
+namespace cc {
+
+class FakePicturePileImpl : public PicturePileImpl {
+ public:
+ static scoped_refptr<FakePicturePileImpl> CreateFilledPile(
+ gfx::Size tile_size,
+ gfx::Size layer_bounds);
+
+ static scoped_refptr<FakePicturePileImpl> CreateEmptyPile(
+ gfx::Size tile_size,
+ gfx::Size layer_bounds);
+
+ TilingData& tiling() { return tiling_; }
+
+ void AddRecordingAt(int x, int y);
+
+ void RemoveRecordingAt(int x, int y);
+
+ void add_draw_rect(const gfx::Rect& rect) {
+ client_.add_draw_rect(rect, default_paint_);
+ }
+
+ void add_draw_rect_with_paint(gfx::Rect rect, const SkPaint& paint) {
+ client_.add_draw_rect(rect, paint);
+ }
+
+ void set_default_paint(const SkPaint& paint) {
+ default_paint_ = paint;
+ }
+
+ protected:
+ FakePicturePileImpl();
+ virtual ~FakePicturePileImpl();
+
+ FakeContentLayerClient client_;
+ SkPaint default_paint_;
+};
+
+} // namespace cc
+
+#endif // CC_TEST_FAKE_PICTURE_PILE_IMPL_H_
« no previous file with comments | « cc/test/fake_content_layer_client.cc ('k') | cc/test/fake_picture_pile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698