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

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

Issue 1174203002: Clip inkwell splash around the floating action button (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase and apply code review feedback 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 | « no previous file | 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"
(...skipping 14 matching lines...) Expand all
25 public: 25 public:
26 Canvas(const FloatSize& size); 26 Canvas(const FloatSize& size);
27 ~Canvas() override; 27 ~Canvas() override;
28 28
29 // Width/Height define a culling rect which Skia may use for optimizing 29 // Width/Height define a culling rect which Skia may use for optimizing
30 // out draw calls issued outside the rect. 30 // out draw calls issued outside the rect.
31 float width() const { return m_size.width(); } 31 float width() const { return m_size.width(); }
32 float height() const { return m_size.height(); } 32 float height() const { return m_size.height(); }
33 33
34 void save(); 34 void save();
35 void saveLayer(const Rect& bounds, const Paint* paint); 35 void saveLayer(const Rect& bounds, const Paint* paint = nullptr);
36 void restore(); 36 void restore();
37 37
38 void translate(float dx, float dy); 38 void translate(float dx, float dy);
39 void scale(float sx, float sy); 39 void scale(float sx, float sy);
40 void rotate(float radians); 40 void rotate(float radians);
41 void skew(float sx, float sy); 41 void skew(float sx, float sy);
42 void concat(const Float32List& matrix4); 42 void concat(const Float32List& matrix4);
43 43
44 void clipRect(const Rect& rect); 44 void clipRect(const Rect& rect);
45 void clipRRect(const RRect* rrect);
46 void clipPath(const CanvasPath* path);
45 47
46 void drawLine(float x0, float y0, float x1, float y1, const Paint* paint); 48 void drawLine(float x0, float y0, float x1, float y1, const Paint* paint);
47 void drawPicture(Picture* picture); 49 void drawPicture(Picture* picture);
48 void drawPaint(const Paint* paint); 50 void drawPaint(const Paint* paint);
49 void drawRect(const Rect& rect, const Paint* paint); 51 void drawRect(const Rect& rect, const Paint* paint);
50 void drawRRect(const RRect* rrect, const Paint* paint); 52 void drawRRect(const RRect* rrect, const Paint* paint);
51 void drawOval(const Rect& rect, const Paint* paint); 53 void drawOval(const Rect& rect, const Paint* paint);
52 void drawCircle(float x, float y, float radius, const Paint* paint); 54 void drawCircle(float x, float y, float radius, const Paint* paint);
53 void drawPath(const CanvasPath* path, const Paint* paint); 55 void drawPath(const CanvasPath* path, const Paint* paint);
54 void drawImage(const CanvasImage* image, 56 void drawImage(const CanvasImage* image,
(...skipping 10 matching lines...) Expand all
65 67
66 private: 68 private:
67 FloatSize m_size; 69 FloatSize m_size;
68 RefPtr<DisplayList> m_displayList; 70 RefPtr<DisplayList> m_displayList;
69 SkCanvas* m_canvas; 71 SkCanvas* m_canvas;
70 }; 72 };
71 73
72 } // namespace blink 74 } // namespace blink
73 75
74 #endif // SKY_ENGINE_CORE_PAINTING_CANVAS_H_ 76 #endif // SKY_ENGINE_CORE_PAINTING_CANVAS_H_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/painting/Canvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698