| 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/CanvasPath.h" | 8 #include "sky/engine/core/painting/CanvasPath.h" |
| 9 #include "sky/engine/core/painting/Paint.h" | 9 #include "sky/engine/core/painting/Paint.h" |
| 10 #include "sky/engine/core/painting/Picture.h" | 10 #include "sky/engine/core/painting/Picture.h" |
| 11 #include "sky/engine/core/painting/RRect.h" |
| 11 #include "sky/engine/core/painting/Rect.h" | 12 #include "sky/engine/core/painting/Rect.h" |
| 12 #include "sky/engine/platform/graphics/DisplayList.h" | 13 #include "sky/engine/platform/graphics/DisplayList.h" |
| 13 #include "sky/engine/tonic/dart_wrappable.h" | 14 #include "sky/engine/tonic/dart_wrappable.h" |
| 14 #include "sky/engine/tonic/float32_list.h" | 15 #include "sky/engine/tonic/float32_list.h" |
| 15 #include "sky/engine/wtf/PassRefPtr.h" | 16 #include "sky/engine/wtf/PassRefPtr.h" |
| 16 #include "sky/engine/wtf/RefCounted.h" | 17 #include "sky/engine/wtf/RefCounted.h" |
| 17 | 18 |
| 18 namespace blink { | 19 namespace blink { |
| 19 class Element; | 20 class Element; |
| 20 class CanvasImage; | 21 class CanvasImage; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 void restore(); | 36 void restore(); |
| 36 | 37 |
| 37 void translate(float dx, float dy); | 38 void translate(float dx, float dy); |
| 38 void scale(float sx, float sy); | 39 void scale(float sx, float sy); |
| 39 void rotateDegrees(float degrees); | 40 void rotateDegrees(float degrees); |
| 40 void skew(float sx, float sy); | 41 void skew(float sx, float sy); |
| 41 void concat(const Float32List& matrix4); | 42 void concat(const Float32List& matrix4); |
| 42 | 43 |
| 43 void clipRect(const Rect& rect); | 44 void clipRect(const Rect& rect); |
| 44 | 45 |
| 46 void drawLine(float x0, float y0, float x1, float y1, const Paint* paint); |
| 45 void drawPicture(Picture* picture); | 47 void drawPicture(Picture* picture); |
| 46 void drawPaint(const Paint* paint); | 48 void drawPaint(const Paint* paint); |
| 47 void drawRect(const Rect& rect, const Paint* paint); | 49 void drawRect(const Rect& rect, const Paint* paint); |
| 50 void drawRRect(const RRect* rrect, const Paint* paint); |
| 48 void drawOval(const Rect& rect, const Paint* paint); | 51 void drawOval(const Rect& rect, const Paint* paint); |
| 49 void drawCircle(float x, float y, float radius, const Paint* paint); | 52 void drawCircle(float x, float y, float radius, const Paint* paint); |
| 50 void drawPath(const CanvasPath* path, const Paint* paint); | 53 void drawPath(const CanvasPath* path, const Paint* paint); |
| 51 void drawImage(const CanvasImage* image, | 54 void drawImage(const CanvasImage* image, |
| 52 float x, | 55 float x, |
| 53 float y, | 56 float y, |
| 54 const Paint* paint); | 57 const Paint* paint); |
| 55 | 58 |
| 56 SkCanvas* skCanvas() { return m_canvas; } | 59 SkCanvas* skCanvas() { return m_canvas; } |
| 57 | 60 |
| 58 protected: | 61 protected: |
| 59 PassRefPtr<DisplayList> finishRecording(); | 62 PassRefPtr<DisplayList> finishRecording(); |
| 60 | 63 |
| 61 bool isRecording() const { return m_canvas; } | 64 bool isRecording() const { return m_canvas; } |
| 62 | 65 |
| 63 private: | 66 private: |
| 64 FloatSize m_size; | 67 FloatSize m_size; |
| 65 RefPtr<DisplayList> m_displayList; | 68 RefPtr<DisplayList> m_displayList; |
| 66 SkCanvas* m_canvas; | 69 SkCanvas* m_canvas; |
| 67 }; | 70 }; |
| 68 | 71 |
| 69 } // namespace blink | 72 } // namespace blink |
| 70 | 73 |
| 71 #endif // SKY_ENGINE_CORE_PAINTING_CANVAS_H_ | 74 #endif // SKY_ENGINE_CORE_PAINTING_CANVAS_H_ |
| OLD | NEW |