Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(790)

Side by Side Diff: sky/engine/core/painting/Canvas.h

Issue 1155193004: Canvas.concat takes a 16-element Float32List instead of an array. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: more fixes Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/bindings/scripts/dart_types.py ('k') | sky/engine/core/painting/Canvas.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/Rect.h" 11 #include "sky/engine/core/painting/Rect.h"
12 #include "sky/engine/platform/graphics/DisplayList.h" 12 #include "sky/engine/platform/graphics/DisplayList.h"
13 #include "sky/engine/tonic/dart_wrappable.h" 13 #include "sky/engine/tonic/dart_wrappable.h"
14 #include "sky/engine/tonic/float32_list.h"
14 #include "sky/engine/wtf/PassRefPtr.h" 15 #include "sky/engine/wtf/PassRefPtr.h"
15 #include "sky/engine/wtf/RefCounted.h" 16 #include "sky/engine/wtf/RefCounted.h"
16 17
17 namespace blink { 18 namespace blink {
18 class Element; 19 class Element;
19 class CanvasImage; 20 class CanvasImage;
20 21
21 class Canvas : public RefCounted<Canvas>, public DartWrappable { 22 class Canvas : public RefCounted<Canvas>, public DartWrappable {
22 DEFINE_WRAPPERTYPEINFO(); 23 DEFINE_WRAPPERTYPEINFO();
23 public: 24 public:
24 Canvas(const FloatSize& size); 25 Canvas(const FloatSize& size);
25 ~Canvas() override; 26 ~Canvas() override;
26 27
27 // Width/Height define a culling rect which Skia may use for optimizing 28 // Width/Height define a culling rect which Skia may use for optimizing
28 // out draw calls issued outside the rect. 29 // out draw calls issued outside the rect.
29 float width() const { return m_size.width(); } 30 float width() const { return m_size.width(); }
30 float height() const { return m_size.height(); } 31 float height() const { return m_size.height(); }
31 32
32 void save(); 33 void save();
33 void saveLayer(const Rect& bounds, const Paint* paint); 34 void saveLayer(const Rect& bounds, const Paint* paint);
34 void restore(); 35 void restore();
35 36
36 void translate(float dx, float dy); 37 void translate(float dx, float dy);
37 void scale(float sx, float sy); 38 void scale(float sx, float sy);
38 void rotateDegrees(float degrees); 39 void rotateDegrees(float degrees);
39 void skew(float sx, float sy); 40 void skew(float sx, float sy);
40 void concat(const Vector<float>& matrix); 41 void concat(const Float32List& matrix4);
41 42
42 void clipRect(const Rect& rect); 43 void clipRect(const Rect& rect);
43 44
44 void drawPicture(Picture* picture); 45 void drawPicture(Picture* picture);
45 void drawPaint(const Paint* paint); 46 void drawPaint(const Paint* paint);
46 void drawRect(const Rect& rect, const Paint* paint); 47 void drawRect(const Rect& rect, const Paint* paint);
47 void drawOval(const Rect& rect, const Paint* paint); 48 void drawOval(const Rect& rect, const Paint* paint);
48 void drawCircle(float x, float y, float radius, const Paint* paint); 49 void drawCircle(float x, float y, float radius, const Paint* paint);
49 void drawPath(const CanvasPath* path, const Paint* paint); 50 void drawPath(const CanvasPath* path, const Paint* paint);
50 void drawImage(const CanvasImage* image, 51 void drawImage(const CanvasImage* image,
(...skipping 10 matching lines...) Expand all
61 62
62 private: 63 private:
63 FloatSize m_size; 64 FloatSize m_size;
64 RefPtr<DisplayList> m_displayList; 65 RefPtr<DisplayList> m_displayList;
65 SkCanvas* m_canvas; 66 SkCanvas* m_canvas;
66 }; 67 };
67 68
68 } // namespace blink 69 } // namespace blink
69 70
70 #endif // SKY_ENGINE_CORE_PAINTING_CANVAS_H_ 71 #endif // SKY_ENGINE_CORE_PAINTING_CANVAS_H_
OLDNEW
« no previous file with comments | « sky/engine/bindings/scripts/dart_types.py ('k') | sky/engine/core/painting/Canvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698