OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkBitmap_DEFINED | 8 #ifndef SkBitmap_DEFINED |
9 #define SkBitmap_DEFINED | 9 #define SkBitmap_DEFINED |
10 | 10 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 ComputeRowBytes() is called to compute the optimal value. This resets | 269 ComputeRowBytes() is called to compute the optimal value. This resets |
270 any pixel/colortable ownership, just like reset(). | 270 any pixel/colortable ownership, just like reset(). |
271 */ | 271 */ |
272 bool setConfig(Config, int width, int height, size_t rowBytes, SkAlphaType); | 272 bool setConfig(Config, int width, int height, size_t rowBytes, SkAlphaType); |
273 | 273 |
274 bool setConfig(Config config, int width, int height, size_t rowBytes = 0) { | 274 bool setConfig(Config config, int width, int height, size_t rowBytes = 0) { |
275 return this->setConfig(config, width, height, rowBytes, | 275 return this->setConfig(config, width, height, rowBytes, |
276 kPremul_SkAlphaType); | 276 kPremul_SkAlphaType); |
277 } | 277 } |
278 | 278 |
279 bool setConfig(const SkImageInfo& info, size_t rowBytes = 0); | 279 bool setInfo(const SkImageInfo&, size_t rowBytes = 0); |
| 280 |
| 281 #ifdef SK_SUPPORT_LEGACY_SETCONFIG_INFO |
| 282 bool setConfig(const SkImageInfo& info, size_t rowBytes = 0) { |
| 283 return this->setInfo(info, rowBytes); |
| 284 } |
| 285 #endif |
280 | 286 |
281 /** | 287 /** |
282 * Allocate a pixelref to match the specified image info. If the Factory | 288 * Allocate a pixelref to match the specified image info. If the Factory |
283 * is non-null, call it to allcoate the pixelref. If the ImageInfo requires | 289 * is non-null, call it to allcoate the pixelref. If the ImageInfo requires |
284 * a colortable, then ColorTable must be non-null, and will be ref'd. | 290 * a colortable, then ColorTable must be non-null, and will be ref'd. |
285 * On failure, the bitmap will be set to empty and return false. | 291 * On failure, the bitmap will be set to empty and return false. |
286 */ | 292 */ |
287 bool allocPixels(const SkImageInfo&, SkPixelRefFactory*, SkColorTable*); | 293 bool allocPixels(const SkImageInfo&, SkPixelRefFactory*, SkColorTable*); |
288 | 294 |
289 /** | 295 /** |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 } | 912 } |
907 | 913 |
908 /////////////////////////////////////////////////////////////////////////////// | 914 /////////////////////////////////////////////////////////////////////////////// |
909 // | 915 // |
910 // Helpers until we can fully deprecate SkBitmap::Config | 916 // Helpers until we can fully deprecate SkBitmap::Config |
911 // | 917 // |
912 extern SkBitmap::Config SkColorTypeToBitmapConfig(SkColorType); | 918 extern SkBitmap::Config SkColorTypeToBitmapConfig(SkColorType); |
913 extern SkColorType SkBitmapConfigToColorType(SkBitmap::Config); | 919 extern SkColorType SkBitmapConfigToColorType(SkBitmap::Config); |
914 | 920 |
915 #endif | 921 #endif |
OLD | NEW |