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

Unified Diff: cc/resources/skpicture_content_layer_updater.cc

Issue 236633008: Switching Chromium to use new Skia SkPictureRecorder API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/skpicture_content_layer_updater.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/skpicture_content_layer_updater.cc
diff --git a/cc/resources/skpicture_content_layer_updater.cc b/cc/resources/skpicture_content_layer_updater.cc
index b100778275593eae6625d8f20599cb47396ea016..4afeb5a4f4340621fe21013cf6c3dadb13402de7 100644
--- a/cc/resources/skpicture_content_layer_updater.cc
+++ b/cc/resources/skpicture_content_layer_updater.cc
@@ -27,8 +27,8 @@ void SkPictureContentLayerUpdater::PrepareToUpdate(
float contents_width_scale,
float contents_height_scale,
gfx::Rect* resulting_opaque_rect) {
- SkCanvas* canvas =
- picture_.beginRecording(content_rect.width(), content_rect.height());
+ SkCanvas* canvas = picture_recorder_.beginRecording(content_rect.width(),
reed1 2014/04/14 15:19:02 Why does picture_recorder_ have to be a persistent
robertphillips 2014/04/14 15:36:28 Done.
+ content_rect.height());
DCHECK_EQ(content_rect.width(), canvas->getBaseLayerSize().width());
DCHECK_EQ(content_rect.height(), canvas->getBaseLayerSize().height());
base::TimeTicks start_time =
@@ -42,12 +42,13 @@ void SkPictureContentLayerUpdater::PrepareToUpdate(
rendering_stats_instrumentation_->EndRecording(start_time);
rendering_stats_instrumentation_->AddRecord(
duration, content_rect.width() * content_rect.height());
- picture_.endRecording();
+ picture_ = skia::AdoptRef(picture_recorder_.endRecording());
}
void SkPictureContentLayerUpdater::DrawPicture(SkCanvas* canvas) {
TRACE_EVENT0("cc", "SkPictureContentLayerUpdater::DrawPicture");
- canvas->drawPicture(picture_);
+ if (picture_)
+ canvas->drawPicture(*picture_);
}
} // namespace cc
« no previous file with comments | « cc/resources/skpicture_content_layer_updater.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698