Remove GrDirectContext::ComputeImageSize. Use SkImage::textureSize.
Bug: skia:11208
Change-Id: Ie5f56b6d168ab43189be75bb2be60b315e724569
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371958
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index b845bb1..738f1b3 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -6,8 +6,10 @@
Milestone 90
------------
- * GrDirectContext::ComputeImageSize() no longer takes nextPow2 argument.
+ * GrDirectContext::ComputeImageSize() is removed. Use SkImage::textureSize() instead.
https://review.skia.org/368621
+ https://review.skia.org/369317
+ https://review.skia.org/371958
* Remove SkImageFilter::MakeMatrixFilter as it was unused and replaced with
SkImageFilters::MatrixTransform.
diff --git a/include/gpu/GrDirectContext.h b/include/gpu/GrDirectContext.h
index b58ca6a..22e7e71 100644
--- a/include/gpu/GrDirectContext.h
+++ b/include/gpu/GrDirectContext.h
@@ -400,11 +400,6 @@
void storeVkPipelineCacheData();
- // Returns the gpu memory size of the the texture that backs the passed in SkImage. Returns 0 if
- // the SkImage is not texture backed. For external format textures this will also return 0 as we
- // cannot determine the correct size.
- static size_t ComputeImageSize(sk_sp<SkImage> image, GrMipmapped);
-
/**
* Retrieve the default GrBackendFormat for a given SkColorType and renderability.
* It is guaranteed that this backend format will be the one used by the following
diff --git a/src/gpu/GrDirectContext.cpp b/src/gpu/GrDirectContext.cpp
index 87d9afd..3301027 100644
--- a/src/gpu/GrDirectContext.cpp
+++ b/src/gpu/GrDirectContext.cpp
@@ -434,21 +434,6 @@
this->getTextBlobCache()->usedBytes());
}
-size_t GrDirectContext::ComputeImageSize(sk_sp<SkImage> image, GrMipmapped mipmapped) {
- if (!image->isTextureBacked()) {
- return 0;
- }
- SkImage_GpuBase* gpuImage = static_cast<SkImage_GpuBase*>(as_IB(image.get()));
- GrTextureProxy* proxy = gpuImage->peekProxy();
- if (!proxy) {
- return 0;
- }
-
- int colorSamplesPerPixel = 1;
- return GrSurface::ComputeSize(proxy->backendFormat(), image->dimensions(),
- colorSamplesPerPixel, mipmapped);
-}
-
GrBackendTexture GrDirectContext::createBackendTexture(int width, int height,
const GrBackendFormat& backendFormat,
GrMipmapped mipMapped,