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

Side by Side Diff: bench/subset/SubsetZoomBench.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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/subset/SubsetTranslateBench.cpp ('k') | debugger/QT/SkDebuggerGUI.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 "SubsetZoomBench.h" 8 #include "SubsetZoomBench.h"
9 #include "SubsetBenchPriv.h" 9 #include "SubsetBenchPriv.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 void SubsetZoomBench::onDraw(const int n, SkCanvas* canvas) { 56 void SubsetZoomBench::onDraw(const int n, SkCanvas* canvas) {
57 // When the color type is kIndex8, we will need to store the color table. I f it is 57 // When the color type is kIndex8, we will need to store the color table. I f it is
58 // used, it will be initialized by the codec. 58 // used, it will be initialized by the codec.
59 int colorCount; 59 int colorCount;
60 SkPMColor colors[256]; 60 SkPMColor colors[256];
61 if (fUseCodec) { 61 if (fUseCodec) {
62 for (int count = 0; count < n; count++) { 62 for (int count = 0; count < n; count++) {
63 SkAutoTDelete<SkScanlineDecoder> scanlineDecoder( 63 SkAutoTDelete<SkScanlineDecoder> scanlineDecoder(
64 SkScanlineDecoder::NewFromStream(fStream->duplicate())); 64 SkScanlineDecoder::NewFromStream(fStream->duplicate()));
65 const SkImageInfo info = scanlineDecoder->getInfo().makeColorType(fC olorType); 65 const SkImageInfo info = scanlineDecoder->getInfo().makeColorType(fC olorType);
66 SkAutoTDeleteArray<uint8_t> row(SkNEW_ARRAY(uint8_t, info.minRowByte s())); 66 SkAutoTDeleteArray<uint8_t> row(new uint8_t[info.minRowBytes()]);
67 scanlineDecoder->start(info, NULL, colors, &colorCount); 67 scanlineDecoder->start(info, NULL, colors, &colorCount);
68 68
69 const int centerX = info.width() / 2; 69 const int centerX = info.width() / 2;
70 const int centerY = info.height() / 2; 70 const int centerY = info.height() / 2;
71 int w = fSubsetWidth; 71 int w = fSubsetWidth;
72 int h = fSubsetHeight; 72 int h = fSubsetHeight;
73 do { 73 do {
74 const int subsetStartX = SkTMax(0, centerX - w / 2); 74 const int subsetStartX = SkTMax(0, centerX - w / 2);
75 const int subsetStartY = SkTMax(0, centerY - h / 2); 75 const int subsetStartY = SkTMax(0, centerY - h / 2);
76 const int subsetWidth = SkTMin(w, info.width() - subsetStartX); 76 const int subsetWidth = SkTMin(w, info.width() - subsetStartX);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 SkBitmap bitmap; 110 SkBitmap bitmap;
111 SkIRect rect = SkIRect::MakeXYWH(subsetStartX, subsetStartY, sub setWidth, 111 SkIRect rect = SkIRect::MakeXYWH(subsetStartX, subsetStartY, sub setWidth,
112 subsetHeight); 112 subsetHeight);
113 decoder->decodeSubset(&bitmap, rect, fColorType); 113 decoder->decodeSubset(&bitmap, rect, fColorType);
114 w <<= 1; 114 w <<= 1;
115 h <<= 1; 115 h <<= 1;
116 } while (w < 2 * width || h < 2 * height); 116 } while (w < 2 * width || h < 2 * height);
117 } 117 }
118 } 118 }
119 } 119 }
OLDNEW
« no previous file with comments | « bench/subset/SubsetTranslateBench.cpp ('k') | debugger/QT/SkDebuggerGUI.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698