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

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

Issue 1411303002: SkRemote: DrawPaint is an inverse empty path. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « no previous file | 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 229
230 if (paint.getStyle() == SkPaint::kFill_Style) { 230 if (paint.getStyle() == SkPaint::kFill_Style) {
231 fEncoder->fillPath(p, m); 231 fEncoder->fillPath(p, m);
232 } else { 232 } else {
233 // TODO: handle kStrokeAndFill_Style 233 // TODO: handle kStrokeAndFill_Style
234 fEncoder->strokePath(p, m, ls.lookup(Stroke::CreateFrom(paint))); 234 fEncoder->strokePath(p, m, ls.lookup(Stroke::CreateFrom(paint)));
235 } 235 }
236 } 236 }
237 237
238 void Client::onDrawPaint(const SkPaint& paint) { 238 void Client::onDrawPaint(const SkPaint& paint) {
239 this->onDrawRect(SkRect::MakeLargest(), paint); 239 SkPath path;
240 path.setFillType(SkPath::kInverseWinding_FillType); // Either inverse F illType works fine.
241 this->onDrawPath(path, paint);
240 } 242 }
241 243
242 void Client::onDrawText(const void* text, size_t byteLength, SkScalar x, 244 void Client::onDrawText(const void* text, size_t byteLength, SkScalar x,
243 SkScalar y, const SkPaint& paint) { 245 SkScalar y, const SkPaint& paint) {
244 // Text-as-paths is a temporary hack. 246 // Text-as-paths is a temporary hack.
245 // TODO: send SkTextBlobs and SkTypefaces 247 // TODO: send SkTextBlobs and SkTypefaces
246 SkPath path; 248 SkPath path;
247 paint.getTextPath(text, byteLength, x, y, &path); 249 paint.getTextPath(text, byteLength, x, y, &path);
248 this->onDrawPath(path, paint); 250 this->onDrawPath(path, paint);
249 } 251 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 } 323 }
322 void Server::strokePath(ID path, ID misc, ID stroke) { 324 void Server::strokePath(ID path, ID misc, ID stroke) {
323 SkPaint paint; 325 SkPaint paint;
324 paint.setStyle(SkPaint::kStroke_Style); 326 paint.setStyle(SkPaint::kStroke_Style);
325 fMisc .find(misc ).applyTo(&paint); 327 fMisc .find(misc ).applyTo(&paint);
326 fStroke.find(stroke).applyTo(&paint); 328 fStroke.find(stroke).applyTo(&paint);
327 fCanvas->drawPath(fPath.find(path), paint); 329 fCanvas->drawPath(fPath.find(path), paint);
328 } 330 }
329 331
330 } // namespace SkRemote 332 } // namespace SkRemote
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698