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

Side by Side Diff: src/core/SkRemote.cpp

Issue 1410223002: SkRemote: impl onDrawDRRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 2 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 | « src/core/SkRemote.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkPath.h" 8 #include "SkPath.h"
9 #include "SkRect.h" 9 #include "SkRect.h"
10 #include "SkRemote.h" 10 #include "SkRemote.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 path.addOval(oval); 200 path.addOval(oval);
201 this->onDrawPath(path, paint); 201 this->onDrawPath(path, paint);
202 } 202 }
203 203
204 void Client::onDrawRect(const SkRect& rect, const SkPaint& paint) { 204 void Client::onDrawRect(const SkRect& rect, const SkPaint& paint) {
205 SkPath path; 205 SkPath path;
206 path.addRect(rect); 206 path.addRect(rect);
207 this->onDrawPath(path, paint); 207 this->onDrawPath(path, paint);
208 } 208 }
209 209
210 void Client::onDrawDRRect(const SkRRect& outside,
211 const SkRRect& inside,
212 const SkPaint& paint) {
213 SkPath path;
214 path.addRRect(outside);
215 path.addRRect(inside, SkPath::kCCW_Direction);
216 this->onDrawPath(path, paint);
217 }
218
210 void Client::onDrawPath(const SkPath& path, const SkPaint& paint) { 219 void Client::onDrawPath(const SkPath& path, const SkPaint& paint) {
211 LookupScope ls(fCache, fEncoder); 220 LookupScope ls(fCache, fEncoder);
212 ID p = ls.lookup(path), 221 ID p = ls.lookup(path),
213 m = ls.lookup(Misc::CreateFrom(paint)); 222 m = ls.lookup(Misc::CreateFrom(paint));
214 223
215 if (paint.getStyle() == SkPaint::kFill_Style) { 224 if (paint.getStyle() == SkPaint::kFill_Style) {
216 fEncoder->fillPath(p, m); 225 fEncoder->fillPath(p, m);
217 } else { 226 } else {
218 // TODO: handle kStrokeAndFill_Style 227 // TODO: handle kStrokeAndFill_Style
219 fEncoder->strokePath(p, m, ls.lookup(Stroke::CreateFrom(paint))); 228 fEncoder->strokePath(p, m, ls.lookup(Stroke::CreateFrom(paint)));
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 } 286 }
278 void Server::strokePath(ID path, ID misc, ID stroke) { 287 void Server::strokePath(ID path, ID misc, ID stroke) {
279 SkPaint paint; 288 SkPaint paint;
280 paint.setStyle(SkPaint::kStroke_Style); 289 paint.setStyle(SkPaint::kStroke_Style);
281 fMisc .find(misc ).applyTo(&paint); 290 fMisc .find(misc ).applyTo(&paint);
282 fStroke.find(stroke).applyTo(&paint); 291 fStroke.find(stroke).applyTo(&paint);
283 fCanvas->drawPath(fPath.find(path), paint); 292 fCanvas->drawPath(fPath.find(path), paint);
284 } 293 }
285 294
286 } // namespace SkRemote 295 } // namespace SkRemote
OLDNEW
« no previous file with comments | « src/core/SkRemote.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698