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

Unified Diff: cc/resources/display_list_recording_source.cc

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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/resources/display_list_recording_source.h ('k') | cc/resources/gpu_rasterizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/display_list_recording_source.cc
diff --git a/cc/resources/display_list_recording_source.cc b/cc/resources/display_list_recording_source.cc
index 7b98e50ddf0a3cba056a8fc89bade7439999868b..e60e4c16d2949054c7f70e8a1e3c8e3d98403381 100644
--- a/cc/resources/display_list_recording_source.cc
+++ b/cc/resources/display_list_recording_source.cc
@@ -45,7 +45,7 @@ bool DisplayListRecordingSource::UpdateAndExpandInvalidation(
const gfx::Size& layer_size,
const gfx::Rect& visible_layer_rect,
int frame_number,
- Picture::RecordingMode recording_mode) {
+ RecordingMode recording_mode) {
bool updated = false;
if (size_ != layer_size) {
@@ -81,12 +81,37 @@ bool DisplayListRecordingSource::UpdateAndExpandInvalidation(
if (!updated && !invalidation->Intersects(recorded_viewport_))
return false;
- // TODO(ajuma): Does repeating this way really makes sense with display lists?
- // With Blink caching recordings, repeated calls will not cause re-recording.
- int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_);
+ ContentLayerClient::PaintingControlSetting painting_control =
+ ContentLayerClient::PAINTING_BEHAVIOR_NORMAL;
+
+ switch (recording_mode) {
+ case RECORD_NORMALLY:
+ // Already setup for normal recording.
+ break;
+ case RECORD_WITH_SK_NULL_CANVAS:
+ // TODO(schenney): Remove this when DisplayList recording is the only
+ // option. For now, fall through and disable construction.
+ case RECORD_WITH_PAINTING_DISABLED:
+ painting_control = ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED;
+ break;
+ case RECORD_WITH_CACHING_DISABLED:
+ painting_control = ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED;
+ break;
+ default:
+ NOTREACHED();
+ }
+
+ int repeat_count = 1;
+ if (slow_down_raster_scale_factor_for_debug_ > 1) {
+ repeat_count = slow_down_raster_scale_factor_for_debug_;
+ if (painting_control !=
+ ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED) {
+ painting_control = ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED;
+ }
+ }
for (int i = 0; i < repeat_count; ++i) {
- display_list_ = painter->PaintContentsToDisplayList(
- recorded_viewport_, ContentLayerClient::GRAPHICS_CONTEXT_ENABLED);
+ display_list_ = painter->PaintContentsToDisplayList(recorded_viewport_,
+ painting_control);
}
display_list_->set_layer_rect(recorded_viewport_);
is_suitable_for_gpu_rasterization_ =
« no previous file with comments | « cc/resources/display_list_recording_source.h ('k') | cc/resources/gpu_rasterizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698