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

Unified Diff: cc/test/fake_display_list_recording_source.h

Issue 1673193002: HBitmap can't be immutable Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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_display_list_recording_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_display_list_recording_source.h
diff --git a/cc/test/fake_display_list_recording_source.h b/cc/test/fake_display_list_recording_source.h
index 158c053771cbf87bce07893bf73b58142fa9d90c..df4f115d1098e26aa47afa375cce3e25e92d7472 100644
--- a/cc/test/fake_display_list_recording_source.h
+++ b/cc/test/fake_display_list_recording_source.h
@@ -51,7 +51,7 @@ class FakeDisplayListRecordingSource : public DisplayListRecordingSource {
bool IsSuitableForGpuRasterization() const override;
void SetDisplayListUsesCachedPicture(bool use_cached_picture) {
- client_.set_display_list_use_cached_picture(use_cached_picture);
+ client_->set_display_list_use_cached_picture(use_cached_picture);
}
void SetRecordedViewport(const gfx::Rect& recorded_viewport) {
@@ -60,7 +60,7 @@ class FakeDisplayListRecordingSource : public DisplayListRecordingSource {
void SetLayerBounds(const gfx::Size& layer_bounds) {
size_ = layer_bounds;
- client_.set_bounds(layer_bounds);
+ client_->set_bounds(layer_bounds);
}
void SetClearCanvasWithDebugColor(bool clear) {
@@ -69,50 +69,54 @@ class FakeDisplayListRecordingSource : public DisplayListRecordingSource {
void Rerecord() {
Region invalidation = recorded_viewport_;
- UpdateAndExpandInvalidation(&client_, &invalidation, size_,
+ UpdateAndExpandInvalidation(client_.get(), &invalidation, size_,
recorded_viewport_, 0, RECORD_NORMALLY);
}
void add_draw_rect(const gfx::Rect& rect) {
- client_.add_draw_rect(rect, default_paint_);
+ client_->add_draw_rect(rect, default_paint_);
}
void add_draw_rect_with_paint(const gfx::Rect& rect, const SkPaint& paint) {
- client_.add_draw_rect(rect, paint);
+ client_->add_draw_rect(rect, paint);
}
void add_draw_rectf(const gfx::RectF& rect) {
- client_.add_draw_rectf(rect, default_paint_);
+ client_->add_draw_rectf(rect, default_paint_);
}
void add_draw_rectf_with_paint(const gfx::RectF& rect, const SkPaint& paint) {
- client_.add_draw_rectf(rect, paint);
+ client_->add_draw_rectf(rect, paint);
}
void add_draw_image(const SkImage* image, const gfx::Point& point) {
- client_.add_draw_image(image, point, default_paint_);
+ client_->add_draw_image(image, point, default_paint_);
}
void add_draw_image_with_transform(const SkImage* image,
const gfx::Transform& transform) {
- client_.add_draw_image_with_transform(image, transform, default_paint_);
+ client_->add_draw_image_with_transform(image, transform, default_paint_);
}
void add_draw_image_with_paint(const SkImage* image,
const gfx::Point& point,
const SkPaint& paint) {
- client_.add_draw_image(image, point, paint);
+ client_->add_draw_image(image, point, paint);
}
void set_default_paint(const SkPaint& paint) { default_paint_ = paint; }
+ void set_on_paint_delegate(scoped_ptr<FakeOnPaintDelegate> delegate) {
+ client_->set_on_paint_delegate(std::move(delegate));
+ }
+
void set_reported_memory_usage(size_t reported_memory_usage) {
- client_.set_reported_memory_usage(reported_memory_usage);
+ client_->set_reported_memory_usage(reported_memory_usage);
}
void reset_draws() {
- client_ = FakeContentLayerClient();
- client_.set_bounds(size_);
+ client_.reset(new FakeContentLayerClient);
+ client_->set_bounds(size_);
}
void SetUnsuitableForGpuRasterization() {
@@ -131,7 +135,7 @@ class FakeDisplayListRecordingSource : public DisplayListRecordingSource {
bool EqualsTo(const FakeDisplayListRecordingSource& other);
private:
- FakeContentLayerClient client_;
+ scoped_ptr<FakeContentLayerClient> client_;
SkPaint default_paint_;
bool force_unsuitable_for_gpu_rasterization_;
base::WaitableEvent* playback_allowed_event_;
« no previous file with comments | « cc/test/fake_content_layer_client.cc ('k') | cc/test/fake_display_list_recording_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698