aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar krajcevski <krajcevski@google.com>2014-07-30 11:25:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-30 11:25:44 -0700
commit78697816b0a345c614071070eaa895d71f598e22 (patch)
tree4589d91c6de6b422ed7fb0afb92321f5f057d817
parent07cfb20a0b9a14b8daeb56fcf21d810e91387fd1 (diff)
Add query for whether or not we have compressedTexSubImage
R=robertphillips@google.com Author: krajcevski@google.com Review URL: https://codereview.chromium.org/430773004
-rw-r--r--src/gpu/GrDrawTarget.cpp3
-rw-r--r--src/gpu/GrDrawTargetCaps.h2
-rw-r--r--src/gpu/gl/GrGLCaps.cpp3
3 files changed, 8 insertions, 0 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 28369fde88..10fa6b202d 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -1022,6 +1022,7 @@ void GrDrawTargetCaps::reset() {
fDiscardRenderTargetSupport = false;
fReuseScratchTextures = true;
fGpuTracingSupport = false;
+ fCompressedTexSubImageSupport = false;
fMapBufferFlags = kNone_MapFlags;
@@ -1047,6 +1048,7 @@ GrDrawTargetCaps& GrDrawTargetCaps::operator=(const GrDrawTargetCaps& other) {
fDiscardRenderTargetSupport = other.fDiscardRenderTargetSupport;
fReuseScratchTextures = other.fReuseScratchTextures;
fGpuTracingSupport = other.fGpuTracingSupport;
+ fCompressedTexSubImageSupport = other.fCompressedTexSubImageSupport;
fMapBufferFlags = other.fMapBufferFlags;
@@ -1096,6 +1098,7 @@ SkString GrDrawTargetCaps::dump() const {
r.appendf("Discard Render Target Support: %s\n", gNY[fDiscardRenderTargetSupport]);
r.appendf("Reuse Scratch Textures : %s\n", gNY[fReuseScratchTextures]);
r.appendf("Gpu Tracing Support : %s\n", gNY[fGpuTracingSupport]);
+ r.appendf("Compressed Update Support : %s\n", gNY[fCompressedTexSubImageSupport]);
r.appendf("Max Texture Size : %d\n", fMaxTextureSize);
r.appendf("Max Render Target Size : %d\n", fMaxRenderTargetSize);
r.appendf("Max Sample Count : %d\n", fMaxSampleCount);
diff --git a/src/gpu/GrDrawTargetCaps.h b/src/gpu/GrDrawTargetCaps.h
index b979b534c4..1a3a84cf28 100644
--- a/src/gpu/GrDrawTargetCaps.h
+++ b/src/gpu/GrDrawTargetCaps.h
@@ -40,6 +40,7 @@ public:
bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; }
bool discardRenderTargetSupport() const { return fDiscardRenderTargetSupport; }
bool gpuTracingSupport() const { return fGpuTracingSupport; }
+ bool compressedTexSubImageSupport() const { return fCompressedTexSubImageSupport; }
/**
* Indicates whether GPU->CPU memory mapping for GPU resources such as vertex buffers and
@@ -90,6 +91,7 @@ protected:
bool fDiscardRenderTargetSupport: 1;
bool fReuseScratchTextures : 1;
bool fGpuTracingSupport : 1;
+ bool fCompressedTexSubImageSupport : 1;
uint32_t fMapBufferFlags;
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 8474873fff..f3329578ce 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -502,6 +502,9 @@ void GrGLCaps::initConfigTexturableTable(const GrGLContextInfo& ctxInfo, const G
// however, it is only available on standard OpenGL after version 1.3
bool hasCompressTex2D = (kGL_GrGLStandard != standard || version >= GR_GL_VER(1, 3));
+ fCompressedTexSubImageSupport =
+ hasCompressTex2D && (NULL != gli->fFunctions.fCompressedTexSubImage2D);
+
// Check for ETC1
bool hasETC1 = false;