Remove create function in proxyProvider that takes a raster SkImage.
Instead in proxyProvider we just have a create a bitmap call which
does no special fallback or logic. All the callers now go through
GrBitmapTextureMaker which handles and special fallbacks or caching
support that we need.
Change-Id: I71bb896cc78f64f9d6d54b54af2490d48e0f5af5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266842
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrBitmapTextureMaker.cpp b/src/gpu/GrBitmapTextureMaker.cpp
index 129f06e..a896ff6 100644
--- a/src/gpu/GrBitmapTextureMaker.cpp
+++ b/src/gpu/GrBitmapTextureMaker.cpp
@@ -27,10 +27,11 @@
}
GrBitmapTextureMaker::GrBitmapTextureMaker(GrRecordingContext* context, const SkBitmap& bitmap,
- bool useDecal, bool shouldUseUniqueKey)
+ Cached cached, SkBackingFit fit, bool useDecal)
: INHERITED(context, get_image_info(context, bitmap), useDecal)
- , fBitmap(bitmap) {
- if (!bitmap.isVolatile() && shouldUseUniqueKey) {
+ , fBitmap(bitmap)
+ , fFit(fit) {
+ if (!bitmap.isVolatile() && cached == Cached::kYes) {
SkIPoint origin = bitmap.pixelRefOrigin();
SkIRect subset = SkIRect::MakeXYWH(origin.fX, origin.fY, bitmap.width(),
bitmap.height());
@@ -65,11 +66,11 @@
return nullptr;
}
copy8888.setImmutable();
- proxy = proxyProvider->createProxyFromBitmap(copy8888, willBeMipped ? GrMipMapped::kYes
- : GrMipMapped::kNo);
+ proxy = proxyProvider->createProxyFromBitmap(
+ copy8888, willBeMipped ? GrMipMapped::kYes : GrMipMapped::kNo, fFit);
} else {
- proxy = proxyProvider->createProxyFromBitmap(fBitmap, willBeMipped ? GrMipMapped::kYes
- : GrMipMapped::kNo);
+ proxy = proxyProvider->createProxyFromBitmap(
+ fBitmap, willBeMipped ? GrMipMapped::kYes : GrMipMapped::kNo, fFit);
}
if (proxy) {
if (fOriginalKey.isValid()) {