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/PictureRecorder.h" | 6 #include "sky/engine/core/painting/PictureRecorder.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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 void Canvas::clipRect(const Vector<float>& rect) | 106 void Canvas::clipRect(const Vector<float>& rect) |
107 { | 107 { |
108 if (!m_canvas) | 108 if (!m_canvas) |
109 return; | 109 return; |
110 ASSERT(m_displayList->isRecording()); | 110 ASSERT(m_displayList->isRecording()); |
111 m_canvas->clipRect(toSkRect(rect)); | 111 m_canvas->clipRect(toSkRect(rect)); |
112 } | 112 } |
113 | 113 |
| 114 void Canvas::drawPicture(Picture* picture) |
| 115 { |
| 116 if (!m_canvas) |
| 117 return; |
| 118 ASSERT(picture); |
| 119 ASSERT(m_displayList->isRecording()); |
| 120 m_canvas->drawPicture(picture->displayList()->picture()); |
| 121 } |
| 122 |
114 void Canvas::drawPaint(Paint* paint) | 123 void Canvas::drawPaint(Paint* paint) |
115 { | 124 { |
116 if (!m_canvas) | 125 if (!m_canvas) |
117 return; | 126 return; |
118 ASSERT(paint); | 127 ASSERT(paint); |
119 ASSERT(m_displayList->isRecording()); | 128 ASSERT(m_displayList->isRecording()); |
120 m_canvas->drawPaint(paint->paint()); | 129 m_canvas->drawPaint(paint->paint()); |
121 } | 130 } |
122 | 131 |
123 void Canvas::drawRect(const Vector<float>& rect, const Paint* paint) | 132 void Canvas::drawRect(const Vector<float>& rect, const Paint* paint) |
(...skipping 26 matching lines...) Expand all Loading... |
150 PassRefPtr<DisplayList> Canvas::finishRecording() | 159 PassRefPtr<DisplayList> Canvas::finishRecording() |
151 { | 160 { |
152 if (!isRecording()) | 161 if (!isRecording()) |
153 return nullptr; | 162 return nullptr; |
154 m_canvas = nullptr; | 163 m_canvas = nullptr; |
155 m_displayList->endRecording(); | 164 m_displayList->endRecording(); |
156 return m_displayList.release(); | 165 return m_displayList.release(); |
157 } | 166 } |
158 | 167 |
159 } // namespace blink | 168 } // namespace blink |
OLD | NEW |