OLD | NEW |
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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 } | 352 } |
353 } | 353 } |
354 | 354 |
355 static bool matrix_only_scale_and_translate(const SkMatrix& matrix) { | 355 static bool matrix_only_scale_and_translate(const SkMatrix& matrix) { |
356 const SkMatrix::TypeMask m = (SkMatrix::TypeMask) (SkMatrix::kAffine_Mask | 356 const SkMatrix::TypeMask m = (SkMatrix::TypeMask) (SkMatrix::kAffine_Mask |
357 | SkMatrix::kPerspective_Mask); | 357 | SkMatrix::kPerspective_Mask); |
358 return (matrix.getType() & m) == 0; | 358 return (matrix.getType() & m) == 0; |
359 } | 359 } |
360 | 360 |
361 bool SkRRect::transform(const SkMatrix& matrix, SkRRect* dst) const { | 361 bool SkRRect::transform(const SkMatrix& matrix, SkRRect* dst) const { |
362 if (NULL == dst) { | 362 if (nullptr == dst) { |
363 return false; | 363 return false; |
364 } | 364 } |
365 | 365 |
366 // Assert that the caller is not trying to do this in place, which | 366 // Assert that the caller is not trying to do this in place, which |
367 // would violate const-ness. Do not return false though, so that | 367 // would violate const-ness. Do not return false though, so that |
368 // if they know what they're doing and want to violate it they can. | 368 // if they know what they're doing and want to violate it they can. |
369 SkASSERT(dst != this); | 369 SkASSERT(dst != this); |
370 | 370 |
371 if (matrix.isIdentity()) { | 371 if (matrix.isIdentity()) { |
372 *dst = *this; | 372 *dst = *this; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 } | 586 } |
587 | 587 |
588 for (int i = 0; i < 4; ++i) { | 588 for (int i = 0; i < 4; ++i) { |
589 validate_radius_check_predicates(fRadii[i].fX, fRect.fLeft, fRect.fRight
); | 589 validate_radius_check_predicates(fRadii[i].fX, fRect.fLeft, fRect.fRight
); |
590 validate_radius_check_predicates(fRadii[i].fY, fRect.fTop, fRect.fBottom
); | 590 validate_radius_check_predicates(fRadii[i].fY, fRect.fTop, fRect.fBottom
); |
591 } | 591 } |
592 } | 592 } |
593 #endif // SK_DEBUG | 593 #endif // SK_DEBUG |
594 | 594 |
595 /////////////////////////////////////////////////////////////////////////////// | 595 /////////////////////////////////////////////////////////////////////////////// |
OLD | NEW |