| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 SkTSwap(fFlags, other.fFlags); | 84 SkTSwap(fFlags, other.fFlags); |
| 85 | 85 |
| 86 SkDEBUGCODE(this->validate();) | 86 SkDEBUGCODE(this->validate();) |
| 87 } | 87 } |
| 88 | 88 |
| 89 void SkBitmap::reset() { | 89 void SkBitmap::reset() { |
| 90 this->freePixels(); | 90 this->freePixels(); |
| 91 sk_bzero(this, sizeof(*this)); | 91 sk_bzero(this, sizeof(*this)); |
| 92 } | 92 } |
| 93 | 93 |
| 94 #ifdef SK_SUPPORT_LEGACY_BITMAP_CONFIG | |
| 95 SkBitmap::Config SkBitmap::config() const { | |
| 96 return SkColorTypeToBitmapConfig(fInfo.colorType()); | |
| 97 } | |
| 98 #endif | |
| 99 | |
| 100 void SkBitmap::getBounds(SkRect* bounds) const { | 94 void SkBitmap::getBounds(SkRect* bounds) const { |
| 101 SkASSERT(bounds); | 95 SkASSERT(bounds); |
| 102 bounds->set(0, 0, | 96 bounds->set(0, 0, |
| 103 SkIntToScalar(fInfo.fWidth), SkIntToScalar(fInfo.fHeight)); | 97 SkIntToScalar(fInfo.fWidth), SkIntToScalar(fInfo.fHeight)); |
| 104 } | 98 } |
| 105 | 99 |
| 106 void SkBitmap::getBounds(SkIRect* bounds) const { | 100 void SkBitmap::getBounds(SkIRect* bounds) const { |
| 107 SkASSERT(bounds); | 101 SkASSERT(bounds); |
| 108 bounds->set(0, 0, fInfo.fWidth, fInfo.fHeight); | 102 bounds->set(0, 0, fInfo.fWidth, fInfo.fHeight); |
| 109 } | 103 } |
| (...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 /////////////////////////////////////////////////////////////////////////////// | 1389 /////////////////////////////////////////////////////////////////////////////// |
| 1396 | 1390 |
| 1397 #ifdef SK_DEBUG | 1391 #ifdef SK_DEBUG |
| 1398 void SkImageInfo::validate() const { | 1392 void SkImageInfo::validate() const { |
| 1399 SkASSERT(fWidth >= 0); | 1393 SkASSERT(fWidth >= 0); |
| 1400 SkASSERT(fHeight >= 0); | 1394 SkASSERT(fHeight >= 0); |
| 1401 SkASSERT(SkColorTypeIsValid(fColorType)); | 1395 SkASSERT(SkColorTypeIsValid(fColorType)); |
| 1402 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); | 1396 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); |
| 1403 } | 1397 } |
| 1404 #endif | 1398 #endif |
| OLD | NEW |