OLD | NEW |
---|---|
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/core/painting/Canvas.h" |
9 #include "third_party/skia/include/core/SkPictureRecorder.h" | |
9 | 10 |
10 namespace blink { | 11 namespace blink { |
11 | 12 |
12 class Picture; | 13 class Picture; |
13 | 14 |
14 class PictureRecorder : public Canvas { | 15 class PictureRecorder : public RefCounted<PictureRecorder>, |
16 » » » » » » 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.
| |
15 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
16 public: | 18 public: |
17 ~PictureRecorder() override; | 19 static PassRefPtr<PictureRecorder> create() |
18 static PassRefPtr<PictureRecorder> create(double width, double height); | 20 { |
21 return adoptRef(new PictureRecorder()); | |
22 } | |
19 | 23 |
24 ~PictureRecorder(); | |
25 | |
26 PassRefPtr<Canvas> beginRecording(double width, double height); | |
20 PassRefPtr<Picture> endRecording(); | 27 PassRefPtr<Picture> endRecording(); |
21 | 28 |
29 bool isRecording() { return m_canvas != nullptr; } | |
30 | |
22 private: | 31 private: |
23 PictureRecorder(const FloatSize& size); | 32 » PictureRecorder(); |
33 | |
34 » OwnPtr<SkPictureRecorder> m_pictureRecorder; | |
35 » RefPtr<Canvas> m_canvas; | |
24 }; | 36 }; |
25 | 37 |
26 } // namespace blink | 38 } // namespace blink |
27 | 39 |
28 #endif // SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_ | 40 #endif // SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_ |
OLD | NEW |