| 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   512  |   512  | 
|   513     this->setPixelRef(pr)->unref(); |   513     this->setPixelRef(pr)->unref(); | 
|   514  |   514  | 
|   515     // since we're already allocated, we lockPixels right away |   515     // since we're already allocated, we lockPixels right away | 
|   516     this->lockPixels(); |   516     this->lockPixels(); | 
|   517     SkASSERT(this->getPixels()); |   517     SkASSERT(this->getPixels()); | 
|   518     SkDEBUGCODE(this->validate();) |   518     SkDEBUGCODE(this->validate();) | 
|   519     return true; |   519     return true; | 
|   520 } |   520 } | 
|   521  |   521  | 
 |   522 bool SkBitmap::installMaskPixels(const SkMask& mask) { | 
 |   523     if (SkMask::kA8_Format != mask.fFormat) { | 
 |   524         this->reset(); | 
 |   525         return false; | 
 |   526     } | 
 |   527     return this->installPixels(SkImageInfo::MakeA8(mask.fBounds.width(), | 
 |   528                                                    mask.fBounds.height()), | 
 |   529                                mask.fImage, mask.fRowBytes); | 
 |   530 } | 
 |   531  | 
|   522 bool SkBitmap::allocConfigPixels(Config config, int width, int height, |   532 bool SkBitmap::allocConfigPixels(Config config, int width, int height, | 
|   523                                  bool isOpaque) { |   533                                  bool isOpaque) { | 
|   524     SkColorType ct; |   534     SkColorType ct; | 
|   525     if (!config_to_colorType(config, &ct)) { |   535     if (!config_to_colorType(config, &ct)) { | 
|   526         return false; |   536         return false; | 
|   527     } |   537     } | 
|   528  |   538  | 
|   529     SkAlphaType at = isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType; |   539     SkAlphaType at = isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType; | 
|   530     return this->allocPixels(SkImageInfo::Make(width, height, ct, at)); |   540     return this->allocPixels(SkImageInfo::Make(width, height, ct, at)); | 
|   531 } |   541 } | 
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1705 /////////////////////////////////////////////////////////////////////////////// |  1715 /////////////////////////////////////////////////////////////////////////////// | 
|  1706  |  1716  | 
|  1707 #ifdef SK_DEBUG |  1717 #ifdef SK_DEBUG | 
|  1708 void SkImageInfo::validate() const { |  1718 void SkImageInfo::validate() const { | 
|  1709     SkASSERT(fWidth >= 0); |  1719     SkASSERT(fWidth >= 0); | 
|  1710     SkASSERT(fHeight >= 0); |  1720     SkASSERT(fHeight >= 0); | 
|  1711     SkASSERT(SkColorTypeIsValid(fColorType)); |  1721     SkASSERT(SkColorTypeIsValid(fColorType)); | 
|  1712     SkASSERT(SkAlphaTypeIsValid(fAlphaType)); |  1722     SkASSERT(SkAlphaTypeIsValid(fAlphaType)); | 
|  1713 } |  1723 } | 
|  1714 #endif |  1724 #endif | 
| OLD | NEW |