Construct mipmaps for internal YUVA planes
Bug: skia:7901
Change-Id: I4d42ad752b18cc1cfbbb5d41eafc499c0541858b
Reviewed-on: https://skia-review.googlesource.com/c/169242
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/GrImageTextureMaker.cpp b/src/gpu/GrImageTextureMaker.cpp
index 0aae4b6..d324c5a 100644
--- a/src/gpu/GrImageTextureMaker.cpp
+++ b/src/gpu/GrImageTextureMaker.cpp
@@ -98,11 +98,10 @@
filterOrNullForBicubic);
}
- // Check to see if the client has given us pre-mipped textures
+ // Check to see if the client has given us pre-mipped textures or we can generate them
// If not, fall back to bilerp
- // TODO: investigate flattening the image and generating miplevels
GrSamplerState::Filter filter = *filterOrNullForBicubic;
- if (GrSamplerState::Filter::kMipMap == filter && !fImage->canBeMipmapped(fContext)) {
+ if (GrSamplerState::Filter::kMipMap == filter && !fImage->setupMipmapsForPlanes()) {
filter = GrSamplerState::Filter::kBilerp;
}
@@ -110,4 +109,3 @@
fImage->fYUVColorSpace, filter);
}
-