diff options
author | Mike Klein <mtklein@chromium.org> | 2016-11-29 15:33:39 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-29 21:36:32 +0000 |
commit | 7a14734d2cf20e99a24949e9513d823fdfa03b8d (patch) | |
tree | c9ea1280ca64907ddb8adbf06d326b9c7c1d38ac /src/core | |
parent | 5b1a7c21006175d313aad09ef40f9453a21480e2 (diff) |
support a8
Most of this is plumbing through the full paint to shaders instead of just the filter quality.
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Change-Id: I6afde07566afa3a4391c24dca7017a9a4f5ec700
Reviewed-on: https://skia-review.googlesource.com/5317
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkColorShader.cpp | 4 | ||||
-rw-r--r-- | src/core/SkColorShader.h | 4 | ||||
-rw-r--r-- | src/core/SkPM4fPriv.h | 8 | ||||
-rw-r--r-- | src/core/SkRasterPipeline.h | 1 | ||||
-rw-r--r-- | src/core/SkRasterPipelineBlitter.cpp | 2 | ||||
-rw-r--r-- | src/core/SkShader.cpp | 4 |
6 files changed, 14 insertions, 9 deletions
diff --git a/src/core/SkColorShader.cpp b/src/core/SkColorShader.cpp index a090621188..da87cdfe2c 100644 --- a/src/core/SkColorShader.cpp +++ b/src/core/SkColorShader.cpp @@ -313,7 +313,7 @@ bool SkColorShader::onAppendStages(SkRasterPipeline* p, SkColorSpace* dst, SkFallbackAlloc* scratch, const SkMatrix& ctm, - SkFilterQuality) const { + const SkPaint&) const { auto color = scratch->make<SkPM4f>(SkPM4f_from_SkColor(fColor, dst)); p->append(SkRasterPipeline::constant_color, color); return append_gamut_transform(p, scratch, @@ -324,7 +324,7 @@ bool SkColor4Shader::onAppendStages(SkRasterPipeline* p, SkColorSpace* dst, SkFallbackAlloc* scratch, const SkMatrix& ctm, - SkFilterQuality) const { + const SkPaint&) const { auto color = scratch->make<SkPM4f>(fColor4.premul()); p->append(SkRasterPipeline::constant_color, color); return append_gamut_transform(p, scratch, fColorSpace.get(), dst); diff --git a/src/core/SkColorShader.h b/src/core/SkColorShader.h index 3101fa3a9f..19c106ddfd 100644 --- a/src/core/SkColorShader.h +++ b/src/core/SkColorShader.h @@ -66,7 +66,7 @@ protected: return true; } bool onAppendStages(SkRasterPipeline*, SkColorSpace*, SkFallbackAlloc*, - const SkMatrix& ctm, SkFilterQuality) const override; + const SkMatrix& ctm, const SkPaint&) const override; private: SkColor fColor; @@ -122,7 +122,7 @@ protected: return true; } bool onAppendStages(SkRasterPipeline*, SkColorSpace*, SkFallbackAlloc*, - const SkMatrix& ctm, SkFilterQuality) const override; + const SkMatrix& ctm, const SkPaint&) const override; private: sk_sp<SkColorSpace> fColorSpace; diff --git a/src/core/SkPM4fPriv.h b/src/core/SkPM4fPriv.h index aedb0ad20f..13c1fd9ab7 100644 --- a/src/core/SkPM4fPriv.h +++ b/src/core/SkPM4fPriv.h @@ -111,7 +111,7 @@ static inline bool append_gamut_transform(SkRasterPipeline* p, SkFallbackAlloc* return append_gamut_transform(p, scratch->make<matrix_3x4>()->arr, src, dst); } -static inline SkPM4f SkPM4f_from_SkColor(SkColor color, SkColorSpace* dst) { +static inline SkColor4f SkColor4f_from_SkColor(SkColor color, SkColorSpace* dst) { SkColor4f color4f; if (dst) { // sRGB gamma, sRGB gamut. @@ -131,7 +131,11 @@ static inline SkPM4f SkPM4f_from_SkColor(SkColor color, SkColorSpace* dst) { // Linear gamma, dst gamut. swizzle_rb(SkNx_cast<float>(Sk4b::Load(&color)) * (1/255.0f)).store(&color4f); } - return color4f.premul(); + return color4f; +} + +static inline SkPM4f SkPM4f_from_SkColor(SkColor color, SkColorSpace* dst) { + return SkColor4f_from_SkColor(color, dst).premul(); } #endif diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h index 96a93584c5..0495ebc3e7 100644 --- a/src/core/SkRasterPipeline.h +++ b/src/core/SkRasterPipeline.h @@ -59,6 +59,7 @@ M(move_src_dst) M(move_dst_src) M(swap_rb) M(swap_rb_d) \ M(clamp_0) M(clamp_a) M(clamp_1) \ M(unpremul) M(premul) \ + M(set_rgb) \ M(from_srgb) M(from_srgb_d) M(to_srgb) \ M(constant_color) M(store_f32) \ M(load_565) M(load_565_d) M(store_565) \ diff --git a/src/core/SkRasterPipelineBlitter.cpp b/src/core/SkRasterPipelineBlitter.cpp index 8f1a7ac751..d1796f5766 100644 --- a/src/core/SkRasterPipelineBlitter.cpp +++ b/src/core/SkRasterPipelineBlitter.cpp @@ -116,7 +116,7 @@ SkBlitter* SkRasterPipelineBlitter::Create(const SkPixmap& dst, if (shader) { if (!shader->appendStages(pipeline, dst.colorSpace(), &blitter->fScratchFallback, - ctm, paint.getFilterQuality())) { + ctm, paint)) { return earlyOut(); } if (!is_opaque) { diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp index ca0eac4c8d..87b2cc3f30 100644 --- a/src/core/SkShader.cpp +++ b/src/core/SkShader.cpp @@ -261,8 +261,8 @@ bool SkShader::appendStages(SkRasterPipeline* pipeline, SkColorSpace* dst, SkFallbackAlloc* scratch, const SkMatrix& ctm, - SkFilterQuality quality) const { - return this->onAppendStages(pipeline, dst, scratch, ctm, quality); + const SkPaint& paint) const { + return this->onAppendStages(pipeline, dst, scratch, ctm, paint); } /////////////////////////////////////////////////////////////////////////////////////////////////// |