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

Unified Diff: cc/playback/display_list_recording_source.cc

Issue 1361663003: Revert of Cache gpu suitability in DisplayItemList, remove SetUnsuitable...ForTesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/playback/display_list_recording_source.h ('k') | cc/playback/picture_pile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/playback/display_list_recording_source.cc
diff --git a/cc/playback/display_list_recording_source.cc b/cc/playback/display_list_recording_source.cc
index b7bdd788adfa9f39aeef360b39005394a7d44d7a..1ed5a1ff9adb1b2cc75f1ef0b09ecd2111f9a995 100644
--- a/cc/playback/display_list_recording_source.cc
+++ b/cc/playback/display_list_recording_source.cc
@@ -52,7 +52,8 @@
background_color_(SK_ColorTRANSPARENT),
pixel_record_distance_(kPixelDistanceToRecord),
grid_cell_size_(grid_cell_size),
- painter_reported_memory_usage_(0) {}
+ painter_reported_memory_usage_(0),
+ is_suitable_for_gpu_rasterization_(true) {}
DisplayListRecordingSource::~DisplayListRecordingSource() {
}
@@ -182,6 +183,8 @@
painter->PaintContentsToDisplayList(recorded_viewport_, painting_control);
painter_reported_memory_usage_ = painter->GetApproximateUnsharedMemoryUsage();
+ is_suitable_for_gpu_rasterization_ =
+ display_list_->IsSuitableForGpuRasterization();
DetermineIfSolidColor();
display_list_->EmitTraceSnapshot();
if (gather_images_)
@@ -216,11 +219,12 @@
requires_clear_ = requires_clear;
}
+void DisplayListRecordingSource::SetUnsuitableForGpuRasterizationForTesting() {
+ is_suitable_for_gpu_rasterization_ = false;
+}
+
bool DisplayListRecordingSource::IsSuitableForGpuRasterization() const {
- // The display list needs to be created (see: UpdateAndExpandInvalidation)
- // before checking for suitability.
- DCHECK(display_list_);
- return display_list_->IsSuitableForGpuRasterization();
+ return is_suitable_for_gpu_rasterization_;
}
scoped_refptr<RasterSource> DisplayListRecordingSource::CreateRasterSource(
@@ -231,7 +235,7 @@
}
void DisplayListRecordingSource::DetermineIfSolidColor() {
- DCHECK(display_list_);
+ DCHECK(display_list_.get());
is_solid_color_ = false;
solid_color_ = SK_ColorTRANSPARENT;
@@ -246,7 +250,7 @@
void DisplayListRecordingSource::Clear() {
recorded_viewport_ = gfx::Rect();
- display_list_ = nullptr;
+ display_list_ = NULL;
painter_reported_memory_usage_ = 0;
is_solid_color_ = false;
}
« no previous file with comments | « cc/playback/display_list_recording_source.h ('k') | cc/playback/picture_pile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698