diff options
author | Brian Salomon <bsalomon@google.com> | 2016-10-03 17:15:28 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-03 21:39:33 +0000 |
commit | 2ebd0c80a2a9d90a2c2c653f40a2a7205bd2d31b (patch) | |
tree | 1baafac8edfb1d5d51e9ea53b176b95506e809cd /src/gpu/GrClipStackClip.cpp | |
parent | 2cbcd12281ee807214df094964c584c78932e10b (diff) |
Remove option to make GrCoordTransforms apply to device positions.
Adds a device space texture decal effect to use for clipping.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2870
Change-Id: Ifcc7617ea87f5a86e301995cba9dfc30a4b0e2c5
Reviewed-on: https://skia-review.googlesource.com/2870
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrClipStackClip.cpp')
-rw-r--r-- | src/gpu/GrClipStackClip.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp index d85db1109a..7694a3f403 100644 --- a/src/gpu/GrClipStackClip.cpp +++ b/src/gpu/GrClipStackClip.cpp @@ -79,26 +79,12 @@ void GrClipStackClip::getConservativeBounds(int width, int height, SkIRect* devR } //////////////////////////////////////////////////////////////////////////////// -// set up the draw state to enable the aa clipping mask. Besides setting up the -// stage matrix this also alters the vertex layout +// set up the draw state to enable the aa clipping mask. static sk_sp<GrFragmentProcessor> create_fp_for_mask(GrTexture* result, const SkIRect &devBound) { - SkMatrix mat; - // We use device coords to compute the texture coordinates. We set our matrix to be a - // translation to the devBound, and then a scaling matrix to normalized coords. - mat.setIDiv(result->width(), result->height()); - mat.preTranslate(SkIntToScalar(-devBound.fLeft), - SkIntToScalar(-devBound.fTop)); - SkIRect domainTexels = SkIRect::MakeWH(devBound.width(), devBound.height()); - return sk_sp<GrFragmentProcessor>(GrTextureDomainEffect::Make( - result, - nullptr, - mat, - GrTextureDomain::MakeTexelDomain(result, domainTexels), - GrTextureDomain::kDecal_Mode, - GrTextureParams::kNone_FilterMode, - kDevice_GrCoordSet)); + return GrDeviceSpaceTextureDecalFragmentProcessor::Make(result, domainTexels, + {devBound.fLeft, devBound.fTop}); } // Does the path in 'element' require SW rendering? If so, return true (and, |