Revert "Reimplement TwoPointConicalGradient_gpu"

This reverts commit 84f18c422a.

Reason for revert: GMs are incorrect on some mobile devices

Original change's description:
> Reimplement TwoPointConicalGradient_gpu
> 
>     4.24% faster in gradient_conical_clamp_shallow_dither
>     6.43% faster in gradient_conicalOutZero_clamp_hicolor
>    10.41% faster in gradient_conicalOut_clamp_hicolor
>    14.85% faster in gradient_conicalOutZero_clamp_3color
>    16.72% faster in gradient_conicalOut_clamp
>    24.30% faster in gradient_conicalOut_clamp_3color
> 
> CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android,Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android
> 
> Bug: skia:
> Change-Id: I6bc1f24c9463fc9c2acbcba7bd4d55b37ade1613
> Reviewed-on: https://skia-review.googlesource.com/82161
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Yuqian Li <liyuqian@google.com>

TBR=egdaniel@google.com,fmalita@google.com,liyuqian@google.com

Change-Id: Ieb20cce12a958abb8293218b89baf3d5a2aad0a8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Cq-Include-Trybots: skia.primary:Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android, Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android
Reviewed-on: https://skia-review.googlesource.com/84801
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
This commit is contained in:
Yuqian Li 2017-12-13 19:54:51 +00:00 committed by Skia Commit-Bot
parent b5213b88e8
commit 2c4e56c366
5 changed files with 1182 additions and 309 deletions

View File

@ -49,17 +49,6 @@ static sk_sp<SkShader> Make2ConicalOutside(const SkPoint pts[2], const GradData&
data.fPos, data.fCount, tm, 0, &localMatrix);
}
static sk_sp<SkShader> Make2ConicalOutsideStrip(const SkPoint pts[2], const GradData& data,
SkShader::TileMode tm, const SkMatrix& localMatrix) {
SkPoint center0, center1;
SkScalar radius0 = (pts[1].fX - pts[0].fX) / 10;
SkScalar radius1 = (pts[1].fX - pts[0].fX) / 3;
center0.set(pts[0].fX + radius0, pts[0].fY + radius0);
center1.set(pts[1].fX - radius1, pts[1].fY - radius1);
return SkGradientShader::MakeTwoPointConical(center0, radius1, center1, radius1, data.fColors,
data.fPos, data.fCount, tm, 0, &localMatrix);
}
static sk_sp<SkShader> Make2ConicalOutsideFlip(const SkPoint pts[2], const GradData& data,
SkShader::TileMode tm, const SkMatrix& localMatrix) {
SkPoint center0, center1;
@ -264,8 +253,7 @@ typedef sk_sp<SkShader> (*GradMaker)(const SkPoint pts[2], const GradData& data,
constexpr GradMaker gGradMakersOutside[] = {
Make2ConicalOutside, Make2ConicalOutsideFlip,
Make2ConicalZeroRadOutside, Make2ConicalZeroRadFlipOutside,
Make2ConicalOutsideStrip
Make2ConicalZeroRadOutside, Make2ConicalZeroRadFlipOutside
};
constexpr GradMaker gGradMakersInside[] = {

View File

@ -54,7 +54,7 @@ SkTArray<GrXPFactoryTestFactory*, true>* GrXPFactoryTestFactory::GetFactories()
* we verify the count is as expected. If a new factory is added, then these numbers must be
* manually adjusted.
*/
static const int kFPFactoryCount = 38;
static const int kFPFactoryCount = 42;
static const int kGPFactoryCount = 14;
static const int kXPFactoryCount = 4;

View File

@ -69,6 +69,8 @@ public:
kBlockInputFragmentProcessor_ClassID,
kCCPRClipProcessor_ClassID,
kCircleGeometryProcessor_ClassID,
kCircleInside2PtConicalEffect_ClassID,
kCircleOutside2PtConicalEffect_ClassID,
kCircularRRectEffect_ClassID,
kColorMatrixEffect_ClassID,
kColorTableEffect_ClassID,
@ -81,9 +83,11 @@ public:
kDefaultGeoProc_ClassID,
kDIEllipseGeometryProcessor_ClassID,
kDisableColorXP_ClassID,
kTwoPointConicalEffect_ClassID,
kEdge2PtConicalEffect_ClassID,
kEllipseGeometryProcessor_ClassID,
kEllipticalRRectEffect_ClassID,
kFocalInside2PtConicalEffect_ClassID,
kFocalOutside2PtConicalEffect_ClassID,
kGP_ClassID,
kGrAARectEffect_ClassID,
kGrAlphaThresholdFragmentProcessor_ClassID,

View File

@ -255,7 +255,7 @@ protected:
GrGradientEffect(ClassID classID, const CreateArgs&, bool isOpaque);
explicit GrGradientEffect(const GrGradientEffect&); // facilitates clone() implementations
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const final;
// Helper function used by derived class factories to handle color space transformation and
// modulation by input alpha.

File diff suppressed because it is too large Load Diff