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

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

Issue 1887103003: spriteblitter for memcpy case (for all configs) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use normal left shift operator Created 4 years, 8 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 | « no previous file | include/core/SkImageInfo.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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 * If the colortype is kUnknown_SkColorType, then 0 is returned. 98 * If the colortype is kUnknown_SkColorType, then 0 is returned.
99 */ 99 */
100 int rowBytesAsPixels() const { 100 int rowBytesAsPixels() const {
101 return fRowBytes >> this->shiftPerPixel(); 101 return fRowBytes >> this->shiftPerPixel();
102 } 102 }
103 103
104 /** 104 /**
105 * Return the shift amount per pixel (i.e. 0 for 1-byte per pixel, 1 for 2- bytes per pixel 105 * Return the shift amount per pixel (i.e. 0 for 1-byte per pixel, 1 for 2- bytes per pixel
106 * colortypes, 2 for 4-bytes per pixel colortypes). Return 0 for kUnknown_S kColorType. 106 * colortypes, 2 for 4-bytes per pixel colortypes). Return 0 for kUnknown_S kColorType.
107 */ 107 */
108 int shiftPerPixel() const { return this->bytesPerPixel() >> 1; } 108 int shiftPerPixel() const { return this->fInfo.shiftPerPixel(); }
109 109
110 /////////////////////////////////////////////////////////////////////////// 110 ///////////////////////////////////////////////////////////////////////////
111 111
112 /** Return true iff the bitmap has empty dimensions. 112 /** Return true iff the bitmap has empty dimensions.
113 * Hey! Before you use this, see if you really want to know drawsNothing() instead. 113 * Hey! Before you use this, see if you really want to know drawsNothing() instead.
114 */ 114 */
115 bool empty() const { return fInfo.isEmpty(); } 115 bool empty() const { return fInfo.isEmpty(); }
116 116
117 /** Return true iff the bitmap has no pixelref. Note: this can return true e ven if the 117 /** Return true iff the bitmap has no pixelref. Note: this can return true e ven if the
118 * dimensions of the bitmap are > 0 (see empty()). 118 * dimensions of the bitmap are > 0 (see empty()).
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 825
826 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { 826 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const {
827 SkASSERT(fPixels); 827 SkASSERT(fPixels);
828 SkASSERT(kIndex_8_SkColorType == this->colorType()); 828 SkASSERT(kIndex_8_SkColorType == this->colorType());
829 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height()); 829 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height());
830 SkASSERT(fColorTable); 830 SkASSERT(fColorTable);
831 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; 831 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)];
832 } 832 }
833 833
834 #endif 834 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkImageInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698