OLD | NEW |
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 Loading... |
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 kIgnore_SkAlphaType: | 185 case kUnknown_SkAlphaType: |
186 SkASSERT(fInfo.alphaType() == kIgnore_SkAlphaType); | 186 SkASSERT(fInfo.alphaType() == kUnknown_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 Loading... |
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 |
OLD | NEW |