rasterpipeline:
+ only dither if the paint asks for it - don't special case if the shader is a gradient guard: SK_SUPPORT_LEGACY_RASTERPIPELINE Bug: skia: Change-Id: I7f0c101049e5cb32a80306dcfff3bc21bcf318be Reviewed-on: https://skia-review.googlesource.com/17931 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
This commit is contained in:
parent
f485cf9f18
commit
98b7a6a955
@ -14,4 +14,5 @@ android_framework_defines = [
|
|||||||
"SK_SUPPORT_LEGACY_EMBOSSMASKFILTER",
|
"SK_SUPPORT_LEGACY_EMBOSSMASKFILTER",
|
||||||
"SK_SUPPORT_DEPRECATED_CLIPOPS",
|
"SK_SUPPORT_DEPRECATED_CLIPOPS",
|
||||||
"SK_LEGACY_SWEEP_GRADIENT",
|
"SK_LEGACY_SWEEP_GRADIENT",
|
||||||
|
"SK_SUPPORT_LEGACY_RASTERPIPELINE",
|
||||||
]
|
]
|
||||||
|
@ -93,14 +93,18 @@ SkBlitter* SkCreateRasterPipelineBlitter(const SkPixmap& dst,
|
|||||||
SkColorSpace* dstCS = dst.colorSpace();
|
SkColorSpace* dstCS = dst.colorSpace();
|
||||||
auto paintColor = alloc->make<SkPM4f>(SkPM4f_from_SkColor(paint.getColor(), dstCS));
|
auto paintColor = alloc->make<SkPM4f>(SkPM4f_from_SkColor(paint.getColor(), dstCS));
|
||||||
auto shader = as_SB(paint.getShader());
|
auto shader = as_SB(paint.getShader());
|
||||||
|
bool wants_dither = paint.isDither();
|
||||||
|
|
||||||
|
#ifdef SK_SUPPORT_LEGACY_RASTERPIPELINE
|
||||||
|
wants_dither = shader && shader->asAGradient(nullptr) >= SkShader::kLinear_GradientType;
|
||||||
|
#endif
|
||||||
|
|
||||||
SkRasterPipeline_<256> shaderPipeline;
|
SkRasterPipeline_<256> shaderPipeline;
|
||||||
if (!shader) {
|
if (!shader) {
|
||||||
// Having no shader makes things nice and easy... just use the paint color.
|
// Having no shader makes things nice and easy... just use the paint color.
|
||||||
shaderPipeline.append(SkRasterPipeline::constant_color, paintColor);
|
shaderPipeline.append(SkRasterPipeline::constant_color, paintColor);
|
||||||
bool is_opaque = paintColor->a() == 1.0f,
|
bool is_opaque = paintColor->a() == 1.0f,
|
||||||
is_constant = true,
|
is_constant = true;
|
||||||
wants_dither = false;
|
|
||||||
return SkRasterPipelineBlitter::Create(dst, paint, alloc,
|
return SkRasterPipelineBlitter::Create(dst, paint, alloc,
|
||||||
shaderPipeline, nullptr,
|
shaderPipeline, nullptr,
|
||||||
is_opaque, is_constant, wants_dither);
|
is_opaque, is_constant, wants_dither);
|
||||||
@ -108,7 +112,6 @@ SkBlitter* SkCreateRasterPipelineBlitter(const SkPixmap& dst,
|
|||||||
|
|
||||||
bool is_opaque = shader->isOpaque() && paintColor->a() == 1.0f;
|
bool is_opaque = shader->isOpaque() && paintColor->a() == 1.0f;
|
||||||
bool is_constant = shader->isConstant();
|
bool is_constant = shader->isConstant();
|
||||||
bool wants_dither = shader->asAGradient(nullptr) >= SkShader::kLinear_GradientType;
|
|
||||||
|
|
||||||
// See if the shader can express itself by appending pipeline stages.
|
// See if the shader can express itself by appending pipeline stages.
|
||||||
if (shader->appendStages(&shaderPipeline, dstCS, alloc, ctm, paint)) {
|
if (shader->appendStages(&shaderPipeline, dstCS, alloc, ctm, paint)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user