Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Side by Side Diff: include/core/SkBitmap.h

Issue 139463007: no need to refcnt colortables, since pixelrefs own them (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/core/SkBitmap.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 }; 662 };
663 663
664 SkDEVCODE(void toString(SkString* str) const;) 664 SkDEVCODE(void toString(SkString* str) const;)
665 665
666 private: 666 private:
667 struct MipMap; 667 struct MipMap;
668 mutable MipMap* fMipMap; 668 mutable MipMap* fMipMap;
669 669
670 mutable SkPixelRef* fPixelRef; 670 mutable SkPixelRef* fPixelRef;
671 mutable int fPixelLockCount; 671 mutable int fPixelLockCount;
672 // either user-specified (in which case it is not treated as mutable) 672 // These are just caches from the locked pixelref
673 // or a cache of the returned value from fPixelRef->lockPixels()
674 mutable void* fPixels; 673 mutable void* fPixels;
675 mutable SkColorTable* fColorTable; // only meaningful for kIndex8 674 mutable SkColorTable* fColorTable; // only meaningful for kIndex8
676 675
677 SkIPoint fPixelRefOrigin; 676 SkIPoint fPixelRefOrigin;
678 677
679 enum Flags { 678 enum Flags {
680 kImageIsOpaque_Flag = 0x01, 679 kImageIsOpaque_Flag = 0x01,
681 kImageIsVolatile_Flag = 0x02, 680 kImageIsVolatile_Flag = 0x02,
682 kImageIsImmutable_Flag = 0x04, 681 kImageIsImmutable_Flag = 0x04,
683 #ifdef SK_BUILD_FOR_ANDROID 682 #ifdef SK_BUILD_FOR_ANDROID
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 827
829 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { 828 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const {
830 SkASSERT(fPixels); 829 SkASSERT(fPixels);
831 SkASSERT(fConfig == kIndex8_Config); 830 SkASSERT(fConfig == kIndex8_Config);
832 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); 831 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight);
833 SkASSERT(fColorTable); 832 SkASSERT(fColorTable);
834 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; 833 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)];
835 } 834 }
836 835
837 #endif 836 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698