| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkDashPathEffect.h" | 10 #include "SkDashPathEffect.h" |
| 11 #include "SkSurface.h" | 11 #include "SkSurface.h" |
| 12 #include "Test.h" | 12 #include "Test.h" |
| 13 | 13 |
| 14 // test that we can draw an aa-rect at coordinates > 32K (bigger than fixedpoint
) | 14 // test that we can draw an aa-rect at coordinates > 32K (bigger than fixedpoint
) |
| 15 static void test_big_aa_rect(skiatest::Reporter* reporter) { | 15 static void test_big_aa_rect(skiatest::Reporter* reporter) { |
| 16 SkBitmap output; | 16 SkBitmap output; |
| 17 SkPMColor pixel[1]; | 17 SkPMColor pixel[1]; |
| 18 output.installPixels(SkImageInfo::MakeN32Premul(1, 1), | 18 output.installPixels(SkImageInfo::MakeN32Premul(1, 1), pixel, 4); |
| 19 pixel, 4, NULL, NULL); | |
| 20 | 19 |
| 21 SkSurface* surf = SkSurface::NewRasterPMColor(300, 33300); | 20 SkSurface* surf = SkSurface::NewRasterPMColor(300, 33300); |
| 22 SkCanvas* canvas = surf->getCanvas(); | 21 SkCanvas* canvas = surf->getCanvas(); |
| 23 | 22 |
| 24 SkRect r = { 0, 33000, 300, 33300 }; | 23 SkRect r = { 0, 33000, 300, 33300 }; |
| 25 int x = SkScalarRoundToInt(r.left()); | 24 int x = SkScalarRoundToInt(r.left()); |
| 26 int y = SkScalarRoundToInt(r.top()); | 25 int y = SkScalarRoundToInt(r.top()); |
| 27 | 26 |
| 28 // check that the pixel in question starts as transparent (by the surface) | 27 // check that the pixel in question starts as transparent (by the surface) |
| 29 if (canvas->readPixels(&output, x, y)) { | 28 if (canvas->readPixels(&output, x, y)) { |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 test_crbug_124652(); | 282 test_crbug_124652(); |
| 284 test_crbug_140642(); | 283 test_crbug_140642(); |
| 285 test_crbug_140803(); | 284 test_crbug_140803(); |
| 286 test_inversepathwithclip(); | 285 test_inversepathwithclip(); |
| 287 // why? | 286 // why? |
| 288 if (false) test_crbug131181(); | 287 if (false) test_crbug131181(); |
| 289 test_infinite_dash(reporter); | 288 test_infinite_dash(reporter); |
| 290 test_crbug_165432(reporter); | 289 test_crbug_165432(reporter); |
| 291 test_big_aa_rect(reporter); | 290 test_big_aa_rect(reporter); |
| 292 } | 291 } |
| OLD | NEW |