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 "Test.h" | 8 #include "Test.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 /////////////////////////////////////////////////////////////////////////////// | 30 /////////////////////////////////////////////////////////////////////////////// |
31 | 31 |
32 // test that we can draw an aa-rect at coordinates > 32K (bigger than fixedpoint
) | 32 // test that we can draw an aa-rect at coordinates > 32K (bigger than fixedpoint
) |
33 static void test_big_aa_rect(skiatest::Reporter* reporter) { | 33 static void test_big_aa_rect(skiatest::Reporter* reporter) { |
34 SkBitmap output; | 34 SkBitmap output; |
35 SkPMColor pixel[1]; | 35 SkPMColor pixel[1]; |
36 output.setConfig(SkBitmap::kARGB_8888_Config, 1, 1, 4); | 36 output.setConfig(SkBitmap::kARGB_8888_Config, 1, 1, 4); |
37 output.setPixels(pixel); | 37 output.setPixels(pixel); |
38 | 38 |
39 SkImage::Info info = { | 39 SkSurface* surf = SkSurface::NewRasterPMColor(300, 33300); |
40 300, 33300, SkImage::kPMColor_ColorType, SkImage::kPremul_AlphaType | |
41 }; | |
42 SkSurface* surf = SkSurface::NewRaster(info); | |
43 SkCanvas* canvas = surf->getCanvas(); | 40 SkCanvas* canvas = surf->getCanvas(); |
44 | 41 |
45 SkRect r = { 0, 33000, 300, 33300 }; | 42 SkRect r = { 0, 33000, 300, 33300 }; |
46 int x = SkScalarRoundToInt(r.left()); | 43 int x = SkScalarRoundToInt(r.left()); |
47 int y = SkScalarRoundToInt(r.top()); | 44 int y = SkScalarRoundToInt(r.top()); |
48 | 45 |
49 // check that the pixel in question starts as transparent (by the surface) | 46 // check that the pixel in question starts as transparent (by the surface) |
50 if (canvas->readPixels(&output, x, y)) { | 47 if (canvas->readPixels(&output, x, y)) { |
51 REPORTER_ASSERT(reporter, 0 == pixel[0]); | 48 REPORTER_ASSERT(reporter, 0 == pixel[0]); |
52 } else { | 49 } else { |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 test_inversepathwithclip(); | 315 test_inversepathwithclip(); |
319 // why? | 316 // why? |
320 if (false) test_crbug131181(); | 317 if (false) test_crbug131181(); |
321 test_infinite_dash(reporter); | 318 test_infinite_dash(reporter); |
322 test_crbug_165432(reporter); | 319 test_crbug_165432(reporter); |
323 test_big_aa_rect(reporter); | 320 test_big_aa_rect(reporter); |
324 } | 321 } |
325 | 322 |
326 #include "TestClassDef.h" | 323 #include "TestClassDef.h" |
327 DEFINE_TESTCLASS("DrawPath", TestDrawPathClass, TestDrawPath) | 324 DEFINE_TESTCLASS("DrawPath", TestDrawPathClass, TestDrawPath) |
OLD | NEW |