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

Side by Side Diff: src/effects/SkDashPathEffect.cpp

Issue 703783002: Bug fix for cull_line in SkDashPathEffect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add test cases to dashing gm Created 6 years, 1 month 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 | « gm/dashing.cpp ('k') | src/utils/SkDashPath.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkDashPathEffect.h" 8 #include "SkDashPathEffect.h"
9 9
10 #include "SkDashPathPriv.h" 10 #include "SkDashPathPriv.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 const SkMatrix& ctm, const SkRect* cullRect, 59 const SkMatrix& ctm, const SkRect* cullRect,
60 const SkScalar intervalLength) { 60 const SkScalar intervalLength) {
61 if (NULL == cullRect) { 61 if (NULL == cullRect) {
62 SkASSERT(false); // Shouldn't ever occur in practice 62 SkASSERT(false); // Shouldn't ever occur in practice
63 return false; 63 return false;
64 } 64 }
65 65
66 SkScalar dx = pts[1].x() - pts[0].x(); 66 SkScalar dx = pts[1].x() - pts[0].x();
67 SkScalar dy = pts[1].y() - pts[0].y(); 67 SkScalar dy = pts[1].y() - pts[0].y();
68 68
69 if (dx && dy) { 69 if ((dx && dy) || (!dx && !dy)) {
70 return false; 70 return false;
71 } 71 }
72 72
73 SkRect bounds = *cullRect; 73 SkRect bounds = *cullRect;
74 outset_for_stroke(&bounds, rec); 74 outset_for_stroke(&bounds, rec);
75 75
76 // cullRect is in device space while pts are in the local coordinate system 76 // cullRect is in device space while pts are in the local coordinate system
77 // defined by the ctm. We want our answer in the local coordinate system. 77 // defined by the ctm. We want our answer in the local coordinate system.
78 78
79 SkASSERT(ctm.rectStaysRect()); 79 SkASSERT(ctm.rectStaysRect());
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 } 406 }
407 } else { 407 } else {
408 // set the internal data members, fPhase should have been between 0 and intervalLength 408 // set the internal data members, fPhase should have been between 0 and intervalLength
409 // when written to buffer so no need to adjust it 409 // when written to buffer so no need to adjust it
410 SkDashPath::CalcDashParameters(fPhase, fIntervals, fCount, 410 SkDashPath::CalcDashParameters(fPhase, fIntervals, fCount,
411 &fInitialDashLength, &fInitialDashIndex, &fIntervalLength); 411 &fInitialDashLength, &fInitialDashIndex, &fIntervalLength);
412 } 412 }
413 } 413 }
414 #endif 414 #endif
415 415
OLDNEW
« no previous file with comments | « gm/dashing.cpp ('k') | src/utils/SkDashPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698