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

Unified Diff: src/core/SkFilterShader.cpp

Issue 1022673007: Revert of remove colorfilter native-565 support. complicating w/ no real value. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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/SkFilterShader.h ('k') | src/effects/SkColorFilters.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkFilterShader.cpp
diff --git a/src/core/SkFilterShader.cpp b/src/core/SkFilterShader.cpp
index a10a7c9d77b0fb2bbcede4d71b3f5f81a1bbaab9..48c4b8b477314ba2fbf9a6e64a5859754c7023d7 100644
--- a/src/core/SkFilterShader.cpp
+++ b/src/core/SkFilterShader.cpp
@@ -46,12 +46,13 @@
uint32_t shaderF = fShaderContext->getFlags();
uint32_t filterF = filterShader.fFilter->getFlags();
- // filters don't support 16bit, so clear the matching bit in the shader
- shaderF &= ~SkShader::kHasSpan16_Flag;
-
+ // if the filter doesn't support 16bit, clear the matching bit in the shader
+ if (!(filterF & SkColorFilter::kHasFilter16_Flag)) {
+ shaderF &= ~SkShader::kHasSpan16_Flag;
+ }
// if the filter might change alpha, clear the opaque flag in the shader
if (!(filterF & SkColorFilter::kAlphaUnchanged_Flag)) {
- shaderF &= ~SkShader::kOpaqueAlpha_Flag;
+ shaderF &= ~(SkShader::kOpaqueAlpha_Flag | SkShader::kHasSpan16_Flag);
}
return shaderF;
}
@@ -86,6 +87,16 @@
filterShader.fFilter->filterSpan(result, count, result);
}
+void SkFilterShader::FilterShaderContext::shadeSpan16(int x, int y, uint16_t result[], int count) {
+ const SkFilterShader& filterShader = static_cast<const SkFilterShader&>(fShader);
+
+ SkASSERT(fShaderContext->getFlags() & SkShader::kHasSpan16_Flag);
+ SkASSERT(filterShader.fFilter->getFlags() & SkColorFilter::kHasFilter16_Flag);
+
+ fShaderContext->shadeSpan16(x, y, result, count);
+ filterShader.fFilter->filterSpan16(result, count, result);
+}
+
#ifndef SK_IGNORE_TO_STRING
void SkFilterShader::toString(SkString* str) const {
str->append("SkFilterShader: (");
« no previous file with comments | « src/core/SkFilterShader.h ('k') | src/effects/SkColorFilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698