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

Unified Diff: sky/engine/core/painting/PictureRecorder.cpp

Issue 1221583003: Add APIs for dynamic display lists, using SkDrawable and SkPictureRecorder::endRecordingAsDrawable. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 | « sky/engine/core/painting/PictureRecorder.h ('k') | sky/engine/core/painting/PictureRecorder.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/painting/PictureRecorder.cpp
diff --git a/sky/engine/core/painting/PictureRecorder.cpp b/sky/engine/core/painting/PictureRecorder.cpp
index ee6265a253ce4848a21f9b1c80f26f2a99249a0e..08cb42317ccb0330e9165eb29220b2712856e8ea 100644
--- a/sky/engine/core/painting/PictureRecorder.cpp
+++ b/sky/engine/core/painting/PictureRecorder.cpp
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "sky/engine/core/painting/Canvas.h"
+#include "sky/engine/core/painting/Drawable.h"
#include "sky/engine/core/painting/Picture.h"
#include "sky/engine/core/painting/PictureRecorder.h"
@@ -37,6 +38,17 @@ PassRefPtr<Picture> PictureRecorder::endRecording()
return picture.release();
}
+PassRefPtr<Drawable> PictureRecorder::endRecordingAsDrawable()
+{
+ if (!isRecording())
+ return nullptr;
+ RefPtr<Drawable> drawable = Drawable::create(
+ adoptRef(m_pictureRecorder->endRecordingAsDrawable()));
+ m_canvas->clearSkCanvas();
+ m_canvas = nullptr;
+ return drawable.release();
+}
+
void PictureRecorder::set_canvas(PassRefPtr<Canvas> canvas) { m_canvas = canvas; }
} // namespace blink
« no previous file with comments | « sky/engine/core/painting/PictureRecorder.h ('k') | sky/engine/core/painting/PictureRecorder.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698