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

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

Issue 803153003: Fix rrects that are large enough that we lose/gain a bit when we add the radius to a bounds coordin… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: generalize test for all edges and axes Created 6 years 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 | « include/core/SkPathRef.h ('k') | src/core/SkRRect.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkBuffer.h" 10 #include "SkBuffer.h"
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 } else { 1111 } else {
1112 this->moveTo(bounds.fLeft, 1112 this->moveTo(bounds.fLeft,
1113 bounds.fTop + rrect.fRadii[SkRRect::kUpperLeft_Corner]. fY); 1113 bounds.fTop + rrect.fRadii[SkRRect::kUpperLeft_Corner]. fY);
1114 add_corner_quads(this, rrect, SkRRect::kLowerLeft_Corner, dir); 1114 add_corner_quads(this, rrect, SkRRect::kLowerLeft_Corner, dir);
1115 add_corner_quads(this, rrect, SkRRect::kLowerRight_Corner, dir); 1115 add_corner_quads(this, rrect, SkRRect::kLowerRight_Corner, dir);
1116 add_corner_quads(this, rrect, SkRRect::kUpperRight_Corner, dir); 1116 add_corner_quads(this, rrect, SkRRect::kUpperRight_Corner, dir);
1117 add_corner_quads(this, rrect, SkRRect::kUpperLeft_Corner, dir); 1117 add_corner_quads(this, rrect, SkRRect::kUpperLeft_Corner, dir);
1118 } 1118 }
1119 this->close(); 1119 this->close();
1120 } 1120 }
1121 SkDEBUGCODE(fPathRef->validate();)
1121 } 1122 }
1122 1123
1123 bool SkPath::hasOnlyMoveTos() const { 1124 bool SkPath::hasOnlyMoveTos() const {
1124 int count = fPathRef->countVerbs(); 1125 int count = fPathRef->countVerbs();
1125 const uint8_t* verbs = const_cast<const SkPathRef*>(fPathRef.get())->verbsMe mBegin(); 1126 const uint8_t* verbs = const_cast<const SkPathRef*>(fPathRef.get())->verbsMe mBegin();
1126 for (int i = 0; i < count; ++i) { 1127 for (int i = 0; i < count; ++i) {
1127 if (*verbs == kLine_Verb || 1128 if (*verbs == kLine_Verb ||
1128 *verbs == kQuad_Verb || 1129 *verbs == kQuad_Verb ||
1129 *verbs == kConic_Verb || 1130 *verbs == kConic_Verb ||
1130 *verbs == kCubic_Verb) { 1131 *verbs == kCubic_Verb) {
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
2866 switch (this->getFillType()) { 2867 switch (this->getFillType()) {
2867 case SkPath::kEvenOdd_FillType: 2868 case SkPath::kEvenOdd_FillType:
2868 case SkPath::kInverseEvenOdd_FillType: 2869 case SkPath::kInverseEvenOdd_FillType:
2869 w &= 1; 2870 w &= 1;
2870 break; 2871 break;
2871 default: 2872 default:
2872 break; 2873 break;
2873 } 2874 }
2874 return SkToBool(w); 2875 return SkToBool(w);
2875 } 2876 }
OLDNEW
« no previous file with comments | « include/core/SkPathRef.h ('k') | src/core/SkRRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698