| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkBlurMask.h" | 8 #include "SkBlurMask.h" |
| 9 #include "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
| 10 #include "SkLayerDrawLooper.h" | 10 #include "SkLayerDrawLooper.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // found and fixed for android: not initializing rect for string's of length 0 | 302 // found and fixed for android: not initializing rect for string's of length 0 |
| 303 DEF_TEST(Paint_regression_measureText, reporter) { | 303 DEF_TEST(Paint_regression_measureText, reporter) { |
| 304 | 304 |
| 305 SkPaint paint; | 305 SkPaint paint; |
| 306 paint.setTextSize(12.0f); | 306 paint.setTextSize(12.0f); |
| 307 | 307 |
| 308 SkRect r; | 308 SkRect r; |
| 309 r.setLTRB(SK_ScalarNaN, SK_ScalarNaN, SK_ScalarNaN, SK_ScalarNaN); | 309 r.setLTRB(SK_ScalarNaN, SK_ScalarNaN, SK_ScalarNaN, SK_ScalarNaN); |
| 310 | 310 |
| 311 // test that the rect was reset | 311 // test that the rect was reset |
| 312 paint.measureText("", 0, &r, 1.0f); | 312 paint.measureText("", 0, &r); |
| 313 REPORTER_ASSERT(reporter, r.isEmpty()); | 313 REPORTER_ASSERT(reporter, r.isEmpty()); |
| 314 } | 314 } |
| 315 | 315 |
| 316 #define ASSERT(expr) REPORTER_ASSERT(r, expr) | 316 #define ASSERT(expr) REPORTER_ASSERT(r, expr) |
| 317 | 317 |
| 318 DEF_TEST(Paint_FlatteningTraits, r) { | 318 DEF_TEST(Paint_FlatteningTraits, r) { |
| 319 SkPaint paint; | 319 SkPaint paint; |
| 320 paint.setColor(0x00AABBCC); | 320 paint.setColor(0x00AABBCC); |
| 321 paint.setTextScaleX(1.0f); // Encoded despite being the default value. | 321 paint.setTextScaleX(1.0f); // Encoded despite being the default value. |
| 322 paint.setTextSize(19); | 322 paint.setTextSize(19); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 342 ASSERT(other.getTextScaleX() == paint.getTextScaleX()); | 342 ASSERT(other.getTextScaleX() == paint.getTextScaleX()); |
| 343 ASSERT(other.getTextSize() == paint.getTextSize()); | 343 ASSERT(other.getTextSize() == paint.getTextSize()); |
| 344 ASSERT(other.getLooper() == paint.getLooper()); | 344 ASSERT(other.getLooper() == paint.getLooper()); |
| 345 | 345 |
| 346 // We have to be a little looser and compare just the modes. Pointers might
not be the same. | 346 // We have to be a little looser and compare just the modes. Pointers might
not be the same. |
| 347 SkXfermode::Mode otherMode, paintMode; | 347 SkXfermode::Mode otherMode, paintMode; |
| 348 ASSERT(other.getXfermode()->asMode(&otherMode)); | 348 ASSERT(other.getXfermode()->asMode(&otherMode)); |
| 349 ASSERT(paint.getXfermode()->asMode(&paintMode)); | 349 ASSERT(paint.getXfermode()->asMode(&paintMode)); |
| 350 ASSERT(otherMode == paintMode); | 350 ASSERT(otherMode == paintMode); |
| 351 } | 351 } |
| OLD | NEW |