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_CANVAS_H_ | 5 #ifndef SKY_ENGINE_CORE_PAINTING_CANVAS_H_ |
6 #define SKY_ENGINE_CORE_PAINTING_CANVAS_H_ | 6 #define SKY_ENGINE_CORE_PAINTING_CANVAS_H_ |
7 | 7 |
8 #include "sky/engine/core/painting/Paint.h" | 8 #include "sky/engine/core/painting/Paint.h" |
| 9 #include "sky/engine/core/painting/Picture.h" |
9 #include "sky/engine/platform/graphics/DisplayList.h" | 10 #include "sky/engine/platform/graphics/DisplayList.h" |
10 #include "sky/engine/tonic/dart_wrappable.h" | 11 #include "sky/engine/tonic/dart_wrappable.h" |
11 #include "sky/engine/wtf/PassRefPtr.h" | 12 #include "sky/engine/wtf/PassRefPtr.h" |
12 #include "sky/engine/wtf/RefCounted.h" | 13 #include "sky/engine/wtf/RefCounted.h" |
13 | 14 |
14 namespace blink { | 15 namespace blink { |
15 class Element; | 16 class Element; |
16 | 17 |
17 class Canvas : public RefCounted<Canvas>, public DartWrappable { | 18 class Canvas : public RefCounted<Canvas>, public DartWrappable { |
18 DEFINE_WRAPPERTYPEINFO(); | 19 DEFINE_WRAPPERTYPEINFO(); |
(...skipping 11 matching lines...) Expand all Loading... |
30 void restore(); | 31 void restore(); |
31 | 32 |
32 void translate(float dx, float dy); | 33 void translate(float dx, float dy); |
33 void scale(float sx, float sy); | 34 void scale(float sx, float sy); |
34 void rotateDegrees(float degrees); | 35 void rotateDegrees(float degrees); |
35 void skew(float sx, float sy); | 36 void skew(float sx, float sy); |
36 void concat(const Vector<float>& matrix); | 37 void concat(const Vector<float>& matrix); |
37 | 38 |
38 void clipRect(const Vector<float>& rect); | 39 void clipRect(const Vector<float>& rect); |
39 | 40 |
| 41 void drawPicture(Picture* picture); |
| 42 |
40 void drawPaint(Paint* paint); | 43 void drawPaint(Paint* paint); |
41 void drawRect(const Vector<float>& rect, const Paint* paint); | 44 void drawRect(const Vector<float>& rect, const Paint* paint); |
42 void drawOval(const Vector<float>& rect, const Paint* paint); | 45 void drawOval(const Vector<float>& rect, const Paint* paint); |
43 void drawCircle(float x, float y, float radius, Paint* paint); | 46 void drawCircle(float x, float y, float radius, Paint* paint); |
44 | 47 |
45 SkCanvas* skCanvas() { return m_canvas; } | 48 SkCanvas* skCanvas() { return m_canvas; } |
46 | 49 |
47 protected: | 50 protected: |
48 PassRefPtr<DisplayList> finishRecording(); | 51 PassRefPtr<DisplayList> finishRecording(); |
49 | 52 |
50 bool isRecording() const { return m_canvas; } | 53 bool isRecording() const { return m_canvas; } |
51 | 54 |
52 private: | 55 private: |
53 FloatSize m_size; | 56 FloatSize m_size; |
54 RefPtr<DisplayList> m_displayList; | 57 RefPtr<DisplayList> m_displayList; |
55 SkCanvas* m_canvas; | 58 SkCanvas* m_canvas; |
56 }; | 59 }; |
57 | 60 |
58 } // namespace blink | 61 } // namespace blink |
59 | 62 |
60 #endif // SKY_ENGINE_CORE_PAINTING_CANVAS_H_ | 63 #endif // SKY_ENGINE_CORE_PAINTING_CANVAS_H_ |
OLD | NEW |