aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-06-01 09:37:57 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-01 13:58:05 +0000
commita03d407aea76a606503a835a45cc8ca7666ed680 (patch)
treea5e5e14d6e92854825339736acf978a81e4388a6 /src/shaders
parent2f4ddf6964edba1b8d2fdf50e328b60d10ce6ddf (diff)
fix and test colorfiltershader
Bug: skia: Change-Id: I02fd77796880b42ce55549a8340b116e1c5f19d6 Reviewed-on: https://skia-review.googlesource.com/18305 Commit-Queue: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/shaders')
-rw-r--r--src/shaders/SkColorFilterShader.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/shaders/SkColorFilterShader.cpp b/src/shaders/SkColorFilterShader.cpp
index 94cc99e9df..549f396b5a 100644
--- a/src/shaders/SkColorFilterShader.cpp
+++ b/src/shaders/SkColorFilterShader.cpp
@@ -93,10 +93,24 @@ void SkColorFilterShader::FilterShaderContext::shadeSpan(int x, int y, SkPMColor
filterShader.fFilter->filterSpan(result, count, result);
}
+#include "SkRasterPipeline.h"
void SkColorFilterShader::FilterShaderContext::shadeSpan4f(int x, int y, SkPM4f result[],
int count) {
- // Should never get here, as shadeSpan4f should only be called if stages fails
- SkASSERT(false);
+ const SkColorFilterShader& filterShader = static_cast<const SkColorFilterShader&>(fShader);
+
+ fShaderContext->shadeSpan4f(x, y, result, count);
+
+ // now apply the filter
+
+ SkSTArenaAlloc<128> alloc;
+ SkRasterPipeline pipeline(&alloc);
+
+ const SkPM4f* src = result;
+ pipeline.append(SkRasterPipeline::load_f32, &src);
+ filterShader.fFilter->appendStages(&pipeline, nullptr, &alloc, filterShader.isOpaque());
+ SkPM4f* dst = result;
+ pipeline.append(SkRasterPipeline::store_f32, &dst);
+ pipeline.run(0, count);
}
#if SK_SUPPORT_GPU