aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2016-11-03 10:19:14 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-03 16:44:50 +0000
commit29e52f13f632c701bd33d802701f5ff29a567eea (patch)
tree15678f2a2076a706f5d25dd4f898616676e3f898 /include/gpu
parentd851795e7992565c1eb2b9474ee5ad01d1a01fad (diff)
Centralize computation of GrRenderTarget & GrTexture VRAM consumption
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4310 Change-Id: I676749ecf1e489f825799b619a15a45fc7dcd219 Reviewed-on: https://skia-review.googlesource.com/4310 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrRenderTarget.h2
-rw-r--r--include/gpu/GrTexture.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h
index dcbe8ea974..ad96229dc7 100644
--- a/include/gpu/GrRenderTarget.h
+++ b/include/gpu/GrRenderTarget.h
@@ -119,6 +119,8 @@ public:
return (GrRenderTargetOpList*) this->getLastOpList();
}
+ static size_t ComputeSize(const GrSurfaceDesc& desc, int colorValuesPerPixel);
+
protected:
enum class Flags {
kNone = 0,
diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h
index 211f1937da..c86496c3cf 100644
--- a/include/gpu/GrTexture.h
+++ b/include/gpu/GrTexture.h
@@ -45,6 +45,8 @@ public:
inline GrTexturePriv texturePriv();
inline const GrTexturePriv texturePriv() const;
+ static size_t ComputeSize(const GrSurfaceDesc&, bool hasMipMaps);
+
protected:
GrTexture(GrGpu*, const GrSurfaceDesc&, GrSLType, bool wasMipMapDataProvided);