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

Side by Side Diff: tools/skdiff_utils.cpp

Issue 322963002: hide SkBitmap::setConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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/picture_utils.cpp ('k') | tools/skpdiff/SkDifferentPixelsMetric_cpu.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 2012 Google Inc. 2 * Copyright 2012 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 #include "skdiff.h" 7 #include "skdiff.h"
8 #include "skdiff_utils.h" 8 #include "skdiff_utils.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 DiffMetricProc dmp, 137 DiffMetricProc dmp,
138 const int colorThreshold, 138 const int colorThreshold,
139 const SkString& outputDir, 139 const SkString& outputDir,
140 const SkString& filename) { 140 const SkString& filename) {
141 const int w = drp->fBase.fBitmap.width(); 141 const int w = drp->fBase.fBitmap.width();
142 const int h = drp->fBase.fBitmap.height(); 142 const int h = drp->fBase.fBitmap.height();
143 143
144 if (w != drp->fComparison.fBitmap.width() || h != drp->fComparison.fBitmap.h eight()) { 144 if (w != drp->fComparison.fBitmap.width() || h != drp->fComparison.fBitmap.h eight()) {
145 drp->fResult = DiffRecord::kDifferentSizes_Result; 145 drp->fResult = DiffRecord::kDifferentSizes_Result;
146 } else { 146 } else {
147 drp->fDifference.fBitmap.setConfig(SkBitmap::kARGB_8888_Config, w, h); 147 drp->fDifference.fBitmap.allocN32Pixels(w, h);
148 drp->fDifference.fBitmap.allocPixels();
149 148
150 drp->fWhite.fBitmap.setConfig(SkBitmap::kARGB_8888_Config, w, h); 149 drp->fWhite.fBitmap.allocN32Pixels(w, h);
151 drp->fWhite.fBitmap.allocPixels();
152 150
153 SkASSERT(DiffRecord::kUnknown_Result == drp->fResult); 151 SkASSERT(DiffRecord::kUnknown_Result == drp->fResult);
154 compute_diff(drp, dmp, colorThreshold); 152 compute_diff(drp, dmp, colorThreshold);
155 SkASSERT(DiffRecord::kUnknown_Result != drp->fResult); 153 SkASSERT(DiffRecord::kUnknown_Result != drp->fResult);
156 } 154 }
157 155
158 if (outputDir.isEmpty()) { 156 if (outputDir.isEmpty()) {
159 drp->fDifference.fStatus = DiffResource::kUnspecified_Status; 157 drp->fDifference.fStatus = DiffResource::kUnspecified_Status;
160 drp->fWhite.fStatus = DiffResource::kUnspecified_Status; 158 drp->fWhite.fStatus = DiffResource::kUnspecified_Status;
161 159
(...skipping 15 matching lines...) Expand all
177 drp->fDifference.fStatus = DiffResource::kDoesNotExist_Status; 175 drp->fDifference.fStatus = DiffResource::kDoesNotExist_Status;
178 } 176 }
179 if (write_bitmap(drp->fWhite.fFullPath, drp->fWhite.fBitmap)) { 177 if (write_bitmap(drp->fWhite.fFullPath, drp->fWhite.fBitmap)) {
180 drp->fWhite.fStatus = DiffResource::kExists_Status; 178 drp->fWhite.fStatus = DiffResource::kExists_Status;
181 } else { 179 } else {
182 drp->fWhite.fStatus = DiffResource::kDoesNotExist_Status; 180 drp->fWhite.fStatus = DiffResource::kDoesNotExist_Status;
183 } 181 }
184 } 182 }
185 } 183 }
186 } 184 }
OLDNEW
« no previous file with comments | « tools/picture_utils.cpp ('k') | tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698