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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 /** | 288 /** |
289 * Call installPixels with no ReleaseProc specified. This means that the | 289 * Call installPixels with no ReleaseProc specified. This means that the |
290 * caller must ensure that the specified pixels are valid for the lifetime | 290 * caller must ensure that the specified pixels are valid for the lifetime |
291 * of the created bitmap (and its pixelRef). | 291 * of the created bitmap (and its pixelRef). |
292 */ | 292 */ |
293 bool installPixels(const SkImageInfo& info, void* pixels, size_t rowBytes) { | 293 bool installPixels(const SkImageInfo& info, void* pixels, size_t rowBytes) { |
294 return this->installPixels(info, pixels, rowBytes, NULL, NULL, NULL); | 294 return this->installPixels(info, pixels, rowBytes, NULL, NULL, NULL); |
295 } | 295 } |
296 | 296 |
297 /** | 297 /** |
| 298 * Call installPixels with no ReleaseProc specified. This means |
| 299 * that the caller must ensure that the specified pixels and |
| 300 * colortable are valid for the lifetime of the created bitmap |
| 301 * (and its pixelRef). |
| 302 */ |
| 303 bool installPixels(const SkPixmap&); |
| 304 |
| 305 /** |
298 * Calls installPixels() with the value in the SkMask. The caller must | 306 * Calls installPixels() with the value in the SkMask. The caller must |
299 * ensure that the specified mask pixels are valid for the lifetime | 307 * ensure that the specified mask pixels are valid for the lifetime |
300 * of the created bitmap (and its pixelRef). | 308 * of the created bitmap (and its pixelRef). |
301 */ | 309 */ |
302 bool installMaskPixels(const SkMask&); | 310 bool installMaskPixels(const SkMask&); |
303 | 311 |
304 /** Use this to assign a new pixel address for an existing bitmap. This | 312 /** Use this to assign a new pixel address for an existing bitmap. This |
305 will automatically release any pixelref previously installed. Only call | 313 will automatically release any pixelref previously installed. Only call |
306 this if you are handling ownership/lifetime of the pixel memory. | 314 this if you are handling ownership/lifetime of the pixel memory. |
307 | 315 |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 | 813 |
806 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { | 814 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { |
807 SkASSERT(fPixels); | 815 SkASSERT(fPixels); |
808 SkASSERT(kIndex_8_SkColorType == this->colorType()); | 816 SkASSERT(kIndex_8_SkColorType == this->colorType()); |
809 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); | 817 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); |
810 SkASSERT(fColorTable); | 818 SkASSERT(fColorTable); |
811 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; | 819 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; |
812 } | 820 } |
813 | 821 |
814 #endif | 822 #endif |
OLD | NEW |