From b609e6dc6a02336aed04caaddcdd5ccfbe7ba9ec Mon Sep 17 00:00:00 2001 From: Ruiqi Mao Date: Tue, 17 Jul 2018 10:19:38 -0400 Subject: added byte and ubyte types to SKSL created new GMs for skinning Bug: skia: Change-Id: I15fb2bd02fba8beb6dd2dd3f3716da016ea92192 Reviewed-on: https://skia-review.googlesource.com/140241 Commit-Queue: Ruiqi Mao Reviewed-by: Brian Osman Reviewed-by: Ethan Nicholas --- src/gpu/ops/GrNonAAFillRectOp.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src/gpu/ops/GrNonAAFillRectOp.cpp') diff --git a/src/gpu/ops/GrNonAAFillRectOp.cpp b/src/gpu/ops/GrNonAAFillRectOp.cpp index 1b76d4abfe..c5542328c7 100644 --- a/src/gpu/ops/GrNonAAFillRectOp.cpp +++ b/src/gpu/ops/GrNonAAFillRectOp.cpp @@ -29,13 +29,17 @@ static const int kIndicesPerRect = 6; The vertex attrib order is always pos, color, [local coords]. */ -static sk_sp make_gp() { +static sk_sp make_gp(const GrShaderCaps* shaderCaps) { using namespace GrDefaultGeoProcFactory; - return GrDefaultGeoProcFactory::Make(Color::kPremulGrColorAttribute_Type, Coverage::kSolid_Type, - LocalCoords::kHasExplicit_Type, SkMatrix::I()); + return GrDefaultGeoProcFactory::Make(shaderCaps, + Color::kPremulGrColorAttribute_Type, + Coverage::kSolid_Type, + LocalCoords::kHasExplicit_Type, + SkMatrix::I()); } -static sk_sp make_perspective_gp(const SkMatrix& viewMatrix, +static sk_sp make_perspective_gp(const GrShaderCaps* shaderCaps, + const SkMatrix& viewMatrix, bool hasExplicitLocalCoords, const SkMatrix* localMatrix) { SkASSERT(viewMatrix.hasPerspective() || (localMatrix && localMatrix->hasPerspective())); @@ -50,15 +54,16 @@ static sk_sp make_perspective_gp(const SkMatrix& viewMatrix LocalCoords localCoords(hasExplicitLocalCoords ? LocalCoords::kHasExplicit_Type : LocalCoords::kUsePosition_Type, localMatrix); - return GrDefaultGeoProcFactory::Make(Color::kPremulGrColorAttribute_Type, + return GrDefaultGeoProcFactory::Make(shaderCaps, Color::kPremulGrColorAttribute_Type, Coverage::kSolid_Type, localCoords, viewMatrix); } else if (hasExplicitLocalCoords) { LocalCoords localCoords(LocalCoords::kHasExplicit_Type, localMatrix); - return GrDefaultGeoProcFactory::Make(Color::kPremulGrColorAttribute_Type, + return GrDefaultGeoProcFactory::Make(shaderCaps, Color::kPremulGrColorAttribute_Type, Coverage::kSolid_Type, localCoords, SkMatrix::I()); } else { LocalCoords localCoords(LocalCoords::kUsePosition_Type, localMatrix); - return GrDefaultGeoProcFactory::MakeForDeviceSpace(Color::kPremulGrColorAttribute_Type, + return GrDefaultGeoProcFactory::MakeForDeviceSpace(shaderCaps, + Color::kPremulGrColorAttribute_Type, Coverage::kSolid_Type, localCoords, viewMatrix); } @@ -174,7 +179,7 @@ public: private: void onPrepareDraws(Target* target) override { - sk_sp gp = make_gp(); + sk_sp gp = make_gp(target->caps().shaderCaps()); if (!gp) { SkDebugf("Couldn't create GrGeometryProcessor\n"); return; @@ -304,7 +309,10 @@ public: private: void onPrepareDraws(Target* target) override { sk_sp gp = make_perspective_gp( - fViewMatrix, fHasLocalRect, fHasLocalMatrix ? &fLocalMatrix : nullptr); + target->caps().shaderCaps(), + fViewMatrix, + fHasLocalRect, + fHasLocalMatrix ? &fLocalMatrix : nullptr); if (!gp) { SkDebugf("Couldn't create GrGeometryProcessor\n"); return; -- cgit v1.2.3