OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "CodecPriv.h" | 8 #include "CodecPriv.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 0x99, 0xe3, 0x92, 0xa0, 0xf2, 0xdf, 0x3d, 0x7b, 0x0d, 0xda, 0x04, 0x1c, | 26 0x99, 0xe3, 0x92, 0xa0, 0xf2, 0xdf, 0x3d, 0x7b, 0x0d, 0xda, 0x04, 0x1c, |
27 0x03, 0xad, 0x00, 0x38, 0x5c, 0x2e, 0xad, 0x12, 0x00, 0x00, 0x00, 0x00, | 27 0x03, 0xad, 0x00, 0x38, 0x5c, 0x2e, 0xad, 0x12, 0x00, 0x00, 0x00, 0x00, |
28 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 | 28 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 |
29 }; | 29 }; |
30 | 30 |
31 DEF_TEST(IndexedPngOverflow, reporter) { | 31 DEF_TEST(IndexedPngOverflow, reporter) { |
32 SkBitmap image; | 32 SkBitmap image; |
33 bool success = decode_memory(gPng, sizeof(gPng), &image); | 33 bool success = decode_memory(gPng, sizeof(gPng), &image); |
34 REPORTER_ASSERT(reporter, success); | 34 REPORTER_ASSERT(reporter, success); |
35 | 35 |
36 SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(SkImageInfo::MakeN32Pre
mul(20, 1))); | 36 auto surface(SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(20, 1))); |
37 SkCanvas* canvas = surface->getCanvas(); | 37 SkCanvas* canvas = surface->getCanvas(); |
38 SkRect destRect = SkRect::MakeXYWH(0, 0, 20, 1); | 38 SkRect destRect = SkRect::MakeXYWH(0, 0, 20, 1); |
39 canvas->drawBitmapRect(image, destRect, nullptr); | 39 canvas->drawBitmapRect(image, destRect, nullptr); |
40 } | 40 } |
OLD | NEW |