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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 private: | 687 private: |
688 typedef SkRefCnt INHERITED; | 688 typedef SkRefCnt INHERITED; |
689 }; | 689 }; |
690 | 690 |
691 /** Subclass of Allocator that returns a pixelref that allocates its pixel | 691 /** Subclass of Allocator that returns a pixelref that allocates its pixel |
692 memory from the heap. This is the default Allocator invoked by | 692 memory from the heap. This is the default Allocator invoked by |
693 allocPixels(). | 693 allocPixels(). |
694 */ | 694 */ |
695 class HeapAllocator : public Allocator { | 695 class HeapAllocator : public Allocator { |
696 public: | 696 public: |
697 virtual bool allocPixelRef(SkBitmap*, SkColorTable*) SK_OVERRIDE; | 697 bool allocPixelRef(SkBitmap*, SkColorTable*) SK_OVERRIDE; |
698 }; | 698 }; |
699 | 699 |
700 class RLEPixels { | 700 class RLEPixels { |
701 public: | 701 public: |
702 RLEPixels(int width, int height); | 702 RLEPixels(int width, int height); |
703 virtual ~RLEPixels(); | 703 virtual ~RLEPixels(); |
704 | 704 |
705 uint8_t* packedAtY(int y) const { | 705 uint8_t* packedAtY(int y) const { |
706 SkASSERT((unsigned)y < (unsigned)fHeight); | 706 SkASSERT((unsigned)y < (unsigned)fHeight); |
707 return fYPtrs[y]; | 707 return fYPtrs[y]; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 | 810 |
811 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { | 811 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { |
812 SkASSERT(fPixels); | 812 SkASSERT(fPixels); |
813 SkASSERT(kIndex_8_SkColorType == this->colorType()); | 813 SkASSERT(kIndex_8_SkColorType == this->colorType()); |
814 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); | 814 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); |
815 SkASSERT(fColorTable); | 815 SkASSERT(fColorTable); |
816 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; | 816 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; |
817 } | 817 } |
818 | 818 |
819 #endif | 819 #endif |
OLD | NEW |