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

Side by Side Diff: src/core/SkBitmap.cpp

Issue 966753002: Revert of replace kIgnore_SkAlphaType with kUnknown_SkAlphaType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « include/core/SkImageInfo.h ('k') | src/core/SkBitmapDevice.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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 SkPixelRef* SkBitmap::setPixelRef(SkPixelRef* pr, int dx, int dy) { 176 SkPixelRef* SkBitmap::setPixelRef(SkPixelRef* pr, int dx, int dy) {
177 #ifdef SK_DEBUG 177 #ifdef SK_DEBUG
178 if (pr) { 178 if (pr) {
179 if (kUnknown_SkColorType != fInfo.colorType()) { 179 if (kUnknown_SkColorType != fInfo.colorType()) {
180 const SkImageInfo& prInfo = pr->info(); 180 const SkImageInfo& prInfo = pr->info();
181 SkASSERT(fInfo.width() <= prInfo.width()); 181 SkASSERT(fInfo.width() <= prInfo.width());
182 SkASSERT(fInfo.height() <= prInfo.height()); 182 SkASSERT(fInfo.height() <= prInfo.height());
183 SkASSERT(fInfo.colorType() == prInfo.colorType()); 183 SkASSERT(fInfo.colorType() == prInfo.colorType());
184 switch (prInfo.alphaType()) { 184 switch (prInfo.alphaType()) {
185 case kUnknown_SkAlphaType: 185 case kIgnore_SkAlphaType:
186 SkASSERT(fInfo.alphaType() == kUnknown_SkAlphaType); 186 SkASSERT(fInfo.alphaType() == kIgnore_SkAlphaType);
187 break; 187 break;
188 case kOpaque_SkAlphaType: 188 case kOpaque_SkAlphaType:
189 case kPremul_SkAlphaType: 189 case kPremul_SkAlphaType:
190 SkASSERT(fInfo.alphaType() == kOpaque_SkAlphaType || 190 SkASSERT(fInfo.alphaType() == kOpaque_SkAlphaType ||
191 fInfo.alphaType() == kPremul_SkAlphaType); 191 fInfo.alphaType() == kPremul_SkAlphaType);
192 break; 192 break;
193 case kUnpremul_SkAlphaType: 193 case kUnpremul_SkAlphaType:
194 SkASSERT(fInfo.alphaType() == kOpaque_SkAlphaType || 194 SkASSERT(fInfo.alphaType() == kOpaque_SkAlphaType ||
195 fInfo.alphaType() == kUnpremul_SkAlphaType); 195 fInfo.alphaType() == kUnpremul_SkAlphaType);
196 break; 196 break;
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 /////////////////////////////////////////////////////////////////////////////// 1382 ///////////////////////////////////////////////////////////////////////////////
1383 1383
1384 #ifdef SK_DEBUG 1384 #ifdef SK_DEBUG
1385 void SkImageInfo::validate() const { 1385 void SkImageInfo::validate() const {
1386 SkASSERT(fWidth >= 0); 1386 SkASSERT(fWidth >= 0);
1387 SkASSERT(fHeight >= 0); 1387 SkASSERT(fHeight >= 0);
1388 SkASSERT(SkColorTypeIsValid(fColorType)); 1388 SkASSERT(SkColorTypeIsValid(fColorType));
1389 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); 1389 SkASSERT(SkAlphaTypeIsValid(fAlphaType));
1390 } 1390 }
1391 #endif 1391 #endif
OLDNEW
« no previous file with comments | « include/core/SkImageInfo.h ('k') | src/core/SkBitmapDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698