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

Side by Side Diff: src/gpu/effects/GrRRectEffect.cpp

Issue 196343015: Add nine patch type to SkRRect. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix inf loop in tests 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/utils/SkLua.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 2014 Google Inc. 2 * Copyright 2014 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 "GrRRectEffect.h" 8 #include "GrRRectEffect.h"
9 9
10 #include "gl/GrGLEffect.h" 10 #include "gl/GrGLEffect.h"
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 } 651 }
652 cornerFlags = CircularRRectEffect::kAll_CornerFlags; 652 cornerFlags = CircularRRectEffect::kAll_CornerFlags;
653 } else { 653 } else {
654 if (rrect.getSimpleRadii().fX < EllipticalRRectEffect::kRadiusMin || 654 if (rrect.getSimpleRadii().fX < EllipticalRRectEffect::kRadiusMin ||
655 rrect.getSimpleRadii().fY < EllipticalRRectEffect::kRadiusMin) { 655 rrect.getSimpleRadii().fY < EllipticalRRectEffect::kRadiusMin) {
656 return NULL; 656 return NULL;
657 } 657 }
658 return EllipticalRRectEffect::Create(edgeType, 658 return EllipticalRRectEffect::Create(edgeType,
659 EllipticalRRectEffect::kSimple_ RRectType, rrect); 659 EllipticalRRectEffect::kSimple_ RRectType, rrect);
660 } 660 }
661 } else if (rrect.isComplex()) { 661 } else if (rrect.isComplex() || rrect.isNinePatch()) {
662 // Check for the "tab" cases - two adjacent circular corners and two squ are corners. 662 // Check for the "tab" cases - two adjacent circular corners and two squ are corners.
663 SkScalar radius = 0; 663 SkScalar radius = 0;
664 cornerFlags = 0; 664 cornerFlags = 0;
665 for (int c = 0; c < 4; ++c) { 665 for (int c = 0; c < 4; ++c) {
666 const SkVector& r = rrect.radii((SkRRect::Corner)c); 666 const SkVector& r = rrect.radii((SkRRect::Corner)c);
667 SkASSERT((0 == r.fX) == (0 == r.fY)); 667 SkASSERT((0 == r.fX) == (0 == r.fY));
668 if (0 == r.fX) { 668 if (0 == r.fX) {
669 continue; 669 continue;
670 } 670 }
671 if (r.fX != r.fY) { 671 if (r.fX != r.fY) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 rrect); 712 rrect);
713 } 713 }
714 } 714 }
715 return NULL; 715 return NULL;
716 } 716 }
717 } else { 717 } else {
718 return NULL; 718 return NULL;
719 } 719 }
720 return CircularRRectEffect::Create(edgeType, cornerFlags, rrect); 720 return CircularRRectEffect::Create(edgeType, cornerFlags, rrect);
721 } 721 }
OLDNEW
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/utils/SkLua.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698