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

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

Issue 1216833003: Make rendering use PaintingNodes for increased efficiency. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Different approach to calling markNeedsPaint with unattached nodes 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 200 }
201 201
202 void Canvas::drawDrawable(Drawable* drawable) 202 void Canvas::drawDrawable(Drawable* drawable)
203 { 203 {
204 if (!m_canvas) 204 if (!m_canvas)
205 return; 205 return;
206 ASSERT(drawable); 206 ASSERT(drawable);
207 m_canvas->drawDrawable(drawable->toSkia()); 207 m_canvas->drawDrawable(drawable->toSkia());
208 } 208 }
209 209
210 void Canvas::drawPaintingNode(PaintingNode* paintingNode, const Point& p)
211 {
212 if (!m_canvas)
213 return;
214 ASSERT(paintingNode);
215 translate(p.sk_point.x(), p.sk_point.y());
216 m_canvas->drawDrawable(paintingNode->toSkia());
217 translate(-p.sk_point.x(), -p.sk_point.y());
218 }
219
210 } // namespace blink 220 } // 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