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

Side by Side Diff: src/gpu/GrShape.h

Issue 2051263003: Fix GrShape to preserve inverseness of rrects for strokes but not dashes. (Closed) Base URL: https://chromium.googlesource.com/skia.git@strokeinv
Patch Set: Address comment Created 4 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 | « no previous file | src/gpu/GrShape.cpp » ('j') | 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 2016 Google Inc. 2 * Copyright 2016 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 #ifndef GrShape_DEFINED 8 #ifndef GrShape_DEFINED
9 #define GrShape_DEFINED 9 #define GrShape_DEFINED
10 10
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 if (Type::kPath != fType) { 286 if (Type::kPath != fType) {
287 fPath.reset(); 287 fPath.reset();
288 fInheritedKey.reset(0); 288 fInheritedKey.reset(0);
289 } 289 }
290 } 290 }
291 291
292 void attemptToReduceFromRRect() { 292 void attemptToReduceFromRRect() {
293 SkASSERT(Type::kRRect == fType); 293 SkASSERT(Type::kRRect == fType);
294 SkASSERT(!fInheritedKey.count()); 294 SkASSERT(!fInheritedKey.count());
295 if (fRRectIsInverted) { 295 if (fRRectIsInverted) {
296 if (!fStyle.hasNonDashPathEffect()) { 296 if (fStyle.isDashed()) {
297 SkStrokeRec::Style recStyle = fStyle.strokeRec().getStyle(); 297 // Dashing ignores the inverseness (currently). skbug.com/5421
298 if (SkStrokeRec::kStroke_Style == recStyle || 298 fRRectIsInverted = false;
299 SkStrokeRec::kHairline_Style == recStyle) {
300 // stroking ignores the path fill rule.
301 fRRectIsInverted = false;
302 }
303 } 299 }
304 } else if (fRRect.isEmpty()) { 300 } else if (fRRect.isEmpty()) {
305 fType = Type::kEmpty; 301 fType = Type::kEmpty;
306 } 302 }
307 } 303 }
308 304
309 static Type AttemptToReduceFromPathImpl(const SkPath& path, SkRRect* rrect, 305 static Type AttemptToReduceFromPathImpl(const SkPath& path, SkRRect* rrect,
310 SkPath::Direction* rrectDir, unsigne d* rrectStart, 306 SkPath::Direction* rrectDir, unsigne d* rrectStart,
311 bool* rrectIsInverted, const SkPathE ffect* pe, 307 bool* rrectIsInverted, const SkPathE ffect* pe,
312 const SkStrokeRec& strokeRec); 308 const SkStrokeRec& strokeRec);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 Type fType; 355 Type fType;
360 SkRRect fRRect; 356 SkRRect fRRect;
361 SkPath::Direction fRRectDir; 357 SkPath::Direction fRRectDir;
362 unsigned fRRectStart; 358 unsigned fRRectStart;
363 bool fRRectIsInverted; 359 bool fRRectIsInverted;
364 SkTLazy<SkPath> fPath; 360 SkTLazy<SkPath> fPath;
365 GrStyle fStyle; 361 GrStyle fStyle;
366 SkAutoSTArray<8, uint32_t> fInheritedKey; 362 SkAutoSTArray<8, uint32_t> fInheritedKey;
367 }; 363 };
368 #endif 364 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrShape.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698