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 "CodecBench.h" | 8 #include "CodecBench.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCodec.h" | 10 #include "SkCodec.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 SkAutoTDelete<SkCodec> codec; | 65 SkAutoTDelete<SkCodec> codec; |
66 SkPMColor colorTable[256]; | 66 SkPMColor colorTable[256]; |
67 int colorCount; | 67 int colorCount; |
68 for (int i = 0; i < n; i++) { | 68 for (int i = 0; i < n; i++) { |
69 colorCount = 256; | 69 colorCount = 256; |
70 codec.reset(SkCodec::NewFromData(fData)); | 70 codec.reset(SkCodec::NewFromData(fData)); |
71 #ifdef SK_DEBUG | 71 #ifdef SK_DEBUG |
72 const SkCodec::Result result = | 72 const SkCodec::Result result = |
73 #endif | 73 #endif |
74 codec->getPixels(fInfo, fPixelStorage.get(), fInfo.minRowBytes(), | 74 codec->getPixels(fInfo, fPixelStorage.get(), fInfo.minRowBytes(), |
75 NULL, colorTable, &colorCount); | 75 nullptr, colorTable, &colorCount); |
76 SkASSERT(result == SkCodec::kSuccess | 76 SkASSERT(result == SkCodec::kSuccess |
77 || result == SkCodec::kIncompleteInput); | 77 || result == SkCodec::kIncompleteInput); |
78 } | 78 } |
79 } | 79 } |
OLD | NEW |