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

Unified Diff: src/core/SkBitmapProcShader.cpp

Issue 1158273007: switch bitmapshader internals over to pixmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix neon/mips to use pixmpas Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkBitmapController.cpp ('k') | src/core/SkBitmapProcState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcShader.cpp
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index c1a03fecaf22f65b9b95c6c42f33a241f9780df7..e17e60b00e8fea49e808afd6bd644b0b1f6ae826 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -117,22 +117,22 @@ SkBitmapProcShader::BitmapProcShaderContext::BitmapProcShaderContext(
: INHERITED(shader, rec)
, fState(state)
{
- const SkBitmap& bitmap = *fState->fBitmap;
- bool bitmapIsOpaque = bitmap.isOpaque();
+ const SkPixmap& pixmap = fState->fPixmap;
+ bool isOpaque = pixmap.isOpaque();
// update fFlags
uint32_t flags = 0;
- if (bitmapIsOpaque && (255 == this->getPaintAlpha())) {
+ if (isOpaque && (255 == this->getPaintAlpha())) {
flags |= kOpaqueAlpha_Flag;
}
- switch (bitmap.colorType()) {
+ switch (pixmap.colorType()) {
case kRGB_565_SkColorType:
flags |= (kHasSpan16_Flag | kIntrinsicly16_Flag);
break;
case kIndex_8_SkColorType:
case kN32_SkColorType:
- if (bitmapIsOpaque) {
+ if (isOpaque) {
flags |= kHasSpan16_Flag;
}
break;
@@ -142,14 +142,14 @@ SkBitmapProcShader::BitmapProcShaderContext::BitmapProcShaderContext(
break;
}
- if (rec.fPaint->isDither() && bitmap.colorType() != kRGB_565_SkColorType) {
+ if (rec.fPaint->isDither() && pixmap.colorType() != kRGB_565_SkColorType) {
// gradients can auto-dither in their 16bit sampler, but we don't so
// we clear the flag here.
flags &= ~kHasSpan16_Flag;
}
// if we're only 1-pixel high, and we don't rotate, then we can claim this
- if (1 == bitmap.height() &&
+ if (1 == pixmap.height() &&
only_scale_and_translate(this->getTotalInverse())) {
flags |= kConstInY32_Flag;
if (flags & kHasSpan16_Flag) {
@@ -190,9 +190,7 @@ void SkBitmapProcShader::BitmapProcShaderContext::shadeSpan(int x, int y, SkPMCo
SkBitmapProcState::SampleProc32 sproc = state.getSampleProc32();
int max = state.maxCountForBufferSize(sizeof(buffer[0]) * BUF_MAX);
- SkASSERT(state.fBitmap->getPixels());
- SkASSERT(state.fBitmap->pixelRef() == NULL ||
- state.fBitmap->pixelRef()->isLocked());
+ SkASSERT(state.fPixmap.addr());
for (;;) {
int n = count;
@@ -243,9 +241,7 @@ void SkBitmapProcShader::BitmapProcShaderContext::shadeSpan16(int x, int y, uint
SkBitmapProcState::SampleProc16 sproc = state.getSampleProc16();
int max = state.maxCountForBufferSize(sizeof(buffer));
- SkASSERT(state.fBitmap->getPixels());
- SkASSERT(state.fBitmap->pixelRef() == NULL ||
- state.fBitmap->pixelRef()->isLocked());
+ SkASSERT(state.fPixmap.addr());
for (;;) {
int n = count;
« no previous file with comments | « src/core/SkBitmapController.cpp ('k') | src/core/SkBitmapProcState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698