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 "math.h" | 5 #include "math.h" |
6 | 6 |
7 #include "sky/engine/config.h" | 7 #include "sky/engine/config.h" |
8 #include "sky/engine/core/painting/Canvas.h" | 8 #include "sky/engine/core/painting/Canvas.h" |
9 | 9 |
10 #include "sky/engine/core/dom/Document.h" | 10 #include "sky/engine/core/dom/Document.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 float x, | 211 float x, |
212 float y, | 212 float y, |
213 const Paint* paint) { | 213 const Paint* paint) { |
214 if (!m_canvas) | 214 if (!m_canvas) |
215 return; | 215 return; |
216 ASSERT(image); | 216 ASSERT(image); |
217 ASSERT(m_displayList->isRecording()); | 217 ASSERT(m_displayList->isRecording()); |
218 m_canvas->drawBitmap(image->bitmap(), x, y, &paint->paint()); | 218 m_canvas->drawBitmap(image->bitmap(), x, y, &paint->paint()); |
219 } | 219 } |
220 | 220 |
221 void Canvas::drawImageRect(const CanvasImage* image, Rect& src, Rect& dst, Paint * paint) { | |
eseidel
2015/06/23 23:22:31
I'm not sure this name is immediately clear to me.
| |
222 if (!m_canvas) | |
223 return; | |
224 ASSERT(image); | |
225 ASSERT(m_displayList->isRecording()); | |
226 m_canvas->drawBitmapRectToRect(image->bitmap(), &src.sk_rect, dst.sk_rect, &pa int->paint()); | |
eseidel
2015/06/23 23:22:31
I think this file uses 4 space indent.
| |
227 } | |
228 | |
221 PassRefPtr<DisplayList> Canvas::finishRecording() | 229 PassRefPtr<DisplayList> Canvas::finishRecording() |
222 { | 230 { |
223 if (!isRecording()) | 231 if (!isRecording()) |
224 return nullptr; | 232 return nullptr; |
225 m_canvas = nullptr; | 233 m_canvas = nullptr; |
226 m_displayList->endRecording(); | 234 m_displayList->endRecording(); |
227 return m_displayList.release(); | 235 return m_displayList.release(); |
228 } | 236 } |
229 | 237 |
230 } // namespace blink | 238 } // namespace blink |
OLD | NEW |