Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(968)

Side by Side Diff: tools/SkBitmapRegionDecoderInterface.cpp

Issue 1332053002: Fill incomplete images in SkCodec parent class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use aligned memory in swizzler test Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/SkBitmapRegionCanvas.cpp ('k') | tools/dm_flags.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "SkBitmapRegionCanvas.h" 8 #include "SkBitmapRegionCanvas.h"
9 #include "SkBitmapRegionDecoderInterface.h" 9 #include "SkBitmapRegionDecoderInterface.h"
10 #include "SkBitmapRegionSampler.h" 10 #include "SkBitmapRegionSampler.h"
(...skipping 11 matching lines...) Expand all
22 return nullptr; 22 return nullptr;
23 } 23 }
24 if (!decoder->buildTileIndex(stream, &width, &height)) { 24 if (!decoder->buildTileIndex(stream, &width, &height)) {
25 SkDebugf("Error: Could not build tile index.\n"); 25 SkDebugf("Error: Could not build tile index.\n");
26 delete decoder; 26 delete decoder;
27 return nullptr; 27 return nullptr;
28 } 28 }
29 return new SkBitmapRegionSampler(decoder, width, height); 29 return new SkBitmapRegionSampler(decoder, width, height);
30 } 30 }
31 case kCanvas_Strategy: { 31 case kCanvas_Strategy: {
32 SkCodec* decoder = SkCodec::NewFromStream(stream); 32 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream));
33 if (nullptr == decoder) { 33 if (nullptr == codec) {
34 SkDebugf("Error: Failed to create decoder.\n"); 34 SkDebugf("Error: Failed to create decoder.\n");
35 return nullptr; 35 return nullptr;
36 } 36 }
37 switch (decoder->getScanlineOrder()) { 37 switch (codec->getScanlineOrder()) {
38 case SkCodec::kTopDown_SkScanlineOrder: 38 case SkCodec::kTopDown_SkScanlineOrder:
39 case SkCodec::kNone_SkScanlineOrder: 39 case SkCodec::kNone_SkScanlineOrder:
40 break; 40 break;
41 default: 41 default:
42 SkDebugf("Error: Scanline ordering not supported.\n"); 42 SkDebugf("Error: Scanline ordering not supported.\n");
43 return nullptr; 43 return nullptr;
44 } 44 }
45 return new SkBitmapRegionCanvas(decoder); 45 return new SkBitmapRegionCanvas(codec.detach());
46 } 46 }
47 default: 47 default:
48 SkASSERT(false); 48 SkASSERT(false);
49 return nullptr; 49 return nullptr;
50 } 50 }
51 } 51 }
OLDNEW
« no previous file with comments | « tools/SkBitmapRegionCanvas.cpp ('k') | tools/dm_flags.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698