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

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

Issue 1217623002: Support for background images on cards, style demo home (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase Created 5 years, 5 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 | « no previous file | sky/sdk/BUILD.gn » ('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/core/painting/Canvas.h" 7 #include "sky/engine/core/painting/Canvas.h"
8 8
9 #include "sky/engine/core/dom/Document.h" 9 #include "sky/engine/core/dom/Document.h"
10 #include "sky/engine/core/dom/Element.h" 10 #include "sky/engine/core/dom/Element.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 { 102 {
103 if (!m_canvas) 103 if (!m_canvas)
104 return; 104 return;
105 m_canvas->clipRect(rect.sk_rect); 105 m_canvas->clipRect(rect.sk_rect);
106 } 106 }
107 107
108 void Canvas::clipRRect(const RRect* rrect) 108 void Canvas::clipRRect(const RRect* rrect)
109 { 109 {
110 if (!m_canvas) 110 if (!m_canvas)
111 return; 111 return;
112 m_canvas->clipRRect(rrect->rrect()); 112 m_canvas->clipRRect(rrect->rrect(), SkRegion::kIntersect_Op, true);
113 } 113 }
114 114
115 void Canvas::clipPath(const CanvasPath* path) 115 void Canvas::clipPath(const CanvasPath* path)
116 { 116 {
117 if (!m_canvas) 117 if (!m_canvas)
118 return; 118 return;
119 m_canvas->clipPath(path->path()); 119 m_canvas->clipPath(path->path(), SkRegion::kIntersect_Op, true);
120 } 120 }
121 121
122 void Canvas::drawLine(const Point& p1, const Point& p2, const Paint* paint) 122 void Canvas::drawLine(const Point& p1, const Point& p2, const Paint* paint)
123 { 123 {
124 if (!m_canvas) 124 if (!m_canvas)
125 return; 125 return;
126 ASSERT(paint); 126 ASSERT(paint);
127 m_canvas->drawLine(p1.sk_point.x(), p1.sk_point.y(), p2.sk_point.x(), p2.sk_ point.y(), paint->paint()); 127 m_canvas->drawLine(p1.sk_point.x(), p1.sk_point.y(), p2.sk_point.x(), p2.sk_ point.y(), paint->paint());
128 } 128 }
129 129
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 } 193 }
194 194
195 void Canvas::drawImageRect(const CanvasImage* image, Rect& src, Rect& dst, Paint * paint) { 195 void Canvas::drawImageRect(const CanvasImage* image, Rect& src, Rect& dst, Paint * paint) {
196 if (!m_canvas) 196 if (!m_canvas)
197 return; 197 return;
198 ASSERT(image); 198 ASSERT(image);
199 m_canvas->drawBitmapRectToRect(image->bitmap(), &src.sk_rect, dst.sk_rect, & paint->paint()); 199 m_canvas->drawBitmapRectToRect(image->bitmap(), &src.sk_rect, dst.sk_rect, & paint->paint());
200 } 200 }
201 201
202 } // namespace blink 202 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698