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

Unified Diff: cc/playback/display_list_recording_source.cc

Issue 1349913002: Cache gpu suitability in DisplayItemList, remove SetUnsuitable...ForTesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Needs more nullptr 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 1ed5a1ff9adb1b2cc75f1ef0b09ecd2111f9a995..c6870f729937fec3cb5ac6ebe93613c31c446ab9 100644
--- a/cc/playback/display_list_recording_source.cc
+++ b/cc/playback/display_list_recording_source.cc
@@ -52,8 +52,7 @@ DisplayListRecordingSource::DisplayListRecordingSource(
background_color_(SK_ColorTRANSPARENT),
pixel_record_distance_(kPixelDistanceToRecord),
grid_cell_size_(grid_cell_size),
- painter_reported_memory_usage_(0),
- is_suitable_for_gpu_rasterization_(true) {}
+ painter_reported_memory_usage_(0) {}
DisplayListRecordingSource::~DisplayListRecordingSource() {
}
@@ -183,8 +182,6 @@ bool DisplayListRecordingSource::UpdateAndExpandInvalidation(
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_)
@@ -219,12 +216,11 @@ void DisplayListRecordingSource::SetRequiresClear(bool requires_clear) {
requires_clear_ = requires_clear;
}
-void DisplayListRecordingSource::SetUnsuitableForGpuRasterizationForTesting() {
- is_suitable_for_gpu_rasterization_ = false;
-}
-
bool DisplayListRecordingSource::IsSuitableForGpuRasterization() const {
- return is_suitable_for_gpu_rasterization_;
+ // The display list needs to be created (see: UpdateAndExpandInvalidation)
+ // before checking for suitability.
+ DCHECK(display_list_.get());
danakj 2015/09/21 17:47:34 nit: no .get() is needed
pdr. 2015/09/21 18:13:41 Fixed, and updated where I copied this from so fut
+ return display_list_->IsSuitableForGpuRasterization();
}
scoped_refptr<RasterSource> DisplayListRecordingSource::CreateRasterSource(
« 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