Move bytesPerPixel query off of GrCaps and add bytesPerBlock query.

Part of this change is to move some of this static format information
off of GrCaps since it is not cap dependent in anyway. This allows us
to the need for caps in many places. Also changes the low level format
query to be based off of bytes per block so it can be shared for
compressed and non compressed formats.

This change will also make it easier to add stencil/depth formats in
follow on change since we don't have to fill in a whole caps
FormatInfo block just so we can get the bytesPerPixel which is all
they need.

Bug: skia:10727
Change-Id: I2e6fdabf3ed699b4145ef9e6f0a73078d32a0444
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321463
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index a2a3219..4f94d8e 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -339,7 +339,7 @@
     SkColorType colorType() const override { return GrColorTypeToSkColorType(fColorType); }
 
     size_t getSize() const override {
-        return fView.proxy()->gpuMemorySize(*fContext->priv().caps());
+        return fView.proxy()->gpuMemorySize();
     }
 
     void onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) const override {
diff --git a/src/gpu/GrBackendUtils.cpp b/src/gpu/GrBackendUtils.cpp
new file mode 100644
index 0000000..b50e574
--- /dev/null
+++ b/src/gpu/GrBackendUtils.cpp
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "src/gpu/GrBackendUtils.h"
+
+#include "src/gpu/GrDataUtils.h"
+
+#ifdef SK_GL
+#include "src/gpu/gl/GrGLUtil.h"
+#endif
+
+#ifdef SK_VULKAN
+#include "src/gpu/vk/GrVkUtil.h"
+#endif
+
+#ifdef SK_DIRECT3D
+#include "src/gpu/d3d/GrD3DUtil.h"
+#endif
+
+#ifdef SK_METAL
+#include "src/gpu/mtl/GrMtlCppUtil.h"
+#endif
+
+#ifdef SK_DAWN
+#include "src/gpu/dawn/GrDawnUtil.h"
+#endif
+
+SkImage::CompressionType GrBackendFormatToCompressionType(const GrBackendFormat& format) {
+    switch (format.backend()) {
+        case GrBackendApi::kOpenGL: {
+#ifdef SK_GL
+            GrGLFormat glFormat = format.asGLFormat();
+            switch (glFormat) {
+                case GrGLFormat::kCOMPRESSED_ETC1_RGB8:
+                case GrGLFormat::kCOMPRESSED_RGB8_ETC2:
+                    return SkImage::CompressionType::kETC2_RGB8_UNORM;
+                case GrGLFormat::kCOMPRESSED_RGB8_BC1:
+                    return SkImage::CompressionType::kBC1_RGB8_UNORM;
+                case GrGLFormat::kCOMPRESSED_RGBA8_BC1:
+                    return SkImage::CompressionType::kBC1_RGBA8_UNORM;
+                default:
+                    return SkImage::CompressionType::kNone;
+            }
+#endif
+            break;
+        }
+        case GrBackendApi::kVulkan: {
+#ifdef SK_VULKAN
+            VkFormat vkFormat;
+            SkAssertResult(format.asVkFormat(&vkFormat));
+            switch (vkFormat) {
+                case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
+                    return SkImage::CompressionType::kETC2_RGB8_UNORM;
+                case VK_FORMAT_BC1_RGB_UNORM_BLOCK:
+                    return SkImage::CompressionType::kBC1_RGB8_UNORM;
+                case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
+                    return SkImage::CompressionType::kBC1_RGBA8_UNORM;
+                default:
+                    return SkImage::CompressionType::kNone;
+            }
+#endif
+            break;
+        }
+        case GrBackendApi::kMetal: {
+#ifdef SK_METAL
+            return GrMtlBackendFormatToCompressionType(format);
+#endif
+            break;
+        }
+        case GrBackendApi::kDirect3D: {
+#ifdef SK_DIRECT3D
+            DXGI_FORMAT dxgiFormat;
+            SkAssertResult(format.asDxgiFormat(&dxgiFormat));
+            switch (dxgiFormat) {
+                case DXGI_FORMAT_BC1_UNORM:
+                    return SkImage::CompressionType::kBC1_RGBA8_UNORM;
+                default:
+                    return SkImage::CompressionType::kNone;
+            }
+#endif
+            break;
+        }
+        case GrBackendApi::kDawn: {
+            return SkImage::CompressionType::kNone;
+        }
+        case GrBackendApi::kMock: {
+            return format.asMockCompressionType();
+        }
+    }
+    return SkImage::CompressionType::kNone;
+}
+
+size_t GrBackendFormatBytesPerBlock(const GrBackendFormat& format) {
+    switch (format.backend()) {
+        case GrBackendApi::kOpenGL: {
+#ifdef SK_GL
+            GrGLFormat glFormat = format.asGLFormat();
+            return GrGLFormatBytesPerBlock(glFormat);
+#endif
+            break;
+        }
+        case GrBackendApi::kVulkan: {
+#ifdef SK_VULKAN
+            VkFormat vkFormat;
+            SkAssertResult(format.asVkFormat(&vkFormat));
+            return GrVkFormatBytesPerBlock(vkFormat);
+#endif
+            break;
+        }
+        case GrBackendApi::kMetal: {
+#ifdef SK_METAL
+            return GrMtlBackendFormatBytesPerBlock(format);
+#endif
+            break;
+        }
+        case GrBackendApi::kDirect3D: {
+#ifdef SK_DIRECT3D
+            DXGI_FORMAT dxgiFormat;
+            SkAssertResult(format.asDxgiFormat(&dxgiFormat));
+            return GrDxgiFormatBytesPerBlock(dxgiFormat);
+#endif
+            break;
+        }
+        case GrBackendApi::kDawn: {
+#ifdef SK_DAWN
+            wgpu::TextureFormat dawnFormat;
+            SkAssertResult(format.asDawnFormat(&dawnFormat));
+            return GrDawnBytesPerBlock(dawnFormat);
+#endif
+            break;
+        }
+        case GrBackendApi::kMock: {
+            SkImage::CompressionType compression = format.asMockCompressionType();
+            if (compression != SkImage::CompressionType::kNone) {
+                return GrCompressedRowBytes(compression, 1);
+            }
+            return GrColorTypeBytesPerPixel(format.asMockColorType());
+        }
+    }
+    return 0;
+}
+
+size_t GrBackendFormatBytesPerPixel(const GrBackendFormat& format) {
+    if (GrBackendFormatToCompressionType(format) != SkImage::CompressionType::kNone) {
+        return 0;
+    }
+    return GrBackendFormatBytesPerBlock(format);
+}
diff --git a/src/gpu/GrBackendUtils.h b/src/gpu/GrBackendUtils.h
index cfbcb0e..48cbd16 100644
--- a/src/gpu/GrBackendUtils.h
+++ b/src/gpu/GrBackendUtils.h
@@ -12,74 +12,13 @@
 
 #include "include/gpu/GrBackendSurface.h"
 
-#ifdef SK_METAL
-#include "src/gpu/mtl/GrMtlCppUtil.h"
-#endif
+SkImage::CompressionType GrBackendFormatToCompressionType(const GrBackendFormat& format);
 
-static SkImage::CompressionType GrBackendFormatToCompressionType(const GrBackendFormat& format) {
-    switch (format.backend()) {
-        case GrBackendApi::kOpenGL: {
-#ifdef SK_GL
-            GrGLFormat glFormat = format.asGLFormat();
-            switch (glFormat) {
-                case GrGLFormat::kCOMPRESSED_ETC1_RGB8:
-                case GrGLFormat::kCOMPRESSED_RGB8_ETC2:
-                    return SkImage::CompressionType::kETC2_RGB8_UNORM;
-                case GrGLFormat::kCOMPRESSED_RGB8_BC1:
-                    return SkImage::CompressionType::kBC1_RGB8_UNORM;
-                case GrGLFormat::kCOMPRESSED_RGBA8_BC1:
-                    return SkImage::CompressionType::kBC1_RGBA8_UNORM;
-                default:
-                    return SkImage::CompressionType::kNone;
-            }
-#endif
-            break;
-        }
-        case GrBackendApi::kVulkan: {
-#ifdef SK_VULKAN
-            VkFormat vkFormat;
-            SkAssertResult(format.asVkFormat(&vkFormat));
-            switch (vkFormat) {
-                case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
-                    return SkImage::CompressionType::kETC2_RGB8_UNORM;
-                case VK_FORMAT_BC1_RGB_UNORM_BLOCK:
-                    return SkImage::CompressionType::kBC1_RGB8_UNORM;
-                case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
-                    return SkImage::CompressionType::kBC1_RGBA8_UNORM;
-                default:
-                    return SkImage::CompressionType::kNone;
-            }
-#endif
-            break;
-        }
-        case GrBackendApi::kMetal: {
-#ifdef SK_METAL
-            return GrMtlBackendFormatToCompressionType(format);
-#endif
-            break;
-        }
-        case GrBackendApi::kDirect3D: {
-#ifdef SK_DIRECT3D
-            DXGI_FORMAT dxgiFormat;
-            SkAssertResult(format.asDxgiFormat(&dxgiFormat));
-            switch (dxgiFormat) {
-                case DXGI_FORMAT_BC1_UNORM:
-                    return SkImage::CompressionType::kBC1_RGBA8_UNORM;
-                default:
-                    return SkImage::CompressionType::kNone;
-            }
-#endif
-            break;
-        }
-        case GrBackendApi::kDawn: {
-            return SkImage::CompressionType::kNone;
-        }
-        case GrBackendApi::kMock: {
-            return format.asMockCompressionType();
-        }
-    }
-    return SkImage::CompressionType::kNone;
-}
+// Returns the number of bytes per texel block for the given format. All non compressed formats
+// are treated as having a block size of 1x1, so this is equivalent to bytesPerPixel.
+size_t GrBackendFormatBytesPerBlock(const GrBackendFormat& format);
+
+// Returns the number of bytes per pixel for the given format. All compressed formats will return 0.
+size_t GrBackendFormatBytesPerPixel(const GrBackendFormat& format);
 
 #endif
-
diff --git a/src/gpu/GrCaps.h b/src/gpu/GrCaps.h
index 2a8d2b4..230a8f7 100644
--- a/src/gpu/GrCaps.h
+++ b/src/gpu/GrCaps.h
@@ -235,10 +235,6 @@
     // For historical reasons requestedCount==0 is handled identically to requestedCount==1.
     virtual int getRenderTargetSampleCount(int requestedCount, const GrBackendFormat&) const = 0;
 
-    // Returns the number of bytes per pixel for the given GrBackendFormat. This is only supported
-    // for "normal" formats. For compressed formats this will return 0.
-    virtual size_t bytesPerPixel(const GrBackendFormat&) const = 0;
-
     /**
      * Backends may have restrictions on what types of surfaces support GrGpu::writePixels().
      * If this returns false then the caller should implement a fallback where a temporary texture
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 96edd6f..f0b07e6 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -268,9 +268,8 @@
         return 0;
     }
 
-    const GrCaps& caps = *gpuImage->context()->priv().caps();
     int colorSamplesPerPixel = 1;
-    return GrSurface::ComputeSize(caps, proxy->backendFormat(), image->dimensions(),
+    return GrSurface::ComputeSize(proxy->backendFormat(), image->dimensions(),
                                   colorSamplesPerPixel, mipMapped, useNextPow2);
 }
 
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index d55d7ea..615f7e3 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -10,6 +10,7 @@
 #include <memory>
 
 #include "src/core/SkOpts.h"
+#include "src/gpu/GrBackendUtils.h"
 #include "src/gpu/GrOnFlushResourceProvider.h"
 #include "src/gpu/GrOpFlushState.h"
 #include "src/gpu/GrProxyProvider.h"
@@ -260,9 +261,8 @@
     return true;
 }
 
-bool GrDrawOpAtlas::uploadToPage(const GrCaps& caps, unsigned int pageIdx,
-                                 GrDeferredUploadTarget* target, int width, int height,
-                                 const void* image, AtlasLocator* atlasLocator) {
+bool GrDrawOpAtlas::uploadToPage(unsigned int pageIdx, GrDeferredUploadTarget* target, int width,
+                                 int height, const void* image, AtlasLocator* atlasLocator) {
     SkASSERT(fViews[pageIdx].proxy() && fViews[pageIdx].proxy()->isInstantiated());
 
     // look through all allocated plots for one we can share, in Most Recently Refed order
@@ -270,7 +270,8 @@
     plotIter.init(fPages[pageIdx].fPlotList, PlotList::Iter::kHead_IterStart);
 
     for (Plot* plot = plotIter.get(); plot; plot = plotIter.next()) {
-        SkASSERT(caps.bytesPerPixel(fViews[pageIdx].proxy()->backendFormat()) == plot->bpp());
+        SkASSERT(GrBackendFormatBytesPerPixel(fViews[pageIdx].proxy()->backendFormat()) ==
+                 plot->bpp());
 
         if (plot->addSubImage(width, height, image, atlasLocator)) {
             return this->updatePlot(target, atlasLocator, plot);
@@ -297,13 +298,11 @@
         return ErrorCode::kError;
     }
 
-    const GrCaps& caps = *resourceProvider->caps();
-
     // Look through each page to see if we can upload without having to flush
     // We prioritize this upload to the first pages, not the most recently used, to make it easier
     // to remove unused pages in reverse page order.
     for (unsigned int pageIdx = 0; pageIdx < fNumActivePages; ++pageIdx) {
-        if (this->uploadToPage(caps, pageIdx, target, width, height, image, atlasLocator)) {
+        if (this->uploadToPage(pageIdx, target, width, height, image, atlasLocator)) {
             return ErrorCode::kSucceeded;
         }
     }
@@ -319,7 +318,7 @@
             SkASSERT(plot);
             if (plot->lastUseToken() < target->tokenTracker()->nextTokenToFlush()) {
                 this->processEvictionAndResetRects(plot);
-                SkASSERT(caps.bytesPerPixel(fViews[pageIdx].proxy()->backendFormat()) ==
+                SkASSERT(GrBackendFormatBytesPerPixel(fViews[pageIdx].proxy()->backendFormat()) ==
                          plot->bpp());
                 SkDEBUGCODE(bool verify = )plot->addSubImage(width, height, image, atlasLocator);
                 SkASSERT(verify);
@@ -335,8 +334,7 @@
             return ErrorCode::kError;
         }
 
-        if (this->uploadToPage(caps, fNumActivePages-1, target, width, height, image,
-                               atlasLocator)) {
+        if (this->uploadToPage(fNumActivePages-1, target, width, height, image, atlasLocator)) {
             return ErrorCode::kSucceeded;
         } else {
             // If we fail to upload to a newly activated page then something has gone terribly
@@ -376,7 +374,8 @@
     newPlot.reset(plot->clone());
 
     fPages[pageIdx].fPlotList.addToHead(newPlot.get());
-    SkASSERT(caps.bytesPerPixel(fViews[pageIdx].proxy()->backendFormat()) == newPlot->bpp());
+    SkASSERT(GrBackendFormatBytesPerPixel(fViews[pageIdx].proxy()->backendFormat()) ==
+             newPlot->bpp());
     SkDEBUGCODE(bool verify = )newPlot->addSubImage(width, height, image, atlasLocator);
     SkASSERT(verify);
 
diff --git a/src/gpu/GrDrawOpAtlas.h b/src/gpu/GrDrawOpAtlas.h
index 6756cfa..9552bd0 100644
--- a/src/gpu/GrDrawOpAtlas.h
+++ b/src/gpu/GrDrawOpAtlas.h
@@ -477,8 +477,8 @@
         // the front and remove from the back there is no need for MRU.
     }
 
-    bool uploadToPage(const GrCaps&, unsigned int pageIdx, GrDeferredUploadTarget*,
-                      int width, int height, const void* image, AtlasLocator*);
+    bool uploadToPage(unsigned int pageIdx, GrDeferredUploadTarget*, int width, int height,
+                      const void* image, AtlasLocator*);
 
     bool createPages(GrProxyProvider*, GenerationCounter*);
     bool activateNewPage(GrResourceProvider*);
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp
index 5ccd18e..96b57b4 100644
--- a/src/gpu/GrRenderTargetProxy.cpp
+++ b/src/gpu/GrRenderTargetProxy.cpp
@@ -109,7 +109,7 @@
     return surface;
 }
 
-size_t GrRenderTargetProxy::onUninstantiatedGpuMemorySize(const GrCaps& caps) const {
+size_t GrRenderTargetProxy::onUninstantiatedGpuMemorySize() const {
     int colorSamplesPerPixel = this->numSamples();
     if (colorSamplesPerPixel > 1) {
         // Add one for the resolve buffer.
@@ -117,7 +117,7 @@
     }
 
     // TODO: do we have enough information to improve this worst case estimate?
-    return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+    return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                   colorSamplesPerPixel, GrMipmapped::kNo, !this->priv().isExact());
 }
 
diff --git a/src/gpu/GrRenderTargetProxy.h b/src/gpu/GrRenderTargetProxy.h
index 035efed..9f4f0ca 100644
--- a/src/gpu/GrRenderTargetProxy.h
+++ b/src/gpu/GrRenderTargetProxy.h
@@ -135,7 +135,7 @@
 private:
     bool canChangeStencilAttachment() const;
 
-    size_t onUninstantiatedGpuMemorySize(const GrCaps&) const override;
+    size_t onUninstantiatedGpuMemorySize() const override;
     SkDEBUGCODE(void onValidateSurface(const GrSurface*) override;)
 
             LazySurfaceDesc callbackDesc() const override;
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index 05d5f3d..6a8bd32 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -15,8 +15,7 @@
 #include "src/core/SkMathPriv.h"
 #include "src/gpu/SkGr.h"
 
-size_t GrSurface::ComputeSize(const GrCaps& caps,
-                              const GrBackendFormat& format,
+size_t GrSurface::ComputeSize(const GrBackendFormat& format,
                               SkISize dimensions,
                               int colorSamplesPerPixel,
                               GrMipmapped mipMapped,
@@ -38,7 +37,8 @@
         colorSize = SkCompressedFormatDataSize(compressionType, dimensions,
                                                mipMapped == GrMipmapped::kYes);
     } else {
-        colorSize = (size_t)dimensions.width() * dimensions.height() * caps.bytesPerPixel(format);
+        colorSize = (size_t)dimensions.width() * dimensions.height() *
+                    GrBackendFormatBytesPerPixel(format);
     }
     SkASSERT(colorSize > 0);
 
diff --git a/src/gpu/GrSurface.h b/src/gpu/GrSurface.h
index da27fe7..4e6b6da 100644
--- a/src/gpu/GrSurface.h
+++ b/src/gpu/GrSurface.h
@@ -69,8 +69,8 @@
 
     GrInternalSurfaceFlags flags() const { return fSurfaceFlags; }
 
-    static size_t ComputeSize(const GrCaps&, const GrBackendFormat&, SkISize dimensions,
-                              int colorSamplesPerPixel, GrMipmapped, bool binSize = false);
+    static size_t ComputeSize(const GrBackendFormat&, SkISize dimensions, int colorSamplesPerPixel,
+                              GrMipmapped, bool binSize = false);
 
     /**
      * The pixel values of this surface cannot be modified (e.g. doesn't support write pixels or
diff --git a/src/gpu/GrSurfaceProxy.h b/src/gpu/GrSurfaceProxy.h
index 8fe1cdc..9a73ccc 100644
--- a/src/gpu/GrSurfaceProxy.h
+++ b/src/gpu/GrSurfaceProxy.h
@@ -274,13 +274,13 @@
      *
      * @return the amount of GPU memory used in bytes
      */
-    size_t gpuMemorySize(const GrCaps& caps) const {
+    size_t gpuMemorySize() const {
         SkASSERT(!this->isFullyLazy());
         if (fTarget) {
             return fTarget->gpuMemorySize();
         }
         if (kInvalidGpuMemorySize == fGpuMemorySize) {
-            fGpuMemorySize = this->onUninstantiatedGpuMemorySize(caps);
+            fGpuMemorySize = this->onUninstantiatedGpuMemorySize();
             SkASSERT(kInvalidGpuMemorySize != fGpuMemorySize);
         }
         return fGpuMemorySize;
@@ -418,7 +418,7 @@
     static const size_t kInvalidGpuMemorySize = ~static_cast<size_t>(0);
     SkDEBUGCODE(size_t getRawGpuMemorySize_debugOnly() const { return fGpuMemorySize; })
 
-    virtual size_t onUninstantiatedGpuMemorySize(const GrCaps&) const = 0;
+    virtual size_t onUninstantiatedGpuMemorySize() const = 0;
 
     virtual LazySurfaceDesc callbackDesc() const = 0;
 
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index 1aa7d8c..e944846 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -32,9 +32,8 @@
 }
 
 size_t GrTexture::onGpuMemorySize() const {
-    const GrCaps& caps = *this->getGpu()->caps();
-    return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(), 1,
-                                  this->mipmapped());
+    return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
+                                  /*colorSamplesPerPixel=*/1, this->mipmapped());
 }
 
 /////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/GrTextureProxy.cpp b/src/gpu/GrTextureProxy.cpp
index 6c1a0f0..6bd4761 100644
--- a/src/gpu/GrTextureProxy.cpp
+++ b/src/gpu/GrTextureProxy.cpp
@@ -142,9 +142,10 @@
     return fMipmapped;
 }
 
-size_t GrTextureProxy::onUninstantiatedGpuMemorySize(const GrCaps& caps) const {
-    return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(), 1,
-                                  this->proxyMipmapped(), !this->priv().isExact());
+size_t GrTextureProxy::onUninstantiatedGpuMemorySize() const {
+    return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
+                                  /*colorSamplesPerPixel=*/1, this->proxyMipmapped(),
+                                  !this->priv().isExact());
 }
 
 bool GrTextureProxy::ProxiesAreCompatibleAsDynamicState(const GrSurfaceProxy* first,
diff --git a/src/gpu/GrTextureProxy.h b/src/gpu/GrTextureProxy.h
index f9be98a..3839e52 100644
--- a/src/gpu/GrTextureProxy.h
+++ b/src/gpu/GrTextureProxy.h
@@ -194,7 +194,7 @@
     // point, the proxy is instantiated, and this data is used to perform an ASAP upload.
     std::unique_ptr<GrDeferredProxyUploader> fDeferredUploader;
 
-    size_t onUninstantiatedGpuMemorySize(const GrCaps&) const override;
+    size_t onUninstantiatedGpuMemorySize() const override;
 
     // Methods made available via GrTextureProxy::CacheAccess
     void setUniqueKey(GrProxyProvider*, const GrUniqueKey&);
diff --git a/src/gpu/GrTextureRenderTargetProxy.cpp b/src/gpu/GrTextureRenderTargetProxy.cpp
index dd9348d..be57b55 100644
--- a/src/gpu/GrTextureRenderTargetProxy.cpp
+++ b/src/gpu/GrTextureRenderTargetProxy.cpp
@@ -102,7 +102,7 @@
     }
 }
 
-size_t GrTextureRenderTargetProxy::onUninstantiatedGpuMemorySize(const GrCaps& caps) const {
+size_t GrTextureRenderTargetProxy::onUninstantiatedGpuMemorySize() const {
     int colorSamplesPerPixel = this->numSamples();
     if (colorSamplesPerPixel > 1) {
         // Add one to account for the resolve buffer.
@@ -110,7 +110,7 @@
     }
 
     // TODO: do we have enough information to improve this worst case estimate?
-    return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+    return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                   colorSamplesPerPixel, this->proxyMipmapped(),
                                   !this->priv().isExact());
 }
diff --git a/src/gpu/GrTextureRenderTargetProxy.h b/src/gpu/GrTextureRenderTargetProxy.h
index 4548261..6cefe82 100644
--- a/src/gpu/GrTextureRenderTargetProxy.h
+++ b/src/gpu/GrTextureRenderTargetProxy.h
@@ -66,7 +66,7 @@
     bool instantiate(GrResourceProvider*) override;
     sk_sp<GrSurface> createSurface(GrResourceProvider*) const override;
 
-    size_t onUninstantiatedGpuMemorySize(const GrCaps&) const override;
+    size_t onUninstantiatedGpuMemorySize() const override;
     LazySurfaceDesc callbackDesc() const override;
     SkDEBUGCODE(void onValidateSurface(const GrSurface*) override;)
 };
diff --git a/src/gpu/d3d/GrD3DCaps.cpp b/src/gpu/d3d/GrD3DCaps.cpp
index 066c60a..15bb11b 100644
--- a/src/gpu/d3d/GrD3DCaps.cpp
+++ b/src/gpu/d3d/GrD3DCaps.cpp
@@ -363,7 +363,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_R8G8B8A8_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 4;
         info.fFormatColorType = GrColorType::kRGBA_8888;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 2;
@@ -392,7 +391,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_R8_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 1;
         info.fFormatColorType = GrColorType::kR_8;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 2;
@@ -422,7 +420,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_B8G8R8A8_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 4;
         info.fFormatColorType = GrColorType::kBGRA_8888;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
@@ -442,7 +439,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_B5G6R5_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 2;
         info.fFormatColorType = GrColorType::kBGR_565;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
@@ -462,7 +458,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_R16G16B16A16_FLOAT;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 8;
         info.fFormatColorType = GrColorType::kRGBA_F16;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 2;
@@ -489,7 +484,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_R16_FLOAT;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 2;
         info.fFormatColorType = GrColorType::kR_F16;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
@@ -511,7 +505,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_R8G8_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 2;
         info.fFormatColorType = GrColorType::kRG_88;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
@@ -531,7 +524,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_R10G10B10A2_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 4;
         info.fFormatColorType = GrColorType::kRGBA_1010102;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
@@ -551,7 +543,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_B4G4R4A4_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 2;
         info.fFormatColorType = GrColorType::kBGRA_4444;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
@@ -573,7 +564,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 4;
         info.fFormatColorType = GrColorType::kRGBA_8888_SRGB;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
@@ -593,7 +583,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_R16_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 2;
         info.fFormatColorType = GrColorType::kR_16;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
@@ -615,7 +604,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_R16G16_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 4;
         info.fFormatColorType = GrColorType::kRG_1616;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
@@ -635,7 +623,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_R16G16B16A16_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 8;
         info.fFormatColorType = GrColorType::kRGBA_16161616;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
@@ -655,7 +642,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_R16G16_FLOAT;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 4;
         info.fFormatColorType = GrColorType::kRG_F16;
         if (SkToBool(info.fFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
@@ -676,7 +662,6 @@
         constexpr DXGI_FORMAT format = DXGI_FORMAT_BC1_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(adapterDesc, device, format);
-        info.fBytesPerPixel = 0;
         // No supported GrColorTypes.
     }
 
@@ -888,18 +873,6 @@
     return table[table.count() - 1];
 }
 
-size_t GrD3DCaps::bytesPerPixel(const GrBackendFormat& format) const {
-    DXGI_FORMAT dxgiFormat;
-    if (!format.asDxgiFormat(&dxgiFormat)) {
-        return 0;
-    }
-    return this->bytesPerPixel(dxgiFormat);
-}
-
-size_t GrD3DCaps::bytesPerPixel(DXGI_FORMAT format) const {
-    return this->getFormatInfo(format).fBytesPerPixel;
-}
-
 GrColorType GrD3DCaps::getFormatColorType(DXGI_FORMAT format) const {
     const FormatInfo& info = this->getFormatInfo(format);
     return info.fFormatColorType;
@@ -915,7 +888,7 @@
 
     // TODO: this seems to be pretty constrictive, confirm
     // Any buffer data needs to be aligned to 512 bytes and that of a single texel.
-    size_t offsetAlignment = GrAlignTo(this->bytesPerPixel(dxgiFormat),
+    size_t offsetAlignment = GrAlignTo(GrDxgiFormatBytesPerBlock(dxgiFormat),
                                        D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT);
 
     const auto& info = this->getFormatInfo(dxgiFormat);
diff --git a/src/gpu/d3d/GrD3DCaps.h b/src/gpu/d3d/GrD3DCaps.h
index a6d45e1..1d16cb5 100644
--- a/src/gpu/d3d/GrD3DCaps.h
+++ b/src/gpu/d3d/GrD3DCaps.h
@@ -46,9 +46,6 @@
     int maxRenderTargetSampleCount(const GrBackendFormat&) const override;
     int maxRenderTargetSampleCount(DXGI_FORMAT) const;
 
-    size_t bytesPerPixel(const GrBackendFormat&) const override;
-    size_t bytesPerPixel(DXGI_FORMAT) const;
-
     GrColorType getFormatColorType(DXGI_FORMAT) const;
 
     SupportedWrite supportedWritePixelsColorType(GrColorType surfaceColorType,
@@ -183,8 +180,6 @@
         uint16_t fFlags = 0;
 
         SkTDArray<int> fColorSampleCounts;
-        // This value is only valid for regular formats. Compressed formats will be 0.
-        size_t fBytesPerPixel = 0;
 
         // This GrColorType represents how the actually GPU format lays out its memory. This is used
         // for uploading data to backend textures to make sure we've arranged the memory in the
diff --git a/src/gpu/d3d/GrD3DGpu.cpp b/src/gpu/d3d/GrD3DGpu.cpp
index c99a3ce..ba3b988 100644
--- a/src/gpu/d3d/GrD3DGpu.cpp
+++ b/src/gpu/d3d/GrD3DGpu.cpp
@@ -634,7 +634,7 @@
                                    nullptr, nullptr, &transferTotalBytes);
     SkASSERT(transferTotalBytes);
     size_t bpp = GrColorTypeBytesPerPixel(dstColorType);
-    if (this->d3dCaps().bytesPerPixel(texResource->dxgiFormat()) != bpp) {
+    if (GrDxgiFormatBytesPerBlock(texResource->dxgiFormat()) != bpp) {
         return false;
     }
     size_t tightRowBytes = bpp * width;
@@ -1090,14 +1090,14 @@
     return GrBackendTexture(dimensions.width(), dimensions.height(), info);
 }
 
-static void copy_src_data(GrD3DGpu* gpu, char* mapPtr, DXGI_FORMAT dxgiFormat,
+static void copy_src_data(char* mapPtr, DXGI_FORMAT dxgiFormat,
                           D3D12_PLACED_SUBRESOURCE_FOOTPRINT* placedFootprints,
                           const SkPixmap srcData[], int numMipLevels) {
     SkASSERT(srcData && numMipLevels);
     SkASSERT(!GrDxgiFormatIsCompressed(dxgiFormat));
     SkASSERT(mapPtr);
 
-    size_t bytesPerPixel = gpu->d3dCaps().bytesPerPixel(dxgiFormat);
+    size_t bytesPerPixel = GrDxgiFormatBytesPerBlock(dxgiFormat);
 
     for (int currentMipLevel = 0; currentMipLevel < numMipLevels; currentMipLevel++) {
         const size_t trimRowBytes = srcData[currentMipLevel].width() * bytesPerPixel;
@@ -1186,7 +1186,7 @@
     SkASSERT(bufferData);
 
     if (data->type() == BackendTextureData::Type::kPixmaps) {
-        copy_src_data(this, bufferData, info.fFormat, placedFootprints.get(), data->pixmaps(),
+        copy_src_data(bufferData, info.fFormat, placedFootprints.get(), data->pixmaps(),
                       info.fLevelCount);
     } else if (data->type() == BackendTextureData::Type::kCompressed) {
         copy_compressed_data(bufferData, info.fFormat, placedFootprints.get(), numRows.get(),
diff --git a/src/gpu/d3d/GrD3DRenderTarget.h b/src/gpu/d3d/GrD3DRenderTarget.h
index 26e239a..596ea7e 100644
--- a/src/gpu/d3d/GrD3DRenderTarget.h
+++ b/src/gpu/d3d/GrD3DRenderTarget.h
@@ -75,8 +75,7 @@
             // Add one to account for the resolved VkImage.
             numColorSamples += 1;
         }
-        const GrCaps& caps = *this->getGpu()->caps();
-        return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+        return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                       numColorSamples, GrMipmapped::kNo);
     }
 
diff --git a/src/gpu/d3d/GrD3DTextureRenderTarget.cpp b/src/gpu/d3d/GrD3DTextureRenderTarget.cpp
index 682c32e..1fc5c90 100644
--- a/src/gpu/d3d/GrD3DTextureRenderTarget.cpp
+++ b/src/gpu/d3d/GrD3DTextureRenderTarget.cpp
@@ -178,8 +178,7 @@
         // Add one to account for the resolve VkImage.
         ++numColorSamples;
     }
-    const GrCaps& caps = *this->getGpu()->caps();
-    return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+    return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                   numColorSamples,  // TODO: this still correct?
                                   this->mipmapped());
 }
diff --git a/src/gpu/d3d/GrD3DUtil.h b/src/gpu/d3d/GrD3DUtil.h
index 34d0224..50b7f21 100644
--- a/src/gpu/d3d/GrD3DUtil.h
+++ b/src/gpu/d3d/GrD3DUtil.h
@@ -32,8 +32,8 @@
  */
 bool GrDxgiFormatIsCompressed(DXGI_FORMAT);
 
-static constexpr uint32_t GrDxgiFormatChannels(DXGI_FORMAT vkFormat) {
-    switch (vkFormat) {
+static constexpr uint32_t GrDxgiFormatChannels(DXGI_FORMAT format) {
+    switch (format) {
         case DXGI_FORMAT_R8G8B8A8_UNORM:           return kRGBA_SkColorChannelFlags;
         case DXGI_FORMAT_R8_UNORM:                 return kRed_SkColorChannelFlag;
         case DXGI_FORMAT_B8G8R8A8_UNORM:           return kRGBA_SkColorChannelFlags;
@@ -43,7 +43,6 @@
         case DXGI_FORMAT_R8G8_UNORM:               return kRG_SkColorChannelFlags;
         case DXGI_FORMAT_R10G10B10A2_UNORM:        return kRGBA_SkColorChannelFlags;
         case DXGI_FORMAT_B4G4R4A4_UNORM:           return kRGBA_SkColorChannelFlags;
-        case DXGI_FORMAT_R32G32B32A32_FLOAT:       return kRGBA_SkColorChannelFlags;
         case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:      return kRGBA_SkColorChannelFlags;
         case DXGI_FORMAT_BC1_UNORM:                return kRGBA_SkColorChannelFlags;
         case DXGI_FORMAT_R16_UNORM:                return kRed_SkColorChannelFlag;
@@ -55,6 +54,28 @@
     }
 }
 
+static constexpr size_t GrDxgiFormatBytesPerBlock(DXGI_FORMAT format) {
+    switch (format) {
+        case DXGI_FORMAT_R8G8B8A8_UNORM:           return 4;
+        case DXGI_FORMAT_R8_UNORM:                 return 1;
+        case DXGI_FORMAT_B8G8R8A8_UNORM:           return 4;
+        case DXGI_FORMAT_B5G6R5_UNORM:             return 2;
+        case DXGI_FORMAT_R16G16B16A16_FLOAT:       return 8;
+        case DXGI_FORMAT_R16_FLOAT:                return 2;
+        case DXGI_FORMAT_R8G8_UNORM:               return 2;
+        case DXGI_FORMAT_R10G10B10A2_UNORM:        return 4;
+        case DXGI_FORMAT_B4G4R4A4_UNORM:           return 2;
+        case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:      return 4;
+        case DXGI_FORMAT_BC1_UNORM:                return 8;
+        case DXGI_FORMAT_R16_UNORM:                return 2;
+        case DXGI_FORMAT_R16G16_UNORM:             return 4;
+        case DXGI_FORMAT_R16G16B16A16_UNORM:       return 8;
+        case DXGI_FORMAT_R16G16_FLOAT:             return 4;
+
+        default:                                   return 0;
+    }
+}
+
 #if defined(SK_DEBUG) || GR_TEST_UTILS
 static constexpr const char* GrDxgiFormatToStr(DXGI_FORMAT dxgiFormat) {
     switch (dxgiFormat) {
diff --git a/src/gpu/dawn/GrDawnCaps.cpp b/src/gpu/dawn/GrDawnCaps.cpp
index eddad52..c56d4ab 100644
--- a/src/gpu/dawn/GrDawnCaps.cpp
+++ b/src/gpu/dawn/GrDawnCaps.cpp
@@ -96,14 +96,6 @@
     return surface->asTexture() != nullptr;
 }
 
-size_t GrDawnCaps::bytesPerPixel(const GrBackendFormat& backendFormat) const {
-    wgpu::TextureFormat dawnFormat;
-    if (!backendFormat.asDawnFormat(&dawnFormat)) {
-        return 0;
-    }
-    return GrDawnBytesPerPixel(dawnFormat);
-}
-
 int GrDawnCaps::getRenderTargetSampleCount(int requestedCount,
                                            const GrBackendFormat& backendFormat) const {
     wgpu::TextureFormat dawnFormat;
diff --git a/src/gpu/dawn/GrDawnCaps.h b/src/gpu/dawn/GrDawnCaps.h
index 4fc4185..15048ff 100644
--- a/src/gpu/dawn/GrDawnCaps.h
+++ b/src/gpu/dawn/GrDawnCaps.h
@@ -37,8 +37,6 @@
 
     SurfaceReadPixelsSupport surfaceSupportsReadPixels(const GrSurface*) const override;
 
-    size_t bytesPerPixel(const GrBackendFormat&) const override;
-
     int getRenderTargetSampleCount(int requestedCount,
                                    const GrBackendFormat&) const override;
 
diff --git a/src/gpu/dawn/GrDawnGpu.cpp b/src/gpu/dawn/GrDawnGpu.cpp
index 6f604f5..13c3590 100644
--- a/src/gpu/dawn/GrDawnGpu.cpp
+++ b/src/gpu/dawn/GrDawnGpu.cpp
@@ -346,7 +346,7 @@
     GrDawnTextureInfo info;
     SkAssertResult(backendTexture.getDawnTextureInfo(&info));
 
-    size_t bpp = GrDawnBytesPerPixel(info.fFormat);
+    size_t bpp = GrDawnBytesPerBlock(info.fFormat);
     size_t baseLayerSize = bpp * backendTexture.width() * backendTexture.height();
     const void* pixels;
     SkAutoMalloc defaultStorage(baseLayerSize);
diff --git a/src/gpu/dawn/GrDawnRenderTarget.cpp b/src/gpu/dawn/GrDawnRenderTarget.cpp
index 7343487..ba2375c 100644
--- a/src/gpu/dawn/GrDawnRenderTarget.cpp
+++ b/src/gpu/dawn/GrDawnRenderTarget.cpp
@@ -31,8 +31,7 @@
 size_t GrDawnRenderTarget::onGpuMemorySize() const {
     // The plus 1 is to account for the resolve texture or if not using msaa the RT itself
     int numSamples = this->numSamples() + 1;
-    const GrCaps& caps = *getGpu()->caps();
-    return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(), numSamples,
+    return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(), numSamples,
                                   GrMipmapped::kNo);
 }
 
diff --git a/src/gpu/dawn/GrDawnTextureRenderTarget.cpp b/src/gpu/dawn/GrDawnTextureRenderTarget.cpp
index fce4084..dd1bab6 100644
--- a/src/gpu/dawn/GrDawnTextureRenderTarget.cpp
+++ b/src/gpu/dawn/GrDawnTextureRenderTarget.cpp
@@ -26,8 +26,7 @@
 }
 
 size_t GrDawnTextureRenderTarget::onGpuMemorySize() const {
-    const GrCaps& caps = *this->getGpu()->caps();
-    return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+    return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                   1,  // FIXME: for MSAA
                                   this->mipmapped());
 }
diff --git a/src/gpu/dawn/GrDawnUtil.cpp b/src/gpu/dawn/GrDawnUtil.cpp
index ad38f35..a2229c9 100644
--- a/src/gpu/dawn/GrDawnUtil.cpp
+++ b/src/gpu/dawn/GrDawnUtil.cpp
@@ -7,7 +7,7 @@
 
 #include "src/gpu/dawn/GrDawnUtil.h"
 
-size_t GrDawnBytesPerPixel(wgpu::TextureFormat format) {
+size_t GrDawnBytesPerBlock(wgpu::TextureFormat format) {
     switch (format) {
         case wgpu::TextureFormat::RGBA8Unorm:
         case wgpu::TextureFormat::BGRA8Unorm:
diff --git a/src/gpu/dawn/GrDawnUtil.h b/src/gpu/dawn/GrDawnUtil.h
index 426ecbb..13cc7a1 100644
--- a/src/gpu/dawn/GrDawnUtil.h
+++ b/src/gpu/dawn/GrDawnUtil.h
@@ -11,7 +11,7 @@
 #include "include/private/GrTypesPriv.h"
 #include "dawn/webgpu_cpp.h"
 
-size_t GrDawnBytesPerPixel(wgpu::TextureFormat format);
+size_t GrDawnBytesPerBlock(wgpu::TextureFormat format);
 bool GrDawnFormatIsRenderable(wgpu::TextureFormat format);
 bool GrColorTypeToDawnFormat(GrColorType colorType, wgpu::TextureFormat* format);
 bool GrDawnFormatToGrColorType(wgpu::TextureFormat format, GrColorType* colorType);
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index cf40bf5..d20e0f9 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -1398,7 +1398,6 @@
         info.fDefaultExternalFormat = GR_GL_RGBA;
         info.fDefaultExternalType = GR_GL_UNSIGNED_BYTE;
         info.fDefaultColorType = GrColorType::kRGBA_8888;
-        info.fBytesPerPixel = 4;
         info.fFlags = FormatInfo::kTexturable_Flag;
         if (GR_IS_GR_GL(standard)) {
             info.fFlags |= msaaRenderFlags;
@@ -1522,7 +1521,6 @@
         info.fDefaultExternalFormat = GR_GL_RED;
         info.fDefaultExternalType = GR_GL_UNSIGNED_BYTE;
         info.fDefaultColorType = GrColorType::kR_8;
-        info.fBytesPerPixel = 1;
         bool r8Support = false;
         if (GR_IS_GR_GL(standard)) {
             r8Support = version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_ARB_texture_rg");
@@ -1647,7 +1645,6 @@
         info.fDefaultExternalFormat = GR_GL_ALPHA;
         info.fDefaultExternalType = GR_GL_UNSIGNED_BYTE;
         info.fDefaultColorType = GrColorType::kAlpha_8;
-        info.fBytesPerPixel = 1;
         if (alpha8IsValidForGL || alpha8IsValidForGLES || alpha8IsValidForWebGL) {
             info.fFlags = FormatInfo::kTexturable_Flag;
         }
@@ -1724,7 +1721,6 @@
         info.fDefaultExternalFormat = GR_GL_LUMINANCE;
         info.fDefaultExternalType = GR_GL_UNSIGNED_BYTE;
         info.fDefaultColorType = GrColorType::kGray_8;
-        info.fBytesPerPixel = 1;
         bool lum8Supported = false;
         bool lum8SizedFormatSupported = false;
         if (GR_IS_GR_GL(standard) && !fIsCoreProfile) {
@@ -1826,7 +1822,6 @@
         info.fDefaultExternalFormat = GR_GL_BGRA;
         info.fDefaultExternalType = GR_GL_UNSIGNED_BYTE;
         info.fDefaultColorType = GrColorType::kBGRA_8888;
-        info.fBytesPerPixel = 4;
 
         GrGLenum bgraTexImageFormat;
         // If BGRA is supported as an internal format it must always be specified to glTex[Sub]Image
@@ -1934,7 +1929,6 @@
         info.fDefaultExternalFormat = GR_GL_RGB;
         info.fDefaultExternalType = GR_GL_UNSIGNED_SHORT_5_6_5;
         info.fDefaultColorType = GrColorType::kBGR_565;
-        info.fBytesPerPixel = 2;
         if (GR_IS_GR_GL(standard)) {
             if (version >= GR_GL_VER(4, 2) || ctxInfo.hasExtension("GL_ARB_ES2_compatibility")) {
                 info.fFlags = FormatInfo::kTexturable_Flag | msaaRenderFlags;
@@ -2006,7 +2000,6 @@
         info.fDefaultExternalFormat = GR_GL_RGBA;
         info.fDefaultExternalType = halfFloatType;
         info.fDefaultColorType = GrColorType::kRGBA_F16;
-        info.fBytesPerPixel = 8;
         bool rgba16FTextureSupport = false;
         bool rgba16FRenderTargetSupport = false;
 
@@ -2145,7 +2138,6 @@
         info.fDefaultExternalFormat = GR_GL_RED;
         info.fDefaultExternalType = halfFloatType;
         info.fDefaultColorType = GrColorType::kR_F16;
-        info.fBytesPerPixel = 2;
         bool r16FTextureSupport = false;
         bool r16FRenderTargetSupport = false;
 
@@ -2259,7 +2251,6 @@
         info.fDefaultExternalFormat = GR_GL_LUMINANCE;
         info.fDefaultExternalType = halfFloatType;
         info.fDefaultColorType = GrColorType::kGray_F16;
-        info.fBytesPerPixel = 2;
 
         if (lum16FSupported) {
             info.fFlags = FormatInfo::kTexturable_Flag;
@@ -2323,7 +2314,6 @@
         info.fDefaultExternalFormat = GR_GL_RGB;
         info.fDefaultExternalType = GR_GL_UNSIGNED_BYTE;
         info.fDefaultColorType = GrColorType::kRGB_888;
-        info.fBytesPerPixel = 4; // We assume the GPU stores this format 4 byte aligned
         info.fFlags = FormatInfo::kTexturable_Flag;
         if (GR_IS_GR_GL(standard)) {
             // Even in OpenGL 4.6 GL_RGB8 is required to be color renderable but not required to be
@@ -2403,7 +2393,6 @@
         info.fDefaultExternalFormat = GR_GL_RG;
         info.fDefaultExternalType = GR_GL_UNSIGNED_BYTE;
         info.fDefaultColorType = GrColorType::kRG_88;
-        info.fBytesPerPixel = 2;
         bool rg8Support = false;
         if (GR_IS_GR_GL(standard)) {
             rg8Support = version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_ARB_texture_rg");
@@ -2471,7 +2460,6 @@
         info.fDefaultExternalFormat = GR_GL_RGBA;
         info.fDefaultExternalType = GR_GL_UNSIGNED_INT_2_10_10_10_REV;
         info.fDefaultColorType = GrColorType::kRGBA_1010102;
-        info.fBytesPerPixel = 4;
         if (GR_IS_GR_GL(standard) ||
            (GR_IS_GR_GL_ES(standard) && version >= GR_GL_VER(3, 0))) {
             info.fFlags = FormatInfo::kTexturable_Flag | msaaRenderFlags;
@@ -2572,7 +2560,6 @@
         info.fDefaultExternalFormat = GR_GL_RGBA;
         info.fDefaultExternalType = GR_GL_UNSIGNED_SHORT_4_4_4_4;
         info.fDefaultColorType = GrColorType::kABGR_4444;
-        info.fBytesPerPixel = 2;
         info.fFlags = FormatInfo::kTexturable_Flag;
         if (GR_IS_GR_GL(standard)) {
             if (version >= GR_GL_VER(4, 2)) {
@@ -2635,7 +2622,6 @@
         info.fInternalFormatForRenderbuffer = GR_GL_SRGB8_ALPHA8;
         info.fDefaultExternalType = GR_GL_UNSIGNED_BYTE;
         info.fDefaultColorType = GrColorType::kRGBA_8888_SRGB;
-        info.fBytesPerPixel = 4;
 
         // We may modify the default external format below.
         info.fDefaultExternalFormat = GR_GL_RGBA;
@@ -2807,7 +2793,6 @@
         info.fDefaultExternalFormat = GR_GL_RED;
         info.fDefaultExternalType = GR_GL_UNSIGNED_SHORT;
         info.fDefaultColorType = GrColorType::kR_16;
-        info.fBytesPerPixel = 2;
         bool r16Supported = false;
         if (GR_IS_GR_GL(standard)) {
             r16Supported = version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_ARB_texture_rg");
@@ -2878,7 +2863,6 @@
         info.fDefaultExternalFormat = GR_GL_RG;
         info.fDefaultExternalType = GR_GL_UNSIGNED_SHORT;
         info.fDefaultColorType = GrColorType::kRG_1616;
-        info.fBytesPerPixel = 4;
         bool rg16Supported = false;
         if (GR_IS_GR_GL(standard)) {
             rg16Supported = version >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_ARB_texture_rg");
@@ -2953,7 +2937,6 @@
         info.fDefaultExternalFormat = GR_GL_RGBA;
         info.fDefaultExternalType = GR_GL_UNSIGNED_SHORT;
         info.fDefaultColorType = GrColorType::kRGBA_16161616;
-        info.fBytesPerPixel = 8;
         if (rgba16Support) {
             info.fFlags = FormatInfo::kTexturable_Flag | msaaRenderFlags;
         }
@@ -3042,7 +3025,6 @@
         info.fDefaultExternalFormat = GR_GL_RG;
         info.fDefaultExternalType = halfFloatType;
         info.fDefaultColorType = GrColorType::kRG_F16;
-        info.fBytesPerPixel = 4;
         if (rg16FTextureSupport) {
             info.fFlags |= FormatInfo::kTexturable_Flag;
             if (rg16FRenderTargetSupport) {
@@ -4311,15 +4293,6 @@
     return count;
 }
 
-size_t GrGLCaps::bytesPerPixel(GrGLFormat format) const {
-    return this->getFormatInfo(format).fBytesPerPixel;
-}
-
-size_t GrGLCaps::bytesPerPixel(const GrBackendFormat& format) const {
-    auto glFormat = format.asGLFormat();
-    return this->bytesPerPixel(glFormat);
-}
-
 bool GrGLCaps::canFormatBeFBOColorAttachment(GrGLFormat format) const {
     return SkToBool(this->getFormatInfo(format).fFlags & FormatInfo::kFBOColorAttachment_Flag);
 }
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 1c5302a..c214f0b 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -136,9 +136,6 @@
     }
     int maxRenderTargetSampleCount(GrGLFormat) const;
 
-    size_t bytesPerPixel(GrGLFormat) const;
-    size_t bytesPerPixel(const GrBackendFormat&) const override;
-
     bool isFormatCopyable(const GrBackendFormat&) const override;
 
     bool canFormatBeFBOColorAttachment(GrGLFormat) const;
@@ -719,8 +716,6 @@
         // When the above two values are used to initialize a texture by uploading cleared data to
         // it the data should be of this color type.
         GrColorType fDefaultColorType = GrColorType::kUnknown;
-        // This value is only valid for regular formats. Compressed formats will be 0.
-        GrGLenum fBytesPerPixel = 0;
 
         bool fHaveQueriedImplementationReadSupport = false;
 
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp
index 5efb44f..0c7ea1c 100644
--- a/src/gpu/gl/GrGLRenderTarget.cpp
+++ b/src/gpu/gl/GrGLRenderTarget.cpp
@@ -99,8 +99,7 @@
 }
 
 size_t GrGLRenderTarget::onGpuMemorySize() const {
-    const GrCaps& caps = *this->getGpu()->caps();
-    return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+    return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                   fNumSamplesOwnedPerPixel, GrMipmapped::kNo);
 }
 
@@ -217,8 +216,7 @@
 
     // Log any renderbuffer's contribution to memory.
     if (fMSColorRenderbufferID) {
-        const GrCaps& caps = *this->getGpu()->caps();
-        size_t size = GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+        size_t size = GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                              this->msaaSamples(), GrMipmapped::kNo);
 
         // Due to this resource having both a texture and a renderbuffer component, dump as
diff --git a/src/gpu/gl/GrGLTextureRenderTarget.cpp b/src/gpu/gl/GrGLTextureRenderTarget.cpp
index ba032f4..70ae72c 100644
--- a/src/gpu/gl/GrGLTextureRenderTarget.cpp
+++ b/src/gpu/gl/GrGLTextureRenderTarget.cpp
@@ -72,7 +72,6 @@
 }
 
 size_t GrGLTextureRenderTarget::onGpuMemorySize() const {
-    const GrCaps& caps = *this->getGpu()->caps();
-    return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+    return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                   this->numSamplesOwnedPerPixel(), this->mipmapped());
 }
diff --git a/src/gpu/gl/GrGLUtil.h b/src/gpu/gl/GrGLUtil.h
index ded1868..5b8347e 100644
--- a/src/gpu/gl/GrGLUtil.h
+++ b/src/gpu/gl/GrGLUtil.h
@@ -377,6 +377,36 @@
     SkUNREACHABLE;
 }
 
+static constexpr size_t GrGLFormatBytesPerBlock(GrGLFormat format) {
+    switch (format) {
+        case GrGLFormat::kRGBA8:                return 4;
+        case GrGLFormat::kR8:                   return 1;
+        case GrGLFormat::kALPHA8:               return 1;
+        case GrGLFormat::kLUMINANCE8:           return 1;
+        case GrGLFormat::kBGRA8:                return 4;
+        case GrGLFormat::kRGB565:               return 2;
+        case GrGLFormat::kRGBA16F:              return 8;
+        case GrGLFormat::kLUMINANCE16F:         return 2;
+        case GrGLFormat::kR16F:                 return 2;
+        // We assume the GPU stores this format 4 byte aligned
+        case GrGLFormat::kRGB8:                 return 4;
+        case GrGLFormat::kRG8:                  return 2;
+        case GrGLFormat::kRGB10_A2:             return 4;
+        case GrGLFormat::kRGBA4:                return 2;
+        case GrGLFormat::kSRGB8_ALPHA8:         return 4;
+        case GrGLFormat::kCOMPRESSED_ETC1_RGB8: return 8;
+        case GrGLFormat::kCOMPRESSED_RGB8_ETC2: return 8;
+        case GrGLFormat::kCOMPRESSED_RGB8_BC1:  return 8;
+        case GrGLFormat::kCOMPRESSED_RGBA8_BC1: return 8;
+        case GrGLFormat::kR16:                  return 2;
+        case GrGLFormat::kRG16:                 return 4;
+        case GrGLFormat::kRGBA16:               return 8;
+        case GrGLFormat::kRG16F:                return 4;
+        case GrGLFormat::kUnknown:              return 0;
+    }
+    SkUNREACHABLE;
+}
+
 #if defined(SK_DEBUG) || GR_TEST_UTILS
 static constexpr const char* GrGLFormatToStr(GrGLenum glFormat) {
     switch (glFormat) {
diff --git a/src/gpu/mock/GrMockCaps.h b/src/gpu/mock/GrMockCaps.h
index 0b1756f..ad4dc14 100644
--- a/src/gpu/mock/GrMockCaps.h
+++ b/src/gpu/mock/GrMockCaps.h
@@ -128,15 +128,6 @@
         return this->maxRenderTargetSampleCount(format.asMockColorType());
     }
 
-    size_t bytesPerPixel(const GrBackendFormat& format) const override {
-        SkImage::CompressionType compression = format.asMockCompressionType();
-        if (compression != SkImage::CompressionType::kNone) {
-            return 0;
-        }
-
-        return GrColorTypeBytesPerPixel(format.asMockColorType());
-    }
-
     SupportedWrite supportedWritePixelsColorType(GrColorType surfaceColorType,
                                                  const GrBackendFormat& surfaceFormat,
                                                  GrColorType srcColorType) const override {
diff --git a/src/gpu/mock/GrMockTexture.h b/src/gpu/mock/GrMockTexture.h
index 4bc72d7..135ab99 100644
--- a/src/gpu/mock/GrMockTexture.h
+++ b/src/gpu/mock/GrMockTexture.h
@@ -109,8 +109,7 @@
             // Add one to account for the resolve buffer.
             ++numColorSamples;
         }
-        const GrCaps& caps = *this->getGpu()->caps();
-        return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+        return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                       numColorSamples, GrMipmapped::kNo);
     }
 
@@ -205,8 +204,7 @@
             // Add one to account for the resolve buffer.
             ++numColorSamples;
         }
-        const GrCaps& caps = *this->getGpu()->caps();
-        return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+        return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                       numColorSamples, this->mipmapped());
     }
 
diff --git a/src/gpu/mtl/GrMtlCaps.h b/src/gpu/mtl/GrMtlCaps.h
index 1e1ed29..998df81 100644
--- a/src/gpu/mtl/GrMtlCaps.h
+++ b/src/gpu/mtl/GrMtlCaps.h
@@ -44,9 +44,6 @@
     int maxRenderTargetSampleCount(const GrBackendFormat&) const override;
     int maxRenderTargetSampleCount(MTLPixelFormat) const;
 
-    size_t bytesPerPixel(const GrBackendFormat&) const override;
-    size_t bytesPerPixel(MTLPixelFormat) const;
-
     SupportedWrite supportedWritePixelsColorType(GrColorType surfaceColorType,
                                                  const GrBackendFormat& surfaceFormat,
                                                  GrColorType srcColorType) const override;
@@ -149,9 +146,6 @@
 
         uint16_t fFlags = 0;
 
-        // This value is only valid for regular formats. Compressed formats will be 0.
-        size_t fBytesPerPixel = 0;
-
         std::unique_ptr<ColorTypeInfo[]> fColorTypeInfos;
         int fColorTypeInfoCount = 0;
     };
diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm
index 695e412..3bca5e2 100644
--- a/src/gpu/mtl/GrMtlCaps.mm
+++ b/src/gpu/mtl/GrMtlCaps.mm
@@ -388,15 +388,6 @@
     return 1 == requestedCount ? 1 : 0;
 }
 
-size_t GrMtlCaps::bytesPerPixel(const GrBackendFormat& format) const {
-    MTLPixelFormat mtlFormat = GrBackendFormatAsMTLPixelFormat(format);
-    return this->bytesPerPixel(mtlFormat);
-}
-
-size_t GrMtlCaps::bytesPerPixel(MTLPixelFormat format) const {
-    return this->getFormatInfo(format).fBytesPerPixel;
-}
-
 void GrMtlCaps::initShaderCaps() {
     GrShaderCaps* shaderCaps = fShaderCaps.get();
 
@@ -520,7 +511,6 @@
     {
         info = &fFormatTable[GetFormatIndex(MTLPixelFormatR8Unorm)];
         info->fFlags = FormatInfo::kAllFlags;
-        info->fBytesPerPixel = 1;
         info->fColorTypeInfoCount = 2;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -545,7 +535,6 @@
     {
         info = &fFormatTable[GetFormatIndex(MTLPixelFormatA8Unorm)];
         info->fFlags = FormatInfo::kTexturable_Flag;
-        info->fBytesPerPixel = 1;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -563,7 +552,6 @@
     {
         info = &fFormatTable[GetFormatIndex(MTLPixelFormatB5G6R5Unorm)];
         info->fFlags = FormatInfo::kAllFlags;
-        info->fBytesPerPixel = 2;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -579,7 +567,6 @@
     {
         info = &fFormatTable[GetFormatIndex(MTLPixelFormatABGR4Unorm)];
         info->fFlags = FormatInfo::kAllFlags;
-        info->fBytesPerPixel = 2;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -596,7 +583,6 @@
     {
         info = &fFormatTable[GetFormatIndex(MTLPixelFormatRGBA8Unorm)];
         info->fFlags = FormatInfo::kAllFlags;
-        info->fBytesPerPixel = 4;
         info->fColorTypeInfoCount = 2;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -619,7 +605,6 @@
     {
         info = &fFormatTable[GetFormatIndex(MTLPixelFormatRG8Unorm)];
         info->fFlags = FormatInfo::kTexturable_Flag;
-        info->fBytesPerPixel = 2;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -635,7 +620,6 @@
     {
         info = &fFormatTable[GetFormatIndex(MTLPixelFormatBGRA8Unorm)];
         info->fFlags = FormatInfo::kAllFlags;
-        info->fBytesPerPixel = 4;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -651,7 +635,6 @@
     {
         info = &fFormatTable[GetFormatIndex(MTLPixelFormatRGBA8Unorm_sRGB)];
         info->fFlags = FormatInfo::kAllFlags;
-        info->fBytesPerPixel = 4;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -671,7 +654,6 @@
         } else {
             info->fFlags = FormatInfo::kTexturable_Flag;
         }
-        info->fBytesPerPixel = 4;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -692,7 +674,6 @@
         } else {
             info->fFlags = FormatInfo::kAllFlags;
         }
-        info->fBytesPerPixel = 4;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -709,7 +690,6 @@
     {
         info = &fFormatTable[GetFormatIndex(MTLPixelFormatR16Float)];
         info->fFlags = FormatInfo::kAllFlags;
-        info->fBytesPerPixel = 2;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -727,7 +707,6 @@
     {
         info = &fFormatTable[GetFormatIndex(MTLPixelFormatRGBA16Float)];
         info->fFlags = FormatInfo::kAllFlags;
-        info->fBytesPerPixel = 8;
         info->fColorTypeInfoCount = 2;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -753,7 +732,6 @@
         } else {
             info->fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kRenderable_Flag;
         }
-        info->fBytesPerPixel = 2;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -775,7 +753,6 @@
         } else {
             info->fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kRenderable_Flag;
         }
-        info->fBytesPerPixel = 4;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -807,7 +784,6 @@
         } else {
             info->fFlags = FormatInfo::kTexturable_Flag | FormatInfo::kRenderable_Flag;
         }
-        info->fBytesPerPixel = 8;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
@@ -823,7 +799,6 @@
     {
         info = &fFormatTable[GetFormatIndex(MTLPixelFormatRG16Float)];
         info->fFlags = FormatInfo::kAllFlags;
-        info->fBytesPerPixel = 4;
         info->fColorTypeInfoCount = 1;
         info->fColorTypeInfos.reset(new ColorTypeInfo[info->fColorTypeInfoCount]());
         int ctIdx = 0;
diff --git a/src/gpu/mtl/GrMtlCppUtil.h b/src/gpu/mtl/GrMtlCppUtil.h
index 58c570f..5361264 100644
--- a/src/gpu/mtl/GrMtlCppUtil.h
+++ b/src/gpu/mtl/GrMtlCppUtil.h
@@ -17,6 +17,8 @@
 
 GrMTLPixelFormat GrGetMTLPixelFormatFromMtlTextureInfo(const GrMtlTextureInfo&);
 
+size_t GrMtlBackendFormatBytesPerBlock(const GrBackendFormat& format);
+
 uint32_t GrMtlFormatChannels(GrMTLPixelFormat);
 
 SkImage::CompressionType GrMtlBackendFormatToCompressionType(const GrBackendFormat& format);
diff --git a/src/gpu/mtl/GrMtlGpu.mm b/src/gpu/mtl/GrMtlGpu.mm
index 3d26989..432e72d 100644
--- a/src/gpu/mtl/GrMtlGpu.mm
+++ b/src/gpu/mtl/GrMtlGpu.mm
@@ -568,8 +568,7 @@
     }
 
     if (levelClearMask) {
-        this->clearTexture(tex.get(), this->mtlCaps().bytesPerPixel(mtlPixelFormat),
-                           levelClearMask);
+        this->clearTexture(tex.get(), GrMtlFormatBytesPerBlock(mtlPixelFormat), levelClearMask);
     }
 
     return std::move(tex);
@@ -942,7 +941,7 @@
             backendTexture.getBackendFormat());
 
     // Create a transfer buffer and fill with data.
-    size_t bytesPerPixel = fMtlCaps->bytesPerPixel(mtlFormat);
+    size_t bytesPerPixel = GrMtlFormatBytesPerBlock(mtlFormat);
     SkSTArray<16, size_t> individualMipOffsets;
     size_t combinedBufferSize;
 
@@ -1289,7 +1288,7 @@
     if (offset % bpp) {
         return false;
     }
-    if (this->mtlCaps().bytesPerPixel(texture->backendFormat()) != bpp) {
+    if (GrBackendFormatBytesPerPixel(texture->backendFormat()) != bpp) {
         return false;
     }
 
@@ -1324,7 +1323,7 @@
     if (offset % bpp) {
         return false;
     }
-    if (this->mtlCaps().bytesPerPixel(surface->backendFormat()) != bpp) {
+    if (GrBackendFormatBytesPerPixel(surface->backendFormat()) != bpp) {
         return false;
     }
 
diff --git a/src/gpu/mtl/GrMtlRenderTarget.h b/src/gpu/mtl/GrMtlRenderTarget.h
index 414b8b5..a127819 100644
--- a/src/gpu/mtl/GrMtlRenderTarget.h
+++ b/src/gpu/mtl/GrMtlRenderTarget.h
@@ -60,8 +60,7 @@
         if (numColorSamples > 1) {
             ++numColorSamples;
         }
-        const GrCaps& caps = *this->getGpu()->caps();
-        return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+        return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                       numColorSamples, GrMipmapped::kNo);
     }
 
diff --git a/src/gpu/mtl/GrMtlTextureRenderTarget.h b/src/gpu/mtl/GrMtlTextureRenderTarget.h
index 79024a0..351abb8 100644
--- a/src/gpu/mtl/GrMtlTextureRenderTarget.h
+++ b/src/gpu/mtl/GrMtlTextureRenderTarget.h
@@ -77,8 +77,7 @@
         if (numColorSamples > 1) {
             ++numColorSamples;
         }
-        const GrCaps& caps = *this->getGpu()->caps();
-        return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+        return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                       numColorSamples, GrMipmapped::kNo);
     }
 };
diff --git a/src/gpu/mtl/GrMtlUtil.h b/src/gpu/mtl/GrMtlUtil.h
index 6df99c7..996270c 100644
--- a/src/gpu/mtl/GrMtlUtil.h
+++ b/src/gpu/mtl/GrMtlUtil.h
@@ -112,4 +112,6 @@
  */
 SkImage::CompressionType GrMtlFormatToCompressionType(MTLPixelFormat mtlFormat);
 
+size_t GrMtlFormatBytesPerBlock(MTLPixelFormat);
+
 #endif
diff --git a/src/gpu/mtl/GrMtlUtil.mm b/src/gpu/mtl/GrMtlUtil.mm
index eaef23d..f04b17a 100644
--- a/src/gpu/mtl/GrMtlUtil.mm
+++ b/src/gpu/mtl/GrMtlUtil.mm
@@ -275,7 +275,6 @@
     return GrMtlFormatToCompressionType(mtlFormat);
 }
 
-
 bool GrMtlFormatIsCompressed(MTLPixelFormat mtlFormat) {
     switch (mtlFormat) {
 #ifdef SK_BUILD_FOR_IOS
@@ -311,6 +310,46 @@
     return texture.sampleCount;
 }
 
+size_t GrMtlBackendFormatBytesPerBlock(const GrBackendFormat& format) {
+    MTLPixelFormat mtlFormat = GrBackendFormatAsMTLPixelFormat(format);
+    return GrMtlFormatBytesPerBlock(mtlFormat);
+}
+
+size_t GrMtlFormatBytesPerBlock(MTLPixelFormat mtlFormat) {
+    switch (mtlFormat) {
+        case MTLPixelFormatInvalid:         return 0;
+        case MTLPixelFormatRGBA8Unorm:      return 4;
+        case MTLPixelFormatR8Unorm:         return 1;
+        case MTLPixelFormatA8Unorm:         return 1;
+        case MTLPixelFormatBGRA8Unorm:      return 4;
+#ifdef SK_BUILD_FOR_IOS
+        case MTLPixelFormatB5G6R5Unorm:     return 2;
+#endif
+        case MTLPixelFormatRGBA16Float:     return 8;
+        case MTLPixelFormatR16Float:        return 2;
+        case MTLPixelFormatRG8Unorm:        return 2;
+        case MTLPixelFormatRGB10A2Unorm:    return 4;
+#ifdef SK_BUILD_FOR_MAC
+        case MTLPixelFormatBGR10A2Unorm:    return 4;
+#endif
+#ifdef SK_BUILD_FOR_IOS
+        case MTLPixelFormatABGR4Unorm:      return 2;
+#endif
+        case MTLPixelFormatRGBA8Unorm_sRGB: return 4;
+        case MTLPixelFormatR16Unorm:        return 2;
+        case MTLPixelFormatRG16Unorm:       return 4;
+#ifdef SK_BUILD_FOR_IOS
+        case MTLPixelFormatETC2_RGB8:       return 8;
+#else
+        case MTLPixelFormatBC1_RGBA:        return 8;
+#endif
+        case MTLPixelFormatRGBA16Unorm:     return 8;
+        case MTLPixelFormatRG16Float:       return 4;
+
+        default:                            return 0;
+    }
+}
+
 #if defined(SK_DEBUG) || GR_TEST_UTILS
 bool GrMtlFormatIsBGRA8(GrMTLPixelFormat mtlFormat) {
     return mtlFormat == MTLPixelFormatBGRA8Unorm;
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 9133e1a..62c87f3 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -799,7 +799,6 @@
         constexpr VkFormat format = VK_FORMAT_R8G8B8A8_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 4;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 2;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -827,7 +826,6 @@
         constexpr VkFormat format = VK_FORMAT_R8_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 1;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 2;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -856,7 +854,6 @@
         constexpr VkFormat format = VK_FORMAT_B8G8R8A8_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 4;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -875,7 +872,6 @@
         constexpr VkFormat format = VK_FORMAT_R5G6B5_UNORM_PACK16;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 2;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -894,7 +890,6 @@
         constexpr VkFormat format = VK_FORMAT_R16G16B16A16_SFLOAT;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 8;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 2;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -920,7 +915,6 @@
         constexpr VkFormat format = VK_FORMAT_R16_SFLOAT;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 2;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -941,7 +935,6 @@
         constexpr VkFormat format = VK_FORMAT_R8G8B8_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 3;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -960,7 +953,6 @@
         constexpr VkFormat format = VK_FORMAT_R8G8_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 2;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -979,7 +971,6 @@
         constexpr VkFormat format = VK_FORMAT_A2B10G10R10_UNORM_PACK32;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 4;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -998,7 +989,6 @@
         constexpr VkFormat format = VK_FORMAT_A2R10G10B10_UNORM_PACK32;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 4;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -1017,7 +1007,6 @@
         constexpr VkFormat format = VK_FORMAT_B4G4R4A4_UNORM_PACK16;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 2;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -1039,7 +1028,6 @@
         constexpr VkFormat format = VK_FORMAT_R4G4B4A4_UNORM_PACK16;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 2;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -1058,7 +1046,6 @@
         constexpr VkFormat format = VK_FORMAT_R8G8B8A8_SRGB;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 4;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -1077,7 +1064,6 @@
         constexpr VkFormat format = VK_FORMAT_R16_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 2;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -1098,7 +1084,6 @@
         constexpr VkFormat format = VK_FORMAT_R16G16_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 4;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -1117,7 +1102,6 @@
         constexpr VkFormat format = VK_FORMAT_R16G16B16A16_UNORM;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 8;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -1136,7 +1120,6 @@
         constexpr VkFormat format = VK_FORMAT_R16G16_SFLOAT;
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
-        info.fBytesPerPixel = 4;
         if (SkToBool(info.fOptimalFlags & FormatInfo::kTexturable_Flag)) {
             info.fColorTypeInfoCount = 1;
             info.fColorTypeInfos = std::make_unique<ColorTypeInfo[]>(info.fColorTypeInfoCount);
@@ -1154,10 +1137,6 @@
     {
         constexpr VkFormat format = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM;
         auto& info = this->getFormatInfo(format);
-        // Currently we are just over estimating this value to be used in gpu size calculations even
-        // though the actually size is probably less. We should instead treat planar formats similar
-        // to compressed textures that go through their own special query for calculating size.
-        info.fBytesPerPixel = 3;
         if (fSupportsYcbcrConversion) {
             info.init(interface, physDev, properties, format);
         }
@@ -1178,10 +1157,6 @@
     {
         constexpr VkFormat format = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
         auto& info = this->getFormatInfo(format);
-        // Currently we are just over estimating this value to be used in gpu size calculations even
-        // though the actually size is probably less. We should instead treat planar formats similar
-        // to compressed textures that go through their own special query for calculating size.
-        info.fBytesPerPixel = 3;
         if (fSupportsYcbcrConversion) {
             info.init(interface, physDev, properties, format);
         }
@@ -1204,7 +1179,6 @@
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
         // Setting this to texel block size
-        info.fBytesPerPixel = 8;
         // No supported GrColorTypes.
     }
 
@@ -1214,7 +1188,6 @@
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
         // Setting this to texel block size
-        info.fBytesPerPixel = 8;
         // No supported GrColorTypes.
     }
 
@@ -1224,7 +1197,6 @@
         auto& info = this->getFormatInfo(format);
         info.init(interface, physDev, properties, format);
         // Setting this to texel block size
-        info.fBytesPerPixel = 8;
         // No supported GrColorTypes.
     }
 
@@ -1465,18 +1437,6 @@
     return table[table.count() - 1];
 }
 
-size_t GrVkCaps::bytesPerPixel(const GrBackendFormat& format) const {
-    VkFormat vkFormat;
-    if (!format.asVkFormat(&vkFormat)) {
-        return 0;
-    }
-    return this->bytesPerPixel(vkFormat);
-}
-
-size_t GrVkCaps::bytesPerPixel(VkFormat format) const {
-    return this->getFormatInfo(format).fBytesPerPixel;
-}
-
 static inline size_t align_to_4(size_t v) {
     switch (v & 0b11) {
         // v is already a multiple of 4.
@@ -1503,7 +1463,7 @@
     }
 
     // The VkBufferImageCopy bufferOffset field must be both a multiple of 4 and of a single texel.
-    size_t offsetAlignment = align_to_4(this->bytesPerPixel(vkFormat));
+    size_t offsetAlignment = align_to_4(GrVkFormatBytesPerBlock(vkFormat));
 
     const auto& info = this->getFormatInfo(vkFormat);
     for (int i = 0; i < info.fColorTypeInfoCount; ++i) {
@@ -1683,7 +1643,7 @@
     }
 
     // The VkBufferImageCopy bufferOffset field must be both a multiple of 4 and of a single texel.
-    size_t offsetAlignment = align_to_4(this->bytesPerPixel(vkFormat));
+    size_t offsetAlignment = align_to_4(GrVkFormatBytesPerBlock(vkFormat));
 
     const auto& info = this->getFormatInfo(vkFormat);
     for (int i = 0; i < info.fColorTypeInfoCount; ++i) {
diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h
index 6856a63..80e7948 100644
--- a/src/gpu/vk/GrVkCaps.h
+++ b/src/gpu/vk/GrVkCaps.h
@@ -50,9 +50,6 @@
     int maxRenderTargetSampleCount(const GrBackendFormat&) const override;
     int maxRenderTargetSampleCount(VkFormat format) const;
 
-    size_t bytesPerPixel(const GrBackendFormat&) const override;
-    size_t bytesPerPixel(VkFormat format) const;
-
     SupportedWrite supportedWritePixelsColorType(GrColorType surfaceColorType,
                                                  const GrBackendFormat& surfaceFormat,
                                                  GrColorType srcColorType) const override;
@@ -294,8 +291,6 @@
         uint16_t fLinearFlags = 0;
 
         SkTDArray<int> fColorSampleCounts;
-        // This value is only valid for regular formats. Compressed formats will be 0.
-        size_t fBytesPerPixel = 0;
 
         std::unique_ptr<ColorTypeInfo[]> fColorTypeInfos;
         int fColorTypeInfoCount = 0;
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 7e19461..fb81fc0 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -501,7 +501,7 @@
     }
 
     size_t bpp = GrColorTypeBytesPerPixel(bufferColorType);
-    if (this->vkCaps().bytesPerPixel(texture->backendFormat()) != bpp) {
+    if (GrBackendFormatBytesPerPixel(texture->backendFormat()) != bpp) {
         return false;
     }
 
@@ -587,7 +587,7 @@
         srcImage = static_cast<GrVkTexture*>(surface->asTexture());
     }
 
-    if (this->vkCaps().bytesPerPixel(srcImage->imageFormat()) !=
+    if (GrVkFormatBytesPerBlock(srcImage->imageFormat()) !=
         GrColorTypeBytesPerPixel(surfaceColorType)) {
         return false;
     }
@@ -724,7 +724,7 @@
 
 // This fills in the 'regions' vector in preparation for copying a buffer to an image.
 // 'individualMipOffsets' is filled in as a side-effect.
-static size_t fill_in_regions(GrVkCaps* vkCaps, GrStagingBufferManager* stagingBufferManager,
+static size_t fill_in_regions(GrStagingBufferManager* stagingBufferManager,
                               SkTArray<VkBufferImageCopy>* regions,
                               SkTArray<size_t>* individualMipOffsets,
                               GrStagingBufferManager::Slice* slice,
@@ -738,11 +738,11 @@
     regions->reserve(numMipLevels);
     individualMipOffsets->reserve(numMipLevels);
 
+    size_t bytesPerBlock = GrVkFormatBytesPerBlock(vkFormat);
+
     size_t combinedBufferSize;
     if (compression == SkImage::CompressionType::kNone) {
-        size_t bytesPerPixel = vkCaps->bytesPerPixel(vkFormat);
-
-        combinedBufferSize = GrComputeTightCombinedBufferSize(bytesPerPixel, dimensions,
+        combinedBufferSize = GrComputeTightCombinedBufferSize(bytesPerBlock, dimensions,
                                                               individualMipOffsets,
                                                               numMipLevels);
     } else {
@@ -753,8 +753,7 @@
 
     // Get a staging buffer slice to hold our mip data.
     // Vulkan requires offsets in the buffer to be aligned to multiple of the texel size and 4
-    size_t bytesPerPixel = vkCaps->bytesPerPixel(vkFormat);
-    size_t alignment = SkAlign4(bytesPerPixel);
+    size_t alignment = SkAlign4(bytesPerBlock);
     *slice = stagingBufferManager->allocateStagingBufferSlice(combinedBufferSize, alignment);
     if (!slice->fBuffer) {
         return 0;
@@ -994,7 +993,7 @@
     GrStagingBufferManager::Slice slice;
     SkTArray<VkBufferImageCopy> regions;
     SkTArray<size_t> individualMipOffsets;
-    SkDEBUGCODE(size_t combinedBufferSize =) fill_in_regions(fVkCaps.get(), &fStagingBufferManager,
+    SkDEBUGCODE(size_t combinedBufferSize =) fill_in_regions(&fStagingBufferManager,
                                                              &regions, &individualMipOffsets,
                                                              &slice, compression, vkFormat,
                                                              dimensions, mipMapped);
@@ -1566,15 +1565,14 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 
-bool copy_src_data(GrVkGpu* gpu, char* mapPtr, VkFormat vkFormat,
-                   const SkTArray<size_t>& individualMipOffsets,
+bool copy_src_data(char* mapPtr, VkFormat vkFormat, const SkTArray<size_t>& individualMipOffsets,
                    const SkPixmap srcData[], int numMipLevels) {
     SkASSERT(srcData && numMipLevels);
     SkASSERT(!GrVkFormatIsCompressed(vkFormat));
     SkASSERT(individualMipOffsets.count() == numMipLevels);
     SkASSERT(mapPtr);
 
-    size_t bytesPerPixel = gpu->vkCaps().bytesPerPixel(vkFormat);
+    size_t bytesPerPixel = GrVkFormatBytesPerBlock(vkFormat);
 
     for (int level = 0; level < numMipLevels; ++level) {
         const size_t trimRB = srcData[level].width() * bytesPerPixel;
@@ -1712,7 +1710,7 @@
         SkTArray<size_t> individualMipOffsets;
         GrStagingBufferManager::Slice slice;
 
-        fill_in_regions(fVkCaps.get(), &fStagingBufferManager, &regions, &individualMipOffsets,
+        fill_in_regions(&fStagingBufferManager, &regions, &individualMipOffsets,
                         &slice, compression, info.fFormat, backendTexture.dimensions(),
                         backendTexture.fMipmapped);
 
@@ -1722,8 +1720,8 @@
 
         bool result;
         if (data->type() == BackendTextureData::Type::kPixmaps) {
-            result = copy_src_data(this, (char*)slice.fOffsetMapPtr, info.fFormat,
-                                   individualMipOffsets, data->pixmaps(), info.fLevelCount);
+            result = copy_src_data((char*)slice.fOffsetMapPtr, info.fFormat, individualMipOffsets,
+                                   data->pixmaps(), info.fLevelCount);
         } else if (data->type() == BackendTextureData::Type::kCompressed) {
             result = copy_compressed_data(this, (char*)slice.fOffsetMapPtr,
                                           data->compressedData(), data->compressedSize());
@@ -2455,7 +2453,7 @@
                           false);
 
     size_t bpp = GrColorTypeBytesPerPixel(dstColorType);
-    if (this->vkCaps().bytesPerPixel(image->imageFormat()) != bpp) {
+    if (GrVkFormatBytesPerBlock(image->imageFormat()) != bpp) {
         return false;
     }
     size_t tightRowBytes = bpp * width;
diff --git a/src/gpu/vk/GrVkRenderTarget.h b/src/gpu/vk/GrVkRenderTarget.h
index c089b16..2696701 100644
--- a/src/gpu/vk/GrVkRenderTarget.h
+++ b/src/gpu/vk/GrVkRenderTarget.h
@@ -123,8 +123,7 @@
             // Add one to account for the resolved VkImage.
             numColorSamples += 1;
         }
-        const GrCaps& caps = *this->getGpu()->caps();
-        return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+        return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                       numColorSamples, GrMipmapped::kNo);
     }
 
diff --git a/src/gpu/vk/GrVkTextureRenderTarget.cpp b/src/gpu/vk/GrVkTextureRenderTarget.cpp
index d51f6f1..7cfd759 100644
--- a/src/gpu/vk/GrVkTextureRenderTarget.cpp
+++ b/src/gpu/vk/GrVkTextureRenderTarget.cpp
@@ -252,8 +252,7 @@
         // Add one to account for the resolve VkImage.
         ++numColorSamples;
     }
-    const GrCaps& caps = *this->getGpu()->caps();
-    return GrSurface::ComputeSize(caps, this->backendFormat(), this->dimensions(),
+    return GrSurface::ComputeSize(this->backendFormat(), this->dimensions(),
                                   numColorSamples,  // TODO: this still correct?
                                   this->mipmapped());
 }
diff --git a/src/gpu/vk/GrVkUtil.h b/src/gpu/vk/GrVkUtil.h
index e6a7961..f810364 100644
--- a/src/gpu/vk/GrVkUtil.h
+++ b/src/gpu/vk/GrVkUtil.h
@@ -59,7 +59,6 @@
         case VK_FORMAT_A2R10G10B10_UNORM_PACK32: return kRGBA_SkColorChannelFlags;
         case VK_FORMAT_B4G4R4A4_UNORM_PACK16:    return kRGBA_SkColorChannelFlags;
         case VK_FORMAT_R4G4B4A4_UNORM_PACK16:    return kRGBA_SkColorChannelFlags;
-        case VK_FORMAT_R32G32B32A32_SFLOAT:      return kRGBA_SkColorChannelFlags;
         case VK_FORMAT_R8G8B8A8_SRGB:            return kRGBA_SkColorChannelFlags;
         case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:  return kRGB_SkColorChannelFlags;
         case VK_FORMAT_BC1_RGB_UNORM_BLOCK:      return kRGB_SkColorChannelFlags;
@@ -73,6 +72,38 @@
     }
 }
 
+static constexpr size_t GrVkFormatBytesPerBlock(VkFormat vkFormat) {
+    switch (vkFormat) {
+        case VK_FORMAT_R8G8B8A8_UNORM:            return 4;
+        case VK_FORMAT_R8_UNORM:                  return 1;
+        case VK_FORMAT_B8G8R8A8_UNORM:            return 4;
+        case VK_FORMAT_R5G6B5_UNORM_PACK16:       return 2;
+        case VK_FORMAT_R16G16B16A16_SFLOAT:       return 8;
+        case VK_FORMAT_R16_SFLOAT:                return 2;
+        case VK_FORMAT_R8G8B8_UNORM:              return 3;
+        case VK_FORMAT_R8G8_UNORM:                return 2;
+        case VK_FORMAT_A2B10G10R10_UNORM_PACK32:  return 4;
+        case VK_FORMAT_A2R10G10B10_UNORM_PACK32:  return 4;
+        case VK_FORMAT_B4G4R4A4_UNORM_PACK16:     return 2;
+        case VK_FORMAT_R4G4B4A4_UNORM_PACK16:     return 2;
+        case VK_FORMAT_R8G8B8A8_SRGB:             return 4;
+        case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:   return 8;
+        case VK_FORMAT_BC1_RGB_UNORM_BLOCK:       return 8;
+        case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:      return 8;
+        case VK_FORMAT_R16_UNORM:                 return 2;
+        case VK_FORMAT_R16G16_UNORM:              return 4;
+        case VK_FORMAT_R16G16B16A16_UNORM:        return 8;
+        case VK_FORMAT_R16G16_SFLOAT:             return 4;
+        // Currently we are just over estimating this value to be used in gpu size calculations even
+        // though the actually size is probably less. We should instead treat planar formats similar
+        // to compressed textures that go through their own special query for calculating size.
+        case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM: return 3;
+        case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:  return 3;
+
+        default:                                 return 0;
+    }
+}
+
 bool GrVkFormatNeedsYcbcrSampler(VkFormat format);
 
 bool GrSampleCountToVkSampleCount(uint32_t samples, VkSampleCountFlagBits* vkSamples);