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

Unified Diff: cc/resources/picture_pile_impl.cc

Issue 236633008: Switching Chromium to use new Skia SkPictureRecorder API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address code review issue 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
Index: cc/resources/picture_pile_impl.cc
diff --git a/cc/resources/picture_pile_impl.cc b/cc/resources/picture_pile_impl.cc
index 3f8e167b3c5d067e2531401ba21da2698691604c..0ecdba1c6b9fbb562b4a3b5a11c125b9628698c8 100644
--- a/cc/resources/picture_pile_impl.cc
+++ b/cc/resources/picture_pile_impl.cc
@@ -333,18 +333,14 @@ skia::RefPtr<SkPicture> PicturePileImpl::GetFlattenedPicture() {
TRACE_EVENT0("cc", "PicturePileImpl::GetFlattenedPicture");
gfx::Rect layer_rect(tiling_.total_size());
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(new SkPicture);
- if (layer_rect.IsEmpty())
- return picture;
-
- SkCanvas* canvas = picture->beginRecording(
- layer_rect.width(),
- layer_rect.height(),
- SkPicture::kUsePathBoundsForClip_RecordingFlag);
-
- RasterToBitmap(canvas, layer_rect, 1.0, NULL);
- picture->endRecording();
-
+ SkPictureRecorder recorder;
+ SkCanvas* canvas =
+ recorder.beginRecording(layer_rect.width(),
+ layer_rect.height(),
+ SkPicture::kUsePathBoundsForClip_RecordingFlag);
+ if (!layer_rect.IsEmpty())
+ RasterToBitmap(canvas, layer_rect, 1.0, NULL);
+ skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
return picture;
}

Powered by Google App Engine
This is Rietveld 408576698