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

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: Update to ToT 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/picture.cc ('k') | cc/resources/skpicture_content_layer_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile_impl.cc
diff --git a/cc/resources/picture_pile_impl.cc b/cc/resources/picture_pile_impl.cc
index e2d86743d53cbc1b98650be74924ccb2e9c47f6f..ec1624c63dff18be775a2461dda233656a3d1be2 100644
--- a/cc/resources/picture_pile_impl.cc
+++ b/cc/resources/picture_pile_impl.cc
@@ -330,17 +330,14 @@ skia::RefPtr<SkPicture> PicturePileImpl::GetFlattenedPicture() {
TRACE_EVENT0("cc", "PicturePileImpl::GetFlattenedPicture");
gfx::Rect tiling_rect(tiling_.tiling_rect());
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(new SkPicture);
- if (tiling_rect.IsEmpty())
- return picture;
-
+ SkPictureRecorder recorder;
SkCanvas* canvas =
- picture->beginRecording(tiling_rect.width(),
+ recorder.beginRecording(tiling_rect.width(),
tiling_rect.height(),
SkPicture::kUsePathBoundsForClip_RecordingFlag);
-
- RasterToBitmap(canvas, tiling_rect, 1.0, NULL);
- picture->endRecording();
+ if (!tiling_rect.IsEmpty())
+ RasterToBitmap(canvas, tiling_rect, 1.0, NULL);
+ skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
return picture;
}
« no previous file with comments | « cc/resources/picture.cc ('k') | cc/resources/skpicture_content_layer_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698