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

Unified Diff: cc/resources/picture.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/picture.h ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture.cc
diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc
index 003a8f17503bdf66924e60462044685bf8b81d75..6bbeeaaefb08f58c975426ea5365b3874787e9b9 100644
--- a/cc/resources/picture.cc
+++ b/cc/resources/picture.cc
@@ -53,11 +53,12 @@ bool DecodeBitmap(const void* buffer, size_t size, SkBitmap* bm) {
} // namespace
-scoped_refptr<Picture> Picture::Create(const gfx::Rect& layer_rect,
- ContentLayerClient* client,
- const gfx::Size& tile_grid_size,
- bool gather_pixel_refs,
- RecordingMode recording_mode) {
+scoped_refptr<Picture> Picture::Create(
+ const gfx::Rect& layer_rect,
+ ContentLayerClient* client,
+ const gfx::Size& tile_grid_size,
+ bool gather_pixel_refs,
+ RecordingSource::RecordingMode recording_mode) {
scoped_refptr<Picture> picture = make_scoped_refptr(new Picture(layer_rect));
picture->Record(client, tile_grid_size, recording_mode);
@@ -169,7 +170,7 @@ bool Picture::HasText() const {
void Picture::Record(ContentLayerClient* painter,
const gfx::Size& tile_grid_size,
- RecordingMode recording_mode) {
+ RecordingSource::RecordingMode recording_mode) {
TRACE_EVENT2("cc",
"Picture::Record",
"data",
@@ -189,23 +190,27 @@ void Picture::Record(ContentLayerClient* painter,
layer_rect_.width(), layer_rect_.height(), &factory,
SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag));
- ContentLayerClient::GraphicsContextStatus graphics_context_status =
- ContentLayerClient::GRAPHICS_CONTEXT_ENABLED;
+ ContentLayerClient::PaintingControlSetting painting_control =
+ ContentLayerClient::PAINTING_BEHAVIOR_NORMAL;
switch (recording_mode) {
- case RECORD_NORMALLY:
+ case RecordingSource::RECORD_NORMALLY:
// Already setup for normal recording.
break;
- case RECORD_WITH_SK_NULL_CANVAS:
+ case RecordingSource::RECORD_WITH_SK_NULL_CANVAS:
canvas = skia::AdoptRef(SkCreateNullCanvas());
break;
- case RECORD_WITH_PAINTING_DISABLED:
+ case RecordingSource::RECORD_WITH_PAINTING_DISABLED:
// We pass a disable flag through the paint calls when perfromance
// testing (the only time this case should ever arise) when we want to
// prevent the Blink GraphicsContext object from consuming any compute
// time.
canvas = skia::AdoptRef(SkCreateNullCanvas());
- graphics_context_status = ContentLayerClient::GRAPHICS_CONTEXT_DISABLED;
+ painting_control = ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED;
+ break;
+ case RecordingSource::RECORD_WITH_CACHING_DISABLED:
+ // This mode should give the same results as RECORD_NORMALLY.
+ painting_control = ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED;
break;
default:
NOTREACHED();
@@ -221,7 +226,7 @@ void Picture::Record(ContentLayerClient* painter,
layer_rect_.height());
canvas->clipRect(layer_skrect);
- painter->PaintContents(canvas.get(), layer_rect_, graphics_context_status);
+ painter->PaintContents(canvas.get(), layer_rect_, painting_control);
canvas->restore();
picture_ = skia::AdoptRef(recorder.endRecording());
« no previous file with comments | « cc/resources/picture.h ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698