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

Side by Side 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: j/k -- this one should actually be fully merged and testable 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_ 5 #ifndef SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_
6 #define SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_ 6 #define SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_
7 7
8 #include "sky/engine/core/painting/Canvas.h" 8 #include "sky/engine/tonic/dart_wrappable.h"
9 #include "sky/engine/wtf/PassRefPtr.h"
10 #include "sky/engine/wtf/RefCounted.h"
11 #include "third_party/skia/include/core/SkPictureRecorder.h"
9 12
10 namespace blink { 13 namespace blink {
11 14
12 class Picture; 15 class Picture;
16 class Canvas;
13 17
14 class PictureRecorder : public Canvas { 18 class PictureRecorder : public RefCounted<PictureRecorder>,
19 public DartWrappable {
15 DEFINE_WRAPPERTYPEINFO(); 20 DEFINE_WRAPPERTYPEINFO();
16 public: 21 public:
17 ~PictureRecorder() override; 22 static PassRefPtr<PictureRecorder> create()
18 static PassRefPtr<PictureRecorder> create(double width, double height); 23 {
24 return adoptRef(new PictureRecorder());
25 }
19 26
27 ~PictureRecorder();
28
29 // PassRefPtr<Canvas> beginRecording(double width, double height);
30 SkCanvas* beginRecording(double width, double height);
20 PassRefPtr<Picture> endRecording(); 31 PassRefPtr<Picture> endRecording();
32 bool isRecording();
33
34 void set_canvas(PassRefPtr<Canvas> canvas);
35
36 int foo = 0;
eseidel 2015/06/23 00:41:32 I suspect you don't want this?
iansf 2015/06/23 22:46:09 You may be right... ;-)
21 37
22 private: 38 private:
23 PictureRecorder(const FloatSize& size); 39 » PictureRecorder();
40
41 » OwnPtr<SkPictureRecorder> m_pictureRecorder;
42 » RefPtr<Canvas> m_canvas;
24 }; 43 };
25 44
26 } // namespace blink 45 } // namespace blink
27 46
28 #endif // SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_ 47 #endif // SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698