OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 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 #ifndef SkBitmap_DEFINED | 10 #ifndef SkBitmap_DEFINED |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 return this->getPixels() != NULL && | 364 return this->getPixels() != NULL && |
365 ((this->config() != kIndex8_Config && | 365 ((this->config() != kIndex8_Config && |
366 this->config() != kRLE_Index8_Config) || | 366 this->config() != kRLE_Index8_Config) || |
367 fColorTable != NULL); | 367 fColorTable != NULL); |
368 } | 368 } |
369 | 369 |
370 /** Returns the pixelRef's texture, or NULL | 370 /** Returns the pixelRef's texture, or NULL |
371 */ | 371 */ |
372 SkGpuTexture* getTexture() const; | 372 SkGpuTexture* getTexture() const; |
373 | 373 |
374 /** Return the bitmap's colortable (if any). Does not affect the colortable'
s | 374 /** Return the bitmap's colortable, if it uses one (i.e. fConfig is |
| 375 kIndex8_Config or kRLE_Index8_Config) and the pixels are locked. |
| 376 Otherwise returns NULL. Does not affect the colortable's |
375 reference count. | 377 reference count. |
376 */ | 378 */ |
377 SkColorTable* getColorTable() const { return fColorTable; } | 379 SkColorTable* getColorTable() const { return fColorTable; } |
378 | 380 |
379 /** Returns a non-zero, unique value corresponding to the pixels in our | 381 /** Returns a non-zero, unique value corresponding to the pixels in our |
380 pixelref. Each time the pixels are changed (and notifyPixelsChanged | 382 pixelref. Each time the pixels are changed (and notifyPixelsChanged |
381 is called), a different generation ID will be returned. Finally, if | 383 is called), a different generation ID will be returned. Finally, if |
382 their is no pixelRef then zero is returned. | 384 their is no pixelRef then zero is returned. |
383 */ | 385 */ |
384 uint32_t getGenerationID() const; | 386 uint32_t getGenerationID() const; |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 | 799 |
798 // returns the address of the byte that contains the x coordinate | 800 // returns the address of the byte that contains the x coordinate |
799 inline uint8_t* SkBitmap::getAddr1(int x, int y) const { | 801 inline uint8_t* SkBitmap::getAddr1(int x, int y) const { |
800 SkASSERT(fPixels); | 802 SkASSERT(fPixels); |
801 SkASSERT(fConfig == kA1_Config); | 803 SkASSERT(fConfig == kA1_Config); |
802 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); | 804 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); |
803 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); | 805 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); |
804 } | 806 } |
805 | 807 |
806 #endif | 808 #endif |
OLD | NEW |