| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkForceLinking.h" | 10 #include "SkForceLinking.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 SkBitmap image; | 33 SkBitmap image; |
| 34 SkForceLinking(false); | 34 SkForceLinking(false); |
| 35 bool success = SkImageDecoder::DecodeMemory( | 35 bool success = SkImageDecoder::DecodeMemory( |
| 36 gPng, sizeof(gPng), &image, SkColorType::kUnknown_SkColorType, | 36 gPng, sizeof(gPng), &image, SkColorType::kUnknown_SkColorType, |
| 37 SkImageDecoder::kDecodePixels_Mode); | 37 SkImageDecoder::kDecodePixels_Mode); |
| 38 REPORTER_ASSERT(reporter, success); | 38 REPORTER_ASSERT(reporter, success); |
| 39 | 39 |
| 40 SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(SkImageInfo::MakeN32Pre
mul(20, 1))); | 40 SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(SkImageInfo::MakeN32Pre
mul(20, 1))); |
| 41 SkCanvas* canvas = surface->getCanvas(); | 41 SkCanvas* canvas = surface->getCanvas(); |
| 42 SkRect destRect = SkRect::MakeXYWH(0, 0, 20, 1); | 42 SkRect destRect = SkRect::MakeXYWH(0, 0, 20, 1); |
| 43 canvas->drawBitmapRect(image, destRect, NULL); | 43 canvas->drawBitmapRect(image, destRect, nullptr); |
| 44 } | 44 } |
| OLD | NEW |