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

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

Issue 223213005: Fix SkRRect isEmpty assert (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove the conflicting ASSERT Created 6 years, 8 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 | no next file » | 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 if (0 != fRadii[i].fX && 0 != fRadii[i].fY) { 456 if (0 != fRadii[i].fX && 0 != fRadii[i].fY) {
457 allCornersSquare = false; 457 allCornersSquare = false;
458 } 458 }
459 } 459 }
460 bool patchesOfNine = radii_are_nine_patch(fRadii); 460 bool patchesOfNine = radii_are_nine_patch(fRadii);
461 461
462 switch (fType) { 462 switch (fType) {
463 case kEmpty_Type: 463 case kEmpty_Type:
464 SkASSERT(fRect.isEmpty()); 464 SkASSERT(fRect.isEmpty());
465 SkASSERT(allRadiiZero && allRadiiSame && allCornersSquare); 465 SkASSERT(allRadiiZero && allRadiiSame && allCornersSquare);
466
467 SkASSERT(0 == fRect.fLeft && 0 == fRect.fTop &&
468 0 == fRect.fRight && 0 == fRect.fBottom);
469 break; 466 break;
470 case kRect_Type: 467 case kRect_Type:
471 SkASSERT(!fRect.isEmpty()); 468 SkASSERT(!fRect.isEmpty());
472 SkASSERT(allRadiiZero && allRadiiSame && allCornersSquare); 469 SkASSERT(allRadiiZero && allRadiiSame && allCornersSquare);
473 break; 470 break;
474 case kOval_Type: 471 case kOval_Type:
475 SkASSERT(!fRect.isEmpty()); 472 SkASSERT(!fRect.isEmpty());
476 SkASSERT(!allRadiiZero && allRadiiSame && !allCornersSquare); 473 SkASSERT(!allRadiiZero && allRadiiSame && !allCornersSquare);
477 474
478 for (int i = 0; i < 4; ++i) { 475 for (int i = 0; i < 4; ++i) {
(...skipping 16 matching lines...) Expand all
495 SkASSERT(!patchesOfNine); 492 SkASSERT(!patchesOfNine);
496 break; 493 break;
497 case kUnknown_Type: 494 case kUnknown_Type:
498 // no limits on this 495 // no limits on this
499 break; 496 break;
500 } 497 }
501 } 498 }
502 #endif // SK_DEBUG 499 #endif // SK_DEBUG
503 500
504 /////////////////////////////////////////////////////////////////////////////// 501 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698