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

Unified Diff: cc/test/fake_recording_source.h

Issue 2141233002: cc: Clean up RecordingSource API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ContentLayerClient* painter from UpdateAndExpandInvalidation and sync to head Created 4 years, 4 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_picture_layer.cc ('k') | cc/test/fake_recording_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_recording_source.h
diff --git a/cc/test/fake_recording_source.h b/cc/test/fake_recording_source.h
index 159a3fb874317726e261cb95794454cb7babd0ce..83737373976f049d6d4aadf16e4a9cd7f715d474 100644
--- a/cc/test/fake_recording_source.h
+++ b/cc/test/fake_recording_source.h
@@ -50,7 +50,6 @@ class FakeRecordingSource : public RecordingSource {
// RecordingSource overrides.
scoped_refptr<RasterSource> CreateRasterSource(
bool can_use_lcd) const override;
- bool IsSuitableForGpuRasterization() const override;
void SetDisplayListUsesCachedPicture(bool use_cached_picture) {
client_.set_display_list_use_cached_picture(use_cached_picture);
@@ -72,8 +71,14 @@ class FakeRecordingSource : public RecordingSource {
void Rerecord() {
SetNeedsDisplayRect(recorded_viewport_);
Region invalidation;
- UpdateAndExpandInvalidation(&client_, &invalidation, size_, 0,
- RECORD_NORMALLY);
+ gfx::Rect new_recorded_viewport = client_.PaintableRegion();
+ scoped_refptr<DisplayItemList> display_list =
+ client_.PaintContentsToDisplayList(
+ ContentLayerClient::PAINTING_BEHAVIOR_NORMAL);
+ size_t painter_reported_memory_usage =
+ client_.GetApproximateUnsharedMemoryUsage();
+ UpdateAndExpandInvalidation(&invalidation, size_, new_recorded_viewport);
+ UpdateDisplayItemList(display_list, painter_reported_memory_usage);
}
void add_draw_rect(const gfx::Rect& rect) {
@@ -119,16 +124,10 @@ class FakeRecordingSource : public RecordingSource {
client_.set_bounds(size_);
}
- void SetForceUnsuitableForGpuRasterization(bool flag) {
- force_unsuitable_for_gpu_rasterization_ = flag;
- }
-
void SetPlaybackAllowedEvent(base::WaitableEvent* event) {
playback_allowed_event_ = event;
}
- DisplayItemList* display_list() const { return display_list_.get(); }
-
// Checks that the basic properties of the |other| match |this|. For the
// DisplayItemList, it checks that the painted result matches the painted
// result of |other|.
@@ -137,7 +136,6 @@ class FakeRecordingSource : public RecordingSource {
private:
FakeContentLayerClient client_;
SkPaint default_paint_;
- bool force_unsuitable_for_gpu_rasterization_;
base::WaitableEvent* playback_allowed_event_;
};
« no previous file with comments | « cc/test/fake_picture_layer.cc ('k') | cc/test/fake_recording_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698