aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-08-07 10:10:56 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-07 14:32:00 +0000
commit1aa731a24c5c426485a913951bad366c7b3b5bd5 (patch)
tree5268d03024ad39d0cbed72ad503d689d94e1ec7b /src/shaders
parente08c6a90e55510cf99b01a390446d5e1640f5435 (diff)
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>
Diffstat (limited to 'src/shaders')
-rw-r--r--src/shaders/SkColorShader.cpp8
-rw-r--r--src/shaders/SkColorShader.h2
-rw-r--r--src/shaders/SkShader.cpp67
-rw-r--r--src/shaders/SkShaderBase.h7
4 files changed, 0 insertions, 84 deletions
diff --git a/src/shaders/SkColorShader.cpp b/src/shaders/SkColorShader.cpp
index b57dc9bc35..e718cb0fbf 100644
--- a/src/shaders/SkColorShader.cpp
+++ b/src/shaders/SkColorShader.cpp
@@ -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;
diff --git a/src/shaders/SkColorShader.h b/src/shaders/SkColorShader.h
index 969064946e..f1bd4784f2 100644
--- a/src/shaders/SkColorShader.h
+++ b/src/shaders/SkColorShader.h
@@ -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:
diff --git a/src/shaders/SkShader.cpp b/src/shaders/SkShader.cpp
index 4e5f421f2a..6c10ff200c 100644
--- a/src/shaders/SkShader.cpp
+++ b/src/shaders/SkShader.cpp
@@ -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();
}
diff --git a/src/shaders/SkShaderBase.h b/src/shaders/SkShaderBase.h
index f43790a9ce..9356553c09 100644
--- a/src/shaders/SkShaderBase.h
+++ b/src/shaders/SkShaderBase.h
@@ -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*) {}