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 { | |
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(); |
28 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 !
| |
29 | |
30 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
| |
21 | 31 |
22 private: | 32 private: |
23 PictureRecorder(const FloatSize& size); | 33 » PictureRecorder(); |
34 | |
35 » OwnPtr<SkPictureRecorder> m_pictureRecorder; | |
36 » RefPtr<Canvas> m_canvas; | |
24 }; | 37 }; |
25 | 38 |
26 } // namespace blink | 39 } // namespace blink |
27 | 40 |
28 #endif // SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_ | 41 #endif // SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_ |
OLD | NEW |