| 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 a given image. | 448 a given image. |
| 449 */ | 449 */ |
| 450 void unlockPixels() const; | 450 void unlockPixels() const; |
| 451 | 451 |
| 452 /** | 452 /** |
| 453 * Some bitmaps can return a copy of their pixels for lockPixels(), but | 453 * Some bitmaps can return a copy of their pixels for lockPixels(), but |
| 454 * that copy, if modified, will not be pushed back. These bitmaps should | 454 * that copy, if modified, will not be pushed back. These bitmaps should |
| 455 * not be used as targets for a raster device/canvas (since all pixels | 455 * not be used as targets for a raster device/canvas (since all pixels |
| 456 * modifications will be lost when unlockPixels() is called.) | 456 * modifications will be lost when unlockPixels() is called.) |
| 457 */ | 457 */ |
| 458 // DEPRECATED |
| 458 bool lockPixelsAreWritable() const; | 459 bool lockPixelsAreWritable() const; |
| 459 | 460 |
| 460 bool requestLock(SkAutoPixmapUnlock* result) const; | 461 bool requestLock(SkAutoPixmapUnlock* result) const; |
| 461 | 462 |
| 462 /** Call this to be sure that the bitmap is valid enough to be drawn (i.e. | 463 /** Call this to be sure that the bitmap is valid enough to be drawn (i.e. |
| 463 it has non-null pixels, and if required by its colortype, it has a | 464 it has non-null pixels, and if required by its colortype, it has a |
| 464 non-null colortable. Returns true if all of the above are met. | 465 non-null colortable. Returns true if all of the above are met. |
| 465 */ | 466 */ |
| 466 bool readyToDraw() const { | 467 bool readyToDraw() const { |
| 467 return this->getPixels() != NULL && | 468 return this->getPixels() != NULL && |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 | 826 |
| 826 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { | 827 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { |
| 827 SkASSERT(fPixels); | 828 SkASSERT(fPixels); |
| 828 SkASSERT(kIndex_8_SkColorType == this->colorType()); | 829 SkASSERT(kIndex_8_SkColorType == this->colorType()); |
| 829 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); | 830 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); |
| 830 SkASSERT(fColorTable); | 831 SkASSERT(fColorTable); |
| 831 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; | 832 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; |
| 832 } | 833 } |
| 833 | 834 |
| 834 #endif | 835 #endif |
| OLD | NEW |