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

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: Rebased version of previous patch 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..503c05e5d9ec75d07b51b05a60bb9761223e6a85 100644
--- a/sky/engine/core/painting/PictureRecorder.h
+++ b/sky/engine/core/painting/PictureRecorder.h
@@ -5,22 +5,39 @@
#ifndef SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_
#define SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_
-#include "sky/engine/core/painting/Canvas.h"
+#include "sky/engine/tonic/dart_wrappable.h"
+#include "sky/engine/wtf/PassRefPtr.h"
+#include "sky/engine/wtf/RefCounted.h"
+#include "third_party/skia/include/core/SkPictureRecorder.h"
namespace blink {
class Picture;
+class Canvas;
-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);
abarth-chromium 2015/06/24 01:29:34 Please remove commented out code.
+ SkCanvas* beginRecording(double width, double height);
PassRefPtr<Picture> endRecording();
+ bool isRecording();
+
+ void set_canvas(PassRefPtr<Canvas> canvas);
private:
- PictureRecorder(const FloatSize& size);
+ PictureRecorder();
+
+ OwnPtr<SkPictureRecorder> m_pictureRecorder;
+ RefPtr<Canvas> m_canvas;
abarth-chromium 2015/06/24 01:29:34 Please make the indent consistent in this file.
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698