aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSWMaskHelper.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-08-17 16:14:25 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-17 20:33:31 +0000
commitc7da1468e3de821d9be6f086086ea956bb30dbb2 (patch)
tree17a0cdd99d2c97112fe338f671858a0444bdd328 /src/gpu/GrSWMaskHelper.cpp
parent7ca9a74fef3296cdf1385785b5e817e963bb4c35 (diff)
Move DrawToTargetWithShapeMask to GrSoftwarePathRenderer
That function has nothing to do with software masks - I claim it was only in GrSWMaskHelper because it was used by the software path renderer. Also trimmed some includes. Bug: skia: Change-Id: I6939010c70309cdc4135cb250afe85ad7b7be451 Reviewed-on: https://skia-review.googlesource.com/35821 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrSWMaskHelper.cpp')
-rw-r--r--src/gpu/GrSWMaskHelper.cpp34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index 5d247fa2b7..eb3986525e 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -6,16 +6,12 @@
*/
#include "GrSWMaskHelper.h"
-#include "GrCaps.h"
#include "GrContext.h"
#include "GrContextPriv.h"
-#include "GrRenderTargetContext.h"
#include "GrShape.h"
#include "GrSurfaceContext.h"
#include "GrTextureProxy.h"
#include "SkDistanceFieldGen.h"
-#include "ops/GrDrawOp.h"
-#include "ops/GrRectOpFactory.h"
/*
* Convert a boolean operation into a transfer mode code
@@ -145,33 +141,3 @@ sk_sp<GrTextureProxy> GrSWMaskHelper::DrawShapeMaskToTexture(GrContext* context,
return helper.toTextureProxy(context, fit);
}
-
-void GrSWMaskHelper::DrawToTargetWithShapeMask(sk_sp<GrTextureProxy> proxy,
- GrRenderTargetContext* renderTargetContext,
- GrPaint&& paint,
- const GrUserStencilSettings& userStencilSettings,
- const GrClip& clip,
- const SkMatrix& viewMatrix,
- const SkIPoint& textureOriginInDeviceSpace,
- const SkIRect& deviceSpaceRectToDraw) {
- SkMatrix invert;
- if (!viewMatrix.invert(&invert)) {
- return;
- }
-
- SkRect dstRect = SkRect::Make(deviceSpaceRectToDraw);
-
- // We use device coords to compute the texture coordinates. We take the device coords and apply
- // a translation so that the top-left of the device bounds maps to 0,0, and then a scaling
- // matrix to normalized coords.
- SkMatrix maskMatrix = SkMatrix::MakeTrans(SkIntToScalar(-textureOriginInDeviceSpace.fX),
- SkIntToScalar(-textureOriginInDeviceSpace.fY));
- maskMatrix.preConcat(viewMatrix);
- paint.addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(
- std::move(proxy), nullptr, maskMatrix,
- GrSamplerParams::kNone_FilterMode));
- renderTargetContext->addDrawOp(clip,
- GrRectOpFactory::MakeNonAAFillWithLocalMatrix(
- std::move(paint), SkMatrix::I(), invert, dstRect,
- GrAAType::kNone, &userStencilSettings));
-}