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

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

Issue 193193002: plumbing for GPU fast blur (Closed) Base URL: https://skia.googlesource.com/skia.git@fast_rrect_blur_cpu_plumb
Patch Set: fix indentation issue Created 6 years, 9 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/SkMaskFilter.cpp ('k') | src/effects/SkBlurMaskFilter.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 2012 Google Inc. 2 * Copyright 2012 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 "SkRRect.h" 8 #include "SkRRect.h"
9 #include "SkMatrix.h" 9 #include "SkMatrix.h"
10 10
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // x^2 y^2 165 // x^2 y^2
166 // ----- + ----- <= 1 166 // ----- + ----- <= 1
167 // a^2 b^2 167 // a^2 b^2
168 // or : 168 // or :
169 // b^2*x^2 + a^2*y^2 <= (ab)^2 169 // b^2*x^2 + a^2*y^2 <= (ab)^2
170 SkScalar dist = SkScalarMul(SkScalarSquare(canonicalPt.fX), SkScalarSquare( fRadii[index].fY)) + 170 SkScalar dist = SkScalarMul(SkScalarSquare(canonicalPt.fX), SkScalarSquare( fRadii[index].fY)) +
171 SkScalarMul(SkScalarSquare(canonicalPt.fY), SkScalarSquare( fRadii[index].fX)); 171 SkScalarMul(SkScalarSquare(canonicalPt.fY), SkScalarSquare( fRadii[index].fX));
172 return dist <= SkScalarSquare(SkScalarMul(fRadii[index].fX, fRadii[index].fY )); 172 return dist <= SkScalarSquare(SkScalarMul(fRadii[index].fX, fRadii[index].fY ));
173 } 173 }
174 174
175 bool SkRRect::allCornersCircular() const {
176 return fRadii[0].fX == fRadii[0].fY &&
177 fRadii[1].fX == fRadii[1].fY &&
178 fRadii[2].fX == fRadii[2].fY &&
179 fRadii[3].fX == fRadii[3].fY;
180 }
181
175 bool SkRRect::contains(const SkRect& rect) const { 182 bool SkRRect::contains(const SkRect& rect) const {
176 if (!this->getBounds().contains(rect)) { 183 if (!this->getBounds().contains(rect)) {
177 // If 'rect' isn't contained by the RR's bounds then the 184 // If 'rect' isn't contained by the RR's bounds then the
178 // RR definitely doesn't contain it 185 // RR definitely doesn't contain it
179 return false; 186 return false;
180 } 187 }
181 188
182 if (this->isRect()) { 189 if (this->isRect()) {
183 // the prior test was sufficient 190 // the prior test was sufficient
184 return true; 191 return true;
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 SkASSERT(!allRadiiZero && !allRadiiSame && !allCornersSquare); 422 SkASSERT(!allRadiiZero && !allRadiiSame && !allCornersSquare);
416 break; 423 break;
417 case kUnknown_Type: 424 case kUnknown_Type:
418 // no limits on this 425 // no limits on this
419 break; 426 break;
420 } 427 }
421 } 428 }
422 #endif // SK_DEBUG 429 #endif // SK_DEBUG
423 430
424 /////////////////////////////////////////////////////////////////////////////// 431 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « src/core/SkMaskFilter.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698