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

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

Issue 1221583003: Add APIs for dynamic display lists, using SkDrawable and SkPictureRecorder::endRecordingAsDrawable. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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/core/core.gni ('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/bindings/exception_state.h" 8 #include "sky/engine/bindings/exception_state.h"
9 #include "sky/engine/core/painting/CanvasPath.h" 9 #include "sky/engine/core/painting/CanvasPath.h"
10 #include "sky/engine/core/painting/Drawable.h"
10 #include "sky/engine/core/painting/Offset.h" 11 #include "sky/engine/core/painting/Offset.h"
11 #include "sky/engine/core/painting/Paint.h" 12 #include "sky/engine/core/painting/Paint.h"
12 #include "sky/engine/core/painting/Picture.h" 13 #include "sky/engine/core/painting/Picture.h"
13 #include "sky/engine/core/painting/PictureRecorder.h" 14 #include "sky/engine/core/painting/PictureRecorder.h"
14 #include "sky/engine/core/painting/Point.h" 15 #include "sky/engine/core/painting/Point.h"
15 #include "sky/engine/core/painting/RRect.h" 16 #include "sky/engine/core/painting/RRect.h"
16 #include "sky/engine/core/painting/Rect.h" 17 #include "sky/engine/core/painting/Rect.h"
17 #include "sky/engine/core/painting/Size.h" 18 #include "sky/engine/core/painting/Size.h"
18 #include "sky/engine/platform/graphics/DisplayList.h" 19 #include "sky/engine/platform/graphics/DisplayList.h"
19 #include "sky/engine/tonic/dart_wrappable.h" 20 #include "sky/engine/tonic/dart_wrappable.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 void scale(float sx, float sy); 66 void scale(float sx, float sy);
66 void rotate(float radians); 67 void rotate(float radians);
67 void skew(float sx, float sy); 68 void skew(float sx, float sy);
68 void concat(const Float32List& matrix4); 69 void concat(const Float32List& matrix4);
69 70
70 void clipRect(const Rect& rect); 71 void clipRect(const Rect& rect);
71 void clipRRect(const RRect* rrect); 72 void clipRRect(const RRect* rrect);
72 void clipPath(const CanvasPath* path); 73 void clipPath(const CanvasPath* path);
73 74
74 void drawLine(const Point& p1, const Point& p2, const Paint* paint); 75 void drawLine(const Point& p1, const Point& p2, const Paint* paint);
75 void drawPicture(Picture* picture);
76 void drawPaint(const Paint* paint); 76 void drawPaint(const Paint* paint);
77 void drawRect(const Rect& rect, const Paint* paint); 77 void drawRect(const Rect& rect, const Paint* paint);
78 void drawRRect(const RRect* rrect, const Paint* paint); 78 void drawRRect(const RRect* rrect, const Paint* paint);
79 void drawOval(const Rect& rect, const Paint* paint); 79 void drawOval(const Rect& rect, const Paint* paint);
80 void drawCircle(const Point& c, float radius, const Paint* paint); 80 void drawCircle(const Point& c, float radius, const Paint* paint);
81 void drawPath(const CanvasPath* path, const Paint* paint); 81 void drawPath(const CanvasPath* path, const Paint* paint);
82 void drawImage(const CanvasImage* image, const Point& p, const Paint* paint) ; 82 void drawImage(const CanvasImage* image, const Point& p, const Paint* paint) ;
83 void drawImageRect(const CanvasImage* image, Rect& src, Rect& dst, Paint* pa int); 83 void drawImageRect(const CanvasImage* image, Rect& src, Rect& dst, Paint* pa int);
84 void drawPicture(Picture* picture);
85 void drawDrawable(Drawable* drawable);
84 86
85 SkCanvas* skCanvas() { return m_canvas; } 87 SkCanvas* skCanvas() { return m_canvas; }
86 void clearSkCanvas() { m_canvas = nullptr; } 88 void clearSkCanvas() { m_canvas = nullptr; }
87 bool isRecording() const { return !!m_canvas; } 89 bool isRecording() const { return !!m_canvas; }
88 90
89 protected: 91 protected:
90 explicit Canvas(SkCanvas* skCanvas); 92 explicit Canvas(SkCanvas* skCanvas);
91 93
92 private: 94 private:
93 // The SkCanvas is supplied by a call to SkPictureRecorder::beginRecording, 95 // The SkCanvas is supplied by a call to SkPictureRecorder::beginRecording,
94 // which does not transfer ownership. For this reason, we hold a raw 96 // which does not transfer ownership. For this reason, we hold a raw
95 // pointer and manually set the SkCanvas to null in clearSkCanvas. 97 // pointer and manually set the SkCanvas to null in clearSkCanvas.
96 SkCanvas* m_canvas; 98 SkCanvas* m_canvas;
97 }; 99 };
98 100
99 } // namespace blink 101 } // namespace blink
100 102
101 #endif // SKY_ENGINE_CORE_PAINTING_CANVAS_H_ 103 #endif // SKY_ENGINE_CORE_PAINTING_CANVAS_H_
OLDNEW
« no previous file with comments | « sky/engine/core/core.gni ('k') | sky/engine/core/painting/Canvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698