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>
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index 6bbb3bd..f90678a 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -97,13 +97,13 @@
/**
* 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 @@
const GrShape& shape,
const SkIRect& resultBounds,
GrAA aa,
- TextureType textureType,
+ SkBackingFit fit,
const SkMatrix* matrix) {
GrSWMaskHelper helper(texProvider);
@@ -150,7 +150,7 @@
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 0669db9..55ed3ff 100644
--- a/src/gpu/GrSWMaskHelper.h
+++ b/src/gpu/GrSWMaskHelper.h
@@ -68,18 +68,13 @@
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 @@
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 cb3f679..d6db0df 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -201,12 +201,11 @@
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;
}