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

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

Issue 1174203002: Clip inkwell splash around the floating action button (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase and apply code review feedback Created 5 years, 6 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 "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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 110 }
111 111
112 void Canvas::clipRect(const Rect& rect) 112 void Canvas::clipRect(const Rect& rect)
113 { 113 {
114 if (!m_canvas) 114 if (!m_canvas)
115 return; 115 return;
116 ASSERT(m_displayList->isRecording()); 116 ASSERT(m_displayList->isRecording());
117 m_canvas->clipRect(rect.sk_rect); 117 m_canvas->clipRect(rect.sk_rect);
118 } 118 }
119 119
120 void Canvas::clipRRect(const RRect* rrect)
121 {
122 if (!m_canvas)
123 return;
124 ASSERT(m_displayList->isRecording());
125 m_canvas->clipRRect(rrect->rrect());
126 }
127
128 void Canvas::clipPath(const CanvasPath* path)
129 {
130 if (!m_canvas)
131 return;
132 ASSERT(m_displayList->isRecording());
133 m_canvas->clipPath(path->path());
134 }
135
120 void Canvas::drawLine(float x0, float y0, float x1, float y1, const Paint* paint ) 136 void Canvas::drawLine(float x0, float y0, float x1, float y1, const Paint* paint )
121 { 137 {
122 if (!m_canvas) 138 if (!m_canvas)
123 return; 139 return;
124 ASSERT(paint); 140 ASSERT(paint);
125 ASSERT(m_displayList->isRecording()); 141 ASSERT(m_displayList->isRecording());
126 m_canvas->drawLine(x0, y0, x1, y1, paint->paint()); 142 m_canvas->drawLine(x0, y0, x1, y1, paint->paint());
127 } 143 }
128 144
129 void Canvas::drawPicture(Picture* picture) 145 void Canvas::drawPicture(Picture* picture)
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 PassRefPtr<DisplayList> Canvas::finishRecording() 221 PassRefPtr<DisplayList> Canvas::finishRecording()
206 { 222 {
207 if (!isRecording()) 223 if (!isRecording())
208 return nullptr; 224 return nullptr;
209 m_canvas = nullptr; 225 m_canvas = nullptr;
210 m_displayList->endRecording(); 226 m_displayList->endRecording();
211 return m_displayList.release(); 227 return m_displayList.release();
212 } 228 }
213 229
214 } // namespace blink 230 } // 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