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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 uint8_t fFlags; | 747 uint8_t fFlags; |
748 | 748 |
749 /* Unreference any pixelrefs or colortables | 749 /* Unreference any pixelrefs or colortables |
750 */ | 750 */ |
751 void freePixels(); | 751 void freePixels(); |
752 void updatePixelsFromRef() const; | 752 void updatePixelsFromRef() const; |
753 | 753 |
754 static void WriteRawPixels(SkWriteBuffer*, const SkBitmap&); | 754 static void WriteRawPixels(SkWriteBuffer*, const SkBitmap&); |
755 static bool ReadRawPixels(SkReadBuffer*, SkBitmap*); | 755 static bool ReadRawPixels(SkReadBuffer*, SkBitmap*); |
756 | 756 |
757 friend class SkBitmapSource; // unflatten | |
758 friend class SkReadBuffer; // unflatten, rawpixels | 757 friend class SkReadBuffer; // unflatten, rawpixels |
759 friend class SkWriteBuffer; // rawpixels | 758 friend class SkWriteBuffer; // rawpixels |
760 friend struct SkBitmapProcState; | 759 friend struct SkBitmapProcState; |
761 }; | 760 }; |
762 | 761 |
763 class SkAutoLockPixels : SkNoncopyable { | 762 class SkAutoLockPixels : SkNoncopyable { |
764 public: | 763 public: |
765 SkAutoLockPixels(const SkBitmap& bm, bool doLock = true) : fBitmap(bm) { | 764 SkAutoLockPixels(const SkBitmap& bm, bool doLock = true) : fBitmap(bm) { |
766 fDidLock = doLock; | 765 fDidLock = doLock; |
767 if (doLock) { | 766 if (doLock) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 | 805 |
807 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { | 806 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { |
808 SkASSERT(fPixels); | 807 SkASSERT(fPixels); |
809 SkASSERT(kIndex_8_SkColorType == this->colorType()); | 808 SkASSERT(kIndex_8_SkColorType == this->colorType()); |
810 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); | 809 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); |
811 SkASSERT(fColorTable); | 810 SkASSERT(fColorTable); |
812 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; | 811 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; |
813 } | 812 } |
814 | 813 |
815 #endif | 814 #endif |
OLD | NEW |