assume no color filters in SkVMBlitter
We'll lean on them being folded away before choosing blitters. That happens everywhere but in Google3 now, and there's no use of SkVMBlitter outside our own testing, certainly not Google3. Change-Id: Ic9725ffbad5f2226d5f030e82bd72500a624b1ff Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251740 Auto-Submit: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
parent
e1e1971862
commit
c746cdffa9
@ -5,7 +5,6 @@
|
|||||||
* found in the LICENSE file.
|
* found in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "include/core/SkColorFilter.h"
|
|
||||||
#include "include/private/SkMacros.h"
|
#include "include/private/SkMacros.h"
|
||||||
#include "src/core/SkArenaAlloc.h"
|
#include "src/core/SkArenaAlloc.h"
|
||||||
#include "src/core/SkBlendModePriv.h"
|
#include "src/core/SkBlendModePriv.h"
|
||||||
@ -27,7 +26,6 @@ namespace {
|
|||||||
SkBlendMode blendMode;
|
SkBlendMode blendMode;
|
||||||
sk_sp<SkColorSpace> colorSpace;
|
sk_sp<SkColorSpace> colorSpace;
|
||||||
sk_sp<SkShader> shader;
|
sk_sp<SkShader> shader;
|
||||||
sk_sp<SkColorFilter> colorFilter;
|
|
||||||
|
|
||||||
Key withCoverage(Coverage c) const {
|
Key withCoverage(Coverage c) const {
|
||||||
Key k = *this;
|
Key k = *this;
|
||||||
@ -43,19 +41,17 @@ namespace {
|
|||||||
&& x.coverage == y.coverage
|
&& x.coverage == y.coverage
|
||||||
&& x.blendMode == y.blendMode
|
&& x.blendMode == y.blendMode
|
||||||
&& x.colorSpace == y.colorSpace // SkColorSpace::Equals() would make hashing unsound.
|
&& x.colorSpace == y.colorSpace // SkColorSpace::Equals() would make hashing unsound.
|
||||||
&& x.shader == y.shader
|
&& x.shader == y.shader;
|
||||||
&& x.colorFilter == y.colorFilter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static SkString debug_name(const Key& key) {
|
static SkString debug_name(const Key& key) {
|
||||||
return SkStringPrintf("CT%d-AT%d-Cov%d-Blend%d-CS%d-Shader%d-CF%d",
|
return SkStringPrintf("CT%d-AT%d-Cov%d-Blend%d-CS%d-Shader%d",
|
||||||
key.colorType,
|
key.colorType,
|
||||||
key.alphaType,
|
key.alphaType,
|
||||||
key.coverage,
|
key.coverage,
|
||||||
key.blendMode,
|
key.blendMode,
|
||||||
SkToBool(key.colorSpace),
|
SkToBool(key.colorSpace),
|
||||||
SkToBool(key.shader),
|
SkToBool(key.shader));
|
||||||
SkToBool(key.colorFilter));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool debug_dump(const Key& key) {
|
static bool debug_dump(const Key& key) {
|
||||||
@ -161,7 +157,6 @@ namespace {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (key.colorFilter) { return false; }
|
|
||||||
|
|
||||||
switch (key.colorType) {
|
switch (key.colorType) {
|
||||||
default: return false;
|
default: return false;
|
||||||
@ -205,7 +200,6 @@ namespace {
|
|||||||
src.a = scale_unorm8(src.a, paint_alpha);
|
src.a = scale_unorm8(src.a, paint_alpha);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (key.colorFilter) { TODO; }
|
|
||||||
|
|
||||||
if (key.coverage == Coverage::Mask3D) {
|
if (key.coverage == Coverage::Mask3D) {
|
||||||
skvm::I32 M = load8(varying<uint8_t>()),
|
skvm::I32 M = load8(varying<uint8_t>()),
|
||||||
@ -335,9 +329,11 @@ namespace {
|
|||||||
paint.getBlendMode(),
|
paint.getBlendMode(),
|
||||||
device.refColorSpace(),
|
device.refColorSpace(),
|
||||||
paint.refShader(),
|
paint.refShader(),
|
||||||
paint.refColorFilter(),
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
// Color filters have been folded back into shader and/or paint color by now.
|
||||||
|
SkASSERT(!paint.getColorFilter());
|
||||||
|
|
||||||
SkColor4f color = paint.getColor4f();
|
SkColor4f color = paint.getColor4f();
|
||||||
SkColorSpaceXformSteps{sk_srgb_singleton(), kUnpremul_SkAlphaType,
|
SkColorSpaceXformSteps{sk_srgb_singleton(), kUnpremul_SkAlphaType,
|
||||||
device.colorSpace(), kUnpremul_SkAlphaType}.apply(color.vec());
|
device.colorSpace(), kUnpremul_SkAlphaType}.apply(color.vec());
|
||||||
|
Loading…
Reference in New Issue
Block a user