diff options
author | 2016-12-14 09:12:13 -0500 | |
---|---|---|
committer | 2016-12-14 15:00:41 +0000 | |
commit | 417b7f4255e01983eb5c2686f39294d39ad60814 (patch) | |
tree | 4ad55967f74791a9749712e23b2464940ba68651 | |
parent | 4a24da5ceccbbd5eb91c75ce680c42191a5342d0 (diff) |
Replace TextureType with SkBackingFit
I believe TextureType is vestigial
Change-Id: I253f3a3200d6e05d5e0204662225f4a8e8ed5cb9
Reviewed-on: https://skia-review.googlesource.com/6029
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
-rw-r--r-- | src/gpu/GrSWMaskHelper.cpp | 8 | ||||
-rw-r--r-- | src/gpu/GrSWMaskHelper.h | 9 | ||||
-rw-r--r-- | src/gpu/GrSoftwarePathRenderer.cpp | 5 |
3 files changed, 8 insertions, 14 deletions
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp index 6bbb3bdd20..f90678a3c2 100644 --- a/src/gpu/GrSWMaskHelper.cpp +++ b/src/gpu/GrSWMaskHelper.cpp @@ -97,13 +97,13 @@ bool GrSWMaskHelper::init(const SkIRect& resultBounds, const SkMatrix* matrix) { /** * Get a texture (from the texture cache) of the correct size & format. */ -GrTexture* GrSWMaskHelper::createTexture(TextureType textureType) { +GrTexture* GrSWMaskHelper::createTexture(SkBackingFit fit) { GrSurfaceDesc desc; desc.fWidth = fPixels.width(); desc.fHeight = fPixels.height(); desc.fConfig = kAlpha_8_GrPixelConfig; - if (TextureType::kApproximateFit == textureType) { + if (SkBackingFit::kApprox == fit) { return fTexProvider->createApproxTexture(desc); } else { return fTexProvider->createTexture(desc, SkBudgeted::kYes); @@ -140,7 +140,7 @@ GrTexture* GrSWMaskHelper::DrawShapeMaskToTexture(GrTextureProvider* texProvider const GrShape& shape, const SkIRect& resultBounds, GrAA aa, - TextureType textureType, + SkBackingFit fit, const SkMatrix* matrix) { GrSWMaskHelper helper(texProvider); @@ -150,7 +150,7 @@ GrTexture* GrSWMaskHelper::DrawShapeMaskToTexture(GrTextureProvider* texProvider helper.drawShape(shape, SkRegion::kReplace_Op, aa, 0xFF); - GrTexture* texture(helper.createTexture(textureType)); + GrTexture* texture(helper.createTexture(fit)); if (!texture) { return nullptr; } diff --git a/src/gpu/GrSWMaskHelper.h b/src/gpu/GrSWMaskHelper.h index 0669db9f1b..55ed3ff2e5 100644 --- a/src/gpu/GrSWMaskHelper.h +++ b/src/gpu/GrSWMaskHelper.h @@ -68,18 +68,13 @@ public: fPixels.erase(SkColorSetARGB(alpha, 0xFF, 0xFF, 0xFF)); } - enum class TextureType { - kExactFit, - kApproximateFit - }; - // Canonical usage utility that draws a single path and uploads it // to the GPU. The result is returned. static GrTexture* DrawShapeMaskToTexture(GrTextureProvider*, const GrShape&, const SkIRect& resultBounds, GrAA, - TextureType, + SkBackingFit, const SkMatrix* matrix); // This utility draws a path mask generated by DrawShapeMaskToTexture using a provided paint. @@ -97,7 +92,7 @@ public: private: // Helper function to get a scratch texture suitable for capturing the // result (i.e., right size & format) - GrTexture* createTexture(TextureType); + GrTexture* createTexture(SkBackingFit); GrTextureProvider* fTexProvider; SkMatrix fMatrix; diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp index cb3f679730..d6db0dfdd2 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -201,12 +201,11 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) { texture.reset(args.fResourceProvider->findAndRefTextureByUniqueKey(maskKey)); } if (!texture) { - GrSWMaskHelper::TextureType type = useCache ? GrSWMaskHelper::TextureType::kExactFit - : GrSWMaskHelper::TextureType::kApproximateFit; + SkBackingFit fit = useCache ? SkBackingFit::kExact : SkBackingFit::kApprox; GrAA aa = GrAAType::kCoverage == args.fAAType ? GrAA::kYes : GrAA::kNo; texture.reset(GrSWMaskHelper::DrawShapeMaskToTexture(fTexProvider, *args.fShape, *boundsForMask, aa, - type, args.fViewMatrix)); + fit, args.fViewMatrix)); if (!texture) { return false; } |