aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkShader.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2016-02-15 07:48:35 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-15 07:48:35 -0800
commita34be68a7eff0ae475b194f8a29975460cf3e456 (patch)
tree4cec53acc400eb2788a24c320e551ebac0d27d34 /src/core/SkShader.cpp
parentbd6366a69ec890211496892e1a76535439ca2b30 (diff)
blitters for sRGB and float16
Diffstat (limited to 'src/core/SkShader.cpp')
-rw-r--r--src/core/SkShader.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index 856b659213..4b5dc5dc06 100644
--- a/src/core/SkShader.cpp
+++ b/src/core/SkShader.cpp
@@ -117,8 +117,19 @@ SkShader::Context::ShadeProc SkShader::Context::asAShadeProc(void** ctx) {
return nullptr;
}
-void SkShader::Context::shadeSpan4f(int x, int y, SkPM4f[], int count) {
- SkASSERT(false && "shadeSpan4f called but not implemented");
+void SkShader::Context::shadeSpan4f(int x, int y, SkPM4f dst[], int count) {
+ const int N = 128;
+ SkPMColor tmp[N];
+ while (count > 0) {
+ int n = SkTMin(count, N);
+ this->shadeSpan(x, y, tmp, n);
+ for (int i = 0; i < n; ++i) {
+ dst[i] = SkPM4f::FromPMColor(tmp[i]);
+ }
+ dst += n;
+ x += n;
+ count -= n;
+ }
}
#include "SkColorPriv.h"