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

Unified Diff: src/effects/gradients/Sk4fGradientBase.cpp

Issue 2416233002: Faster 4f gradient premul path (Closed)
Patch Set: Created 4 years, 2 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/effects/gradients/Sk4fGradientBase.h ('k') | src/effects/gradients/Sk4fGradientPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/Sk4fGradientBase.cpp
diff --git a/src/effects/gradients/Sk4fGradientBase.cpp b/src/effects/gradients/Sk4fGradientBase.cpp
index 8994db3a91f9bf4d9e5c3ee0592ec1354e1d62cd..4cd213fe143005cd59c918cc9e3a146cef56c2b4 100644
--- a/src/effects/gradients/Sk4fGradientBase.cpp
+++ b/src/effects/gradients/Sk4fGradientBase.cpp
@@ -326,7 +326,7 @@ GradientShaderBase4fContext::shadeSpanInternal(int x, int y,
int count) const {
static const int kBufSize = 128;
SkScalar ts[kBufSize];
- TSampler<dstType, tileMode> sampler(*this);
+ TSampler<dstType, premul, tileMode> sampler(*this);
SkASSERT(count > 0);
do {
@@ -341,7 +341,7 @@ GradientShaderBase4fContext::shadeSpanInternal(int x, int y,
} while (count > 0);
}
-template<DstType dstType, SkShader::TileMode tileMode>
+template<DstType dstType, ApplyPremul premul, SkShader::TileMode tileMode>
class SkGradientShaderBase::GradientShaderBase4fContext::TSampler {
public:
TSampler(const GradientShaderBase4fContext& ctx)
@@ -424,8 +424,8 @@ private:
}
void loadIntervalData(const Interval* i) {
- fCc = DstTraits<dstType>::load(i->fC0);
- fDc = DstTraits<dstType>::load(i->fDc);
+ fCc = DstTraits<dstType, premul>::load(i->fC0);
+ fDc = DstTraits<dstType, premul>::load(i->fDc);
}
const Interval* fFirstInterval;
« no previous file with comments | « src/effects/gradients/Sk4fGradientBase.h ('k') | src/effects/gradients/Sk4fGradientPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698