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

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

Issue 1129353010: Add Canvas.drawPicture (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/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
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
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
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