OLD | NEW |
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 Loading... |
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 |
OLD | NEW |