| 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/Rect.h" |
| 8 #include "sky/engine/tonic/dart_wrappable.h" | 9 #include "sky/engine/tonic/dart_wrappable.h" |
| 9 #include "sky/engine/wtf/PassRefPtr.h" | 10 #include "sky/engine/wtf/PassRefPtr.h" |
| 10 #include "sky/engine/wtf/RefCounted.h" | 11 #include "sky/engine/wtf/RefCounted.h" |
| 11 #include "third_party/skia/include/core/SkPictureRecorder.h" | 12 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 | 15 |
| 15 class Canvas; | 16 class Canvas; |
| 16 class Drawable; | 17 class Drawable; |
| 17 class Picture; | 18 class Picture; |
| 18 | 19 |
| 19 class PictureRecorder : public RefCounted<PictureRecorder>, | 20 class PictureRecorder : public RefCounted<PictureRecorder>, |
| 20 public DartWrappable { | 21 public DartWrappable { |
| 21 DEFINE_WRAPPERTYPEINFO(); | 22 DEFINE_WRAPPERTYPEINFO(); |
| 22 public: | 23 public: |
| 23 static PassRefPtr<PictureRecorder> create() | 24 static PassRefPtr<PictureRecorder> create() |
| 24 { | 25 { |
| 25 return adoptRef(new PictureRecorder()); | 26 return adoptRef(new PictureRecorder()); |
| 26 } | 27 } |
| 27 | 28 |
| 28 ~PictureRecorder(); | 29 ~PictureRecorder(); |
| 29 | 30 |
| 30 // PassRefPtr<Canvas> beginRecording(double width, double height); | 31 // PassRefPtr<Canvas> beginRecording(double width, double height); |
| 31 SkCanvas* beginRecording(double width, double height); | 32 SkCanvas* beginRecording(Rect bounds); |
| 32 PassRefPtr<Picture> endRecording(); | 33 PassRefPtr<Picture> endRecording(); |
| 33 PassRefPtr<Drawable> endRecordingAsDrawable(); | 34 PassRefPtr<Drawable> endRecordingAsDrawable(); |
| 34 bool isRecording(); | 35 bool isRecording(); |
| 35 | 36 |
| 36 void set_canvas(PassRefPtr<Canvas> canvas); | 37 void set_canvas(PassRefPtr<Canvas> canvas); |
| 37 | 38 |
| 38 private: | 39 private: |
| 39 PictureRecorder(); | 40 PictureRecorder(); |
| 40 | 41 |
| 41 OwnPtr<SkPictureRecorder> m_pictureRecorder; | 42 OwnPtr<SkPictureRecorder> m_pictureRecorder; |
| 42 RefPtr<Canvas> m_canvas; | 43 RefPtr<Canvas> m_canvas; |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 } // namespace blink | 46 } // namespace blink |
| 46 | 47 |
| 47 #endif // SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_ | 48 #endif // SKY_ENGINE_CORE_PAINTING_PICTURERECORDER_H_ |
| OLD | NEW |