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

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: 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..5521d458bba6846477c79f3670b80cb098d87e21 100644
--- a/sky/engine/core/painting/PictureRecorder.h
+++ b/sky/engine/core/painting/PictureRecorder.h
@@ -6,21 +6,33 @@
#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 {
abarth-chromium 2015/06/18 00:03:52 This should be indented so that the |public| lines
iansf 2015/06/20 00:02:38 Done.
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; }
+
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