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

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

Issue 1217573002: remove SkInstCnt (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « include/config/SkUserConfig.h ('k') | include/core/SkBitmapDevice.h » ('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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 * 666 *
667 * Note: if this returns true, the results (in the pixmap) are only valid u ntil the bitmap 667 * Note: if this returns true, the results (in the pixmap) are only valid u ntil the bitmap
668 * is changed in anyway, in which case the results are invalid. 668 * is changed in anyway, in which case the results are invalid.
669 */ 669 */
670 bool peekPixels(SkPixmap*) const; 670 bool peekPixels(SkPixmap*) const;
671 671
672 SkDEBUGCODE(void validate() const;) 672 SkDEBUGCODE(void validate() const;)
673 673
674 class Allocator : public SkRefCnt { 674 class Allocator : public SkRefCnt {
675 public: 675 public:
676 SK_DECLARE_INST_COUNT(Allocator)
677
678 /** Allocate the pixel memory for the bitmap, given its dimensions and 676 /** Allocate the pixel memory for the bitmap, given its dimensions and
679 colortype. Return true on success, where success means either setPix els 677 colortype. Return true on success, where success means either setPix els
680 or setPixelRef was called. The pixels need not be locked when this 678 or setPixelRef was called. The pixels need not be locked when this
681 returns. If the colortype requires a colortable, it also must be 679 returns. If the colortype requires a colortable, it also must be
682 installed via setColorTable. If false is returned, the bitmap and 680 installed via setColorTable. If false is returned, the bitmap and
683 colortable should be left unchanged. 681 colortable should be left unchanged.
684 */ 682 */
685 virtual bool allocPixelRef(SkBitmap*, SkColorTable*) = 0; 683 virtual bool allocPixelRef(SkBitmap*, SkColorTable*) = 0;
686 private: 684 private:
687 typedef SkRefCnt INHERITED; 685 typedef SkRefCnt INHERITED;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 801
804 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { 802 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const {
805 SkASSERT(fPixels); 803 SkASSERT(fPixels);
806 SkASSERT(kIndex_8_SkColorType == this->colorType()); 804 SkASSERT(kIndex_8_SkColorType == this->colorType());
807 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height()); 805 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height());
808 SkASSERT(fColorTable); 806 SkASSERT(fColorTable);
809 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; 807 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)];
810 } 808 }
811 809
812 #endif 810 #endif
OLDNEW
« no previous file with comments | « include/config/SkUserConfig.h ('k') | include/core/SkBitmapDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698