remove unused shadeSpanAlpha -- handled by rasterpipeline
Bug: skia: Change-Id: If13510cbc340b920342d7d4df9ce34ef1081e434 Reviewed-on: https://skia-review.googlesource.com/31420 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
parent
e08c6a90e5
commit
1aa731a24c
@ -68,10 +68,6 @@ void SkColorShader::ColorShaderContext::shadeSpan(int x, int y, SkPMColor span[]
|
||||
sk_memset32(span, fPMColor, count);
|
||||
}
|
||||
|
||||
void SkColorShader::ColorShaderContext::shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) {
|
||||
memset(alpha, SkGetPackedA32(fPMColor), count);
|
||||
}
|
||||
|
||||
void SkColorShader::ColorShaderContext::shadeSpan4f(int x, int y, SkPM4f span[], int count) {
|
||||
for (int i = 0; i < count; ++i) {
|
||||
span[i] = fPM4f;
|
||||
@ -187,10 +183,6 @@ void SkColor4Shader::Color4Context::shadeSpan(int x, int y, SkPMColor span[], in
|
||||
sk_memset32(span, fPMColor, count);
|
||||
}
|
||||
|
||||
void SkColor4Shader::Color4Context::shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) {
|
||||
memset(alpha, SkGetPackedA32(fPMColor), count);
|
||||
}
|
||||
|
||||
void SkColor4Shader::Color4Context::shadeSpan4f(int x, int y, SkPM4f span[], int count) {
|
||||
for (int i = 0; i < count; ++i) {
|
||||
span[i] = fPM4f;
|
||||
|
@ -34,7 +34,6 @@ public:
|
||||
|
||||
uint32_t getFlags() const override;
|
||||
void shadeSpan(int x, int y, SkPMColor span[], int count) override;
|
||||
void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) override;
|
||||
void shadeSpan4f(int x, int y, SkPM4f[], int count) override;
|
||||
|
||||
private:
|
||||
@ -92,7 +91,6 @@ public:
|
||||
|
||||
uint32_t getFlags() const override;
|
||||
void shadeSpan(int x, int y, SkPMColor span[], int count) override;
|
||||
void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) override;
|
||||
void shadeSpan4f(int x, int y, SkPM4f[], int count) override;
|
||||
|
||||
private:
|
||||
|
@ -150,73 +150,6 @@ void SkShaderBase::Context::shadeSpan4f(int x, int y, SkPM4f dst[], int count) {
|
||||
}
|
||||
}
|
||||
|
||||
#include "SkColorPriv.h"
|
||||
|
||||
#define kTempColorQuadCount 6 // balance between speed (larger) and saving stack-space
|
||||
#define kTempColorCount (kTempColorQuadCount << 2)
|
||||
|
||||
#ifdef SK_CPU_BENDIAN
|
||||
#define SkU32BitShiftToByteOffset(shift) (3 - ((shift) >> 3))
|
||||
#else
|
||||
#define SkU32BitShiftToByteOffset(shift) ((shift) >> 3)
|
||||
#endif
|
||||
|
||||
void SkShaderBase::Context::shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) {
|
||||
SkASSERT(count > 0);
|
||||
|
||||
SkPMColor colors[kTempColorCount];
|
||||
|
||||
while ((count -= kTempColorCount) >= 0) {
|
||||
this->shadeSpan(x, y, colors, kTempColorCount);
|
||||
x += kTempColorCount;
|
||||
|
||||
const uint8_t* srcA = (const uint8_t*)colors + SkU32BitShiftToByteOffset(SK_A32_SHIFT);
|
||||
int quads = kTempColorQuadCount;
|
||||
do {
|
||||
U8CPU a0 = srcA[0];
|
||||
U8CPU a1 = srcA[4];
|
||||
U8CPU a2 = srcA[8];
|
||||
U8CPU a3 = srcA[12];
|
||||
srcA += 4*4;
|
||||
*alpha++ = SkToU8(a0);
|
||||
*alpha++ = SkToU8(a1);
|
||||
*alpha++ = SkToU8(a2);
|
||||
*alpha++ = SkToU8(a3);
|
||||
} while (--quads != 0);
|
||||
}
|
||||
SkASSERT(count < 0);
|
||||
SkASSERT(count + kTempColorCount >= 0);
|
||||
if (count += kTempColorCount) {
|
||||
this->shadeSpan(x, y, colors, count);
|
||||
|
||||
const uint8_t* srcA = (const uint8_t*)colors + SkU32BitShiftToByteOffset(SK_A32_SHIFT);
|
||||
do {
|
||||
*alpha++ = *srcA;
|
||||
srcA += 4;
|
||||
} while (--count != 0);
|
||||
}
|
||||
#if 0
|
||||
do {
|
||||
int n = count;
|
||||
if (n > kTempColorCount)
|
||||
n = kTempColorCount;
|
||||
SkASSERT(n > 0);
|
||||
|
||||
this->shadeSpan(x, y, colors, n);
|
||||
x += n;
|
||||
count -= n;
|
||||
|
||||
const uint8_t* srcA = (const uint8_t*)colors + SkU32BitShiftToByteOffset(SK_A32_SHIFT);
|
||||
do {
|
||||
*alpha++ = *srcA;
|
||||
srcA += 4;
|
||||
} while (--n != 0);
|
||||
} while (count > 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const SkMatrix& SkShader::getLocalMatrix() const {
|
||||
return as_SB(this)->getLocalMatrix();
|
||||
}
|
||||
|
@ -105,13 +105,6 @@ public:
|
||||
typedef void (*ShadeProc)(const void* ctx, int x, int y, SkPMColor[], int count);
|
||||
virtual ShadeProc asAShadeProc(void** ctx);
|
||||
|
||||
/**
|
||||
* Similar to shadeSpan, but only returns the alpha-channel for a span.
|
||||
* The default implementation calls shadeSpan() and then extracts the alpha
|
||||
* values from the returned colors.
|
||||
*/
|
||||
virtual void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count);
|
||||
|
||||
// Notification from blitter::blitMask in case we need to see the non-alpha channels
|
||||
virtual void set3DMask(const SkMask*) {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user