| 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/CanvasImage.h" | 10 #include "sky/engine/core/painting/CanvasImage.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 } | 76 } |
| 77 | 77 |
| 78 void Canvas::skew(float sx, float sy) | 78 void Canvas::skew(float sx, float sy) |
| 79 { | 79 { |
| 80 if (!m_canvas) | 80 if (!m_canvas) |
| 81 return; | 81 return; |
| 82 ASSERT(m_displayList->isRecording()); | 82 ASSERT(m_displayList->isRecording()); |
| 83 m_canvas->skew(sx, sy); | 83 m_canvas->skew(sx, sy); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void Canvas::concat(const Vector<float>& matrix) | 86 void Canvas::concat(const Matrix4& matrix) |
| 87 { | 87 { |
| 88 if (!m_canvas) | 88 if (!m_canvas) |
| 89 return; | 89 return; |
| 90 ASSERT(m_displayList->isRecording()); | 90 ASSERT(m_displayList->isRecording()); |
| 91 ASSERT(matrix.size() == 9); | 91 ASSERT(!matrix.is_null); |
| 92 SkMatrix sk_matrix; | 92 m_canvas->concat(matrix.sk_matrix); |
| 93 sk_matrix.set9(matrix.data()); | |
| 94 m_canvas->concat(sk_matrix); | |
| 95 } | 93 } |
| 96 | 94 |
| 97 void Canvas::clipRect(const Rect& rect) | 95 void Canvas::clipRect(const Rect& rect) |
| 98 { | 96 { |
| 99 if (!m_canvas) | 97 if (!m_canvas) |
| 100 return; | 98 return; |
| 101 ASSERT(m_displayList->isRecording()); | 99 ASSERT(m_displayList->isRecording()); |
| 102 m_canvas->clipRect(rect.sk_rect); | 100 m_canvas->clipRect(rect.sk_rect); |
| 103 } | 101 } |
| 104 | 102 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 PassRefPtr<DisplayList> Canvas::finishRecording() | 169 PassRefPtr<DisplayList> Canvas::finishRecording() |
| 172 { | 170 { |
| 173 if (!isRecording()) | 171 if (!isRecording()) |
| 174 return nullptr; | 172 return nullptr; |
| 175 m_canvas = nullptr; | 173 m_canvas = nullptr; |
| 176 m_displayList->endRecording(); | 174 m_displayList->endRecording(); |
| 177 return m_displayList.release(); | 175 return m_displayList.release(); |
| 178 } | 176 } |
| 179 | 177 |
| 180 } // namespace blink | 178 } // namespace blink |
| OLD | NEW |