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

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

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/painting/Canvas.h ('k') | sky/engine/core/painting/Canvas.idl » ('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 #include "math.h" 5 #include "math.h"
6 6
7 #include "sky/engine/core/painting/Canvas.h" 7 #include "sky/engine/core/painting/Canvas.h"
8 8
9 #include "sky/engine/core/dom/Document.h" 9 #include "sky/engine/core/dom/Document.h"
10 #include "sky/engine/core/dom/Element.h" 10 #include "sky/engine/core/dom/Element.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 void Canvas::drawLine(const Point& p1, const Point& p2, const Paint* paint) 122 void Canvas::drawLine(const Point& p1, const Point& p2, const Paint* paint)
123 { 123 {
124 if (!m_canvas) 124 if (!m_canvas)
125 return; 125 return;
126 ASSERT(paint); 126 ASSERT(paint);
127 m_canvas->drawLine(p1.sk_point.x(), p1.sk_point.y(), p2.sk_point.x(), p2.sk_ point.y(), paint->paint()); 127 m_canvas->drawLine(p1.sk_point.x(), p1.sk_point.y(), p2.sk_point.x(), p2.sk_ point.y(), paint->paint());
128 } 128 }
129 129
130 void Canvas::drawPicture(Picture* picture)
131 {
132 if (!m_canvas)
133 return;
134 ASSERT(picture);
135 m_canvas->drawPicture(picture->toSkia());
136 }
137
138 void Canvas::drawPaint(const Paint* paint) 130 void Canvas::drawPaint(const Paint* paint)
139 { 131 {
140 if (!m_canvas) 132 if (!m_canvas)
141 return; 133 return;
142 ASSERT(paint); 134 ASSERT(paint);
143 m_canvas->drawPaint(paint->paint()); 135 m_canvas->drawPaint(paint->paint());
144 } 136 }
145 137
146 void Canvas::drawRect(const Rect& rect, const Paint* paint) 138 void Canvas::drawRect(const Rect& rect, const Paint* paint)
147 { 139 {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 m_canvas->drawBitmap(image->bitmap(), p.sk_point.x(), p.sk_point.y(), &paint ->paint()); 184 m_canvas->drawBitmap(image->bitmap(), p.sk_point.x(), p.sk_point.y(), &paint ->paint());
193 } 185 }
194 186
195 void Canvas::drawImageRect(const CanvasImage* image, Rect& src, Rect& dst, Paint * paint) { 187 void Canvas::drawImageRect(const CanvasImage* image, Rect& src, Rect& dst, Paint * paint) {
196 if (!m_canvas) 188 if (!m_canvas)
197 return; 189 return;
198 ASSERT(image); 190 ASSERT(image);
199 m_canvas->drawBitmapRectToRect(image->bitmap(), &src.sk_rect, dst.sk_rect, & paint->paint()); 191 m_canvas->drawBitmapRectToRect(image->bitmap(), &src.sk_rect, dst.sk_rect, & paint->paint());
200 } 192 }
201 193
194 void Canvas::drawPicture(Picture* picture)
195 {
196 if (!m_canvas)
197 return;
198 ASSERT(picture);
199 m_canvas->drawPicture(picture->toSkia());
200 }
201
202 void Canvas::drawDrawable(Drawable* drawable)
203 {
204 if (!m_canvas)
205 return;
206 ASSERT(drawable);
207 m_canvas->drawDrawable(drawable->toSkia());
208 }
209
202 } // namespace blink 210 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/painting/Canvas.h ('k') | sky/engine/core/painting/Canvas.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698