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

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

Issue 1152383002: A proof of concept for annular sector layout. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add the Path C++ and IDL files which I forgot before Created 5 years, 7 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 "sky/engine/config.h" 5 #include "sky/engine/config.h"
6 #include "sky/engine/core/painting/Canvas.h" 6 #include "sky/engine/core/painting/Canvas.h"
7 7
8 #include "sky/engine/core/dom/Document.h" 8 #include "sky/engine/core/dom/Document.h"
9 #include "sky/engine/core/dom/Element.h" 9 #include "sky/engine/core/dom/Element.h"
10 #include "sky/engine/core/painting/PaintingTasks.h" 10 #include "sky/engine/core/painting/PaintingTasks.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 void Canvas::drawCircle(float x, float y, float radius, const Paint* paint) 139 void Canvas::drawCircle(float x, float y, float radius, const Paint* paint)
140 { 140 {
141 if (!m_canvas) 141 if (!m_canvas)
142 return; 142 return;
143 ASSERT(paint); 143 ASSERT(paint);
144 ASSERT(m_displayList->isRecording()); 144 ASSERT(m_displayList->isRecording());
145 m_canvas->drawCircle(x, y, radius, paint->paint()); 145 m_canvas->drawCircle(x, y, radius, paint->paint());
146 } 146 }
147 147
148 void Canvas::drawPath(const CanvasPath* path, const Paint* paint)
149 {
150 if (!m_canvas)
151 return;
152 ASSERT(path);
153 ASSERT(paint);
154 ASSERT(m_displayList->isRecording());
155 m_canvas->drawPath(path->path(), paint->paint());
156 }
157
148 PassRefPtr<DisplayList> Canvas::finishRecording() 158 PassRefPtr<DisplayList> Canvas::finishRecording()
149 { 159 {
150 if (!isRecording()) 160 if (!isRecording())
151 return nullptr; 161 return nullptr;
152 m_canvas = nullptr; 162 m_canvas = nullptr;
153 m_displayList->endRecording(); 163 m_displayList->endRecording();
154 return m_displayList.release(); 164 return m_displayList.release();
155 } 165 }
156 166
157 } // namespace blink 167 } // 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