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

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

Issue 1190123003: Decouple Canvas from DisplayList and map Picture and PictureRecorder more directly to their Skia co… (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rework the API a bit 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
Index: sky/engine/core/painting/PictureRecorder.h
diff --git a/sky/engine/core/painting/PictureRecorder.h b/sky/engine/core/painting/PictureRecorder.h
index 485edd50499bb006a22784d5d68a202816dbd5b6..bded2758bc3ba5316da67667cef434b6d8fed23b 100644
--- a/sky/engine/core/painting/PictureRecorder.h
+++ b/sky/engine/core/painting/PictureRecorder.h
@@ -6,21 +6,34 @@
#define SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_
#include "sky/engine/core/painting/Canvas.h"
+#include "third_party/skia/include/core/SkPictureRecorder.h"
namespace blink {
class Picture;
-class PictureRecorder : public Canvas {
+class PictureRecorder : public RefCounted<PictureRecorder>,
+ public DartWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
- ~PictureRecorder() override;
- static PassRefPtr<PictureRecorder> create(double width, double height);
+ static PassRefPtr<PictureRecorder> create()
+ {
+ return adoptRef(new PictureRecorder());
+ }
+ ~PictureRecorder();
+
+ PassRefPtr<Canvas> beginRecording(double width, double height);
PassRefPtr<Picture> endRecording();
+ bool isRecording() { return m_canvas != nullptr && m_canvas->isRecording(); }
abarth-chromium 2015/06/20 00:50:29 It is every possible for m_canvas != nullptr and !
+
+ void setCanvas(PassRefPtr<Canvas> canvas) { m_canvas = canvas; }
abarth-chromium 2015/06/20 00:50:29 This function doesn't make much sense. What does
private:
- PictureRecorder(const FloatSize& size);
+ PictureRecorder();
+
+ OwnPtr<SkPictureRecorder> m_pictureRecorder;
+ RefPtr<Canvas> m_canvas;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698