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

Side by Side Diff: bench/CodecBench.cpp

Issue 1379923005: Remove const from `const int loops`. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: n too 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 | « bench/CodecBench.h ('k') | bench/ColorCubeBench.cpp » ('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 "CodecBench.h" 8 #include "CodecBench.h"
9 #include "CodecBenchPriv.h" 9 #include "CodecBenchPriv.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 30 matching lines...) Expand all
41 // invalid. 41 // invalid.
42 SkAssertResult(SkColorTypeValidateAlphaType(fColorType, fInfo.alphaType(), 42 SkAssertResult(SkColorTypeValidateAlphaType(fColorType, fInfo.alphaType(),
43 &alphaType)); 43 &alphaType));
44 if (alphaType != fInfo.alphaType()) { 44 if (alphaType != fInfo.alphaType()) {
45 fInfo = fInfo.makeAlphaType(alphaType); 45 fInfo = fInfo.makeAlphaType(alphaType);
46 } 46 }
47 47
48 fPixelStorage.reset(fInfo.getSafeSize(fInfo.minRowBytes())); 48 fPixelStorage.reset(fInfo.getSafeSize(fInfo.minRowBytes()));
49 } 49 }
50 50
51 void CodecBench::onDraw(const int n, SkCanvas* canvas) { 51 void CodecBench::onDraw(int n, SkCanvas* canvas) {
52 SkAutoTDelete<SkCodec> codec; 52 SkAutoTDelete<SkCodec> codec;
53 SkPMColor colorTable[256]; 53 SkPMColor colorTable[256];
54 int colorCount; 54 int colorCount;
55 for (int i = 0; i < n; i++) { 55 for (int i = 0; i < n; i++) {
56 colorCount = 256; 56 colorCount = 256;
57 codec.reset(SkCodec::NewFromData(fData)); 57 codec.reset(SkCodec::NewFromData(fData));
58 #ifdef SK_DEBUG 58 #ifdef SK_DEBUG
59 const SkCodec::Result result = 59 const SkCodec::Result result =
60 #endif 60 #endif
61 codec->getPixels(fInfo, fPixelStorage.get(), fInfo.minRowBytes(), 61 codec->getPixels(fInfo, fPixelStorage.get(), fInfo.minRowBytes(),
62 nullptr, colorTable, &colorCount); 62 nullptr, colorTable, &colorCount);
63 SkASSERT(result == SkCodec::kSuccess 63 SkASSERT(result == SkCodec::kSuccess
64 || result == SkCodec::kIncompleteInput); 64 || result == SkCodec::kIncompleteInput);
65 } 65 }
66 } 66 }
OLDNEW
« no previous file with comments | « bench/CodecBench.h ('k') | bench/ColorCubeBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698