From dc6c9bf91c158e89cd9d5ef19dfbf1da98c598a6 Mon Sep 17 00:00:00 2001 From: fmalita Date: Mon, 21 Mar 2016 13:16:51 -0700 Subject: Refactor 4f gradients using trait templates Some 4f gradient housekeeping. 1) replace specialization tuples with an enum covering all dest types (L32, S32, F16, F32) 2) group various template helpers into dest trait classes, specialized for each dest type (2a - conflate current dst_swizzle and scale_for_dest ops into one load op) R=reed@google.com,mtklein@google.com,herb@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1816883002 Review URL: https://codereview.chromium.org/1816883002 --- src/effects/gradients/Sk4fLinearGradient.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/effects/gradients/Sk4fLinearGradient.h') diff --git a/src/effects/gradients/Sk4fLinearGradient.h b/src/effects/gradients/Sk4fLinearGradient.h index 30292c361f..dc7a179583 100644 --- a/src/effects/gradients/Sk4fLinearGradient.h +++ b/src/effects/gradients/Sk4fLinearGradient.h @@ -27,14 +27,16 @@ protected: private: using INHERITED = GradientShaderBase4fContext; - template + template class LinearIntervalProcessor; - template - void shadePremulSpan(int x, int y, DstType[], int count) const; + template + void shadePremulSpan(int x, int y, typename DstTraits::Type[], + int count) const; - template - void shadeSpanInternal(int x, int y, DstType[], int count) const; + template + void shadeSpanInternal(int x, int y, typename DstTraits::Type[], + int count) const; const Interval* findInterval(SkScalar fx) const; -- cgit v1.2.3