diff options
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 7 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCaps.h | 6 | ||||
-rw-r--r-- | src/gpu/gl/GrGLUtil.cpp | 3 | ||||
-rw-r--r-- | src/gpu/gl/GrGLUtil.h | 1 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 4 |
5 files changed, 19 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index b140a100da..bd18e56b4b 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -37,6 +37,7 @@ void GrGLCaps::reset() { fImagingSupport = false; fTwoFormatLimit = false; fFragCoordsConventionSupport = false; + fUseNonVBOVertexAndIndexDynamicData = false; } GrGLCaps::GrGLCaps(const GrGLCaps& caps) { @@ -67,6 +68,7 @@ GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) { fImagingSupport = caps.fImagingSupport; fTwoFormatLimit = caps.fTwoFormatLimit; fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; + fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicData; return *this; } @@ -167,6 +169,11 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo) { ctxInfo.hasExtension("GL_ARB_fragment_coord_conventions"); } + // Perhaps we should look at the renderer string and limit to Mali GPUs. + if (kARM_GrGLVendor == ctxInfo.vendor() && !GR_GL_MUST_USE_VBO) { + fUseNonVBOVertexAndIndexDynamicData = true; + } + this->initFSAASupport(ctxInfo); this->initStencilFormats(ctxInfo); } diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h index 9dfbf23cb4..4143868ed8 100644 --- a/src/gpu/gl/GrGLCaps.h +++ b/src/gpu/gl/GrGLCaps.h @@ -219,6 +219,11 @@ public: /// Is GL_ARB_fragment_coord_conventions supported? bool fragCoordConventionsSupport() const { return fFragCoordsConventionSupport; } + // Use indices or vertices in CPU arrays rather than VBOs for dynamic content. + bool useNonVBOVertexAndIndexDynamicData() const { + return fUseNonVBOVertexAndIndexDynamicData; + } + // Does ReadPixels support the provided format/type combo? bool readPixelsSupported(const GrGLInterface* intf, GrGLenum format, @@ -297,6 +302,7 @@ private: bool fImagingSupport : 1; bool fTwoFormatLimit : 1; bool fFragCoordsConventionSupport : 1; + bool fUseNonVBOVertexAndIndexDynamicData : 1; }; #endif diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp index 3f110cc49f..225650c106 100644 --- a/src/gpu/gl/GrGLUtil.cpp +++ b/src/gpu/gl/GrGLUtil.cpp @@ -171,6 +171,9 @@ GrGLVendor GrGLGetVendorFromString(const char* vendorString) { if (0 == strcmp(vendorString, "Intel")) { return kIntel_GrGLVendor; } + if (0 == strcmp(vendorString, "ARM")) { + return kARM_GrGLVendor; + } } return kOther_GrGLVendor; diff --git a/src/gpu/gl/GrGLUtil.h b/src/gpu/gl/GrGLUtil.h index 997207a1c7..da0c7c32a3 100644 --- a/src/gpu/gl/GrGLUtil.h +++ b/src/gpu/gl/GrGLUtil.h @@ -21,6 +21,7 @@ typedef uint32_t GrGLSLVersion; */ enum GrGLVendor { kIntel_GrGLVendor, + kARM_GrGLVendor, kOther_GrGLVendor, }; diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 235811c3fb..b75ab322c1 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -1231,7 +1231,7 @@ GrVertexBuffer* GrGpuGL::onCreateVertexBuffer(uint32_t size, bool dynamic) { desc.fSizeInBytes = size; desc.fIsWrapped = false; - if (false && desc.fDynamic) { + if (this->glCaps().useNonVBOVertexAndIndexDynamicData() && desc.fDynamic) { desc.fID = 0; GrGLVertexBuffer* vertexBuffer = SkNEW_ARGS(GrGLVertexBuffer, (this, desc)); return vertexBuffer; @@ -1266,7 +1266,7 @@ GrIndexBuffer* GrGpuGL::onCreateIndexBuffer(uint32_t size, bool dynamic) { desc.fSizeInBytes = size; desc.fIsWrapped = false; - if (false && desc.fDynamic) { + if (this->glCaps().useNonVBOVertexAndIndexDynamicData() && desc.fDynamic) { desc.fID = 0; GrIndexBuffer* indexBuffer = SkNEW_ARGS(GrGLIndexBuffer, (this, desc)); return indexBuffer; |