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

Side by Side Diff: src/core/SkBitmap.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 | « src/animator/SkDrawBitmap.cpp ('k') | src/effects/SkMatrixConvolutionImageFilter.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 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 return reset_return_false(this); 210 return reset_return_false(this);
211 } 211 }
212 212
213 this->freePixels(); 213 this->freePixels();
214 214
215 fInfo = info; 215 fInfo = info;
216 fRowBytes = SkToU32(rowBytes); 216 fRowBytes = SkToU32(rowBytes);
217 return true; 217 return true;
218 } 218 }
219 219
220 #ifdef SK_SUPPORT_LEGACY_SETCONFIG
220 bool SkBitmap::setConfig(Config config, int width, int height, size_t rowBytes, 221 bool SkBitmap::setConfig(Config config, int width, int height, size_t rowBytes,
221 SkAlphaType alphaType) { 222 SkAlphaType alphaType) {
222 SkColorType ct = SkBitmapConfigToColorType(config); 223 SkColorType ct = SkBitmapConfigToColorType(config);
223 return this->setInfo(SkImageInfo::Make(width, height, ct, alphaType), rowByt es); 224 return this->setInfo(SkImageInfo::Make(width, height, ct, alphaType), rowByt es);
224 } 225 }
226 #endif
225 227
226 bool SkBitmap::setAlphaType(SkAlphaType alphaType) { 228 bool SkBitmap::setAlphaType(SkAlphaType alphaType) {
227 if (!validate_alphaType(fInfo.fColorType, alphaType, &alphaType)) { 229 if (!validate_alphaType(fInfo.fColorType, alphaType, &alphaType)) {
228 return false; 230 return false;
229 } 231 }
230 if (fInfo.fAlphaType != alphaType) { 232 if (fInfo.fAlphaType != alphaType) {
231 fInfo.fAlphaType = alphaType; 233 fInfo.fAlphaType = alphaType;
232 if (fPixelRef) { 234 if (fPixelRef) {
233 fPixelRef->changeAlphaType(alphaType); 235 fPixelRef->changeAlphaType(alphaType);
234 } 236 }
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 /////////////////////////////////////////////////////////////////////////////// 1427 ///////////////////////////////////////////////////////////////////////////////
1426 1428
1427 #ifdef SK_DEBUG 1429 #ifdef SK_DEBUG
1428 void SkImageInfo::validate() const { 1430 void SkImageInfo::validate() const {
1429 SkASSERT(fWidth >= 0); 1431 SkASSERT(fWidth >= 0);
1430 SkASSERT(fHeight >= 0); 1432 SkASSERT(fHeight >= 0);
1431 SkASSERT(SkColorTypeIsValid(fColorType)); 1433 SkASSERT(SkColorTypeIsValid(fColorType));
1432 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); 1434 SkASSERT(SkAlphaTypeIsValid(fAlphaType));
1433 } 1435 }
1434 #endif 1436 #endif
OLDNEW
« no previous file with comments | « src/animator/SkDrawBitmap.cpp ('k') | src/effects/SkMatrixConvolutionImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698