From cbab0e0682db2bcf5655f64d5b7ef83daed07f6e Mon Sep 17 00:00:00 2001 From: Oleg Romashin Date: Sat, 28 Apr 2012 09:05:41 -0400 Subject: [PATCH] Bug 743314 - Force CanUploadSubtextures on Maemo6 harmattan. r=chrislord.net --- gfx/gl/GLContext.cpp | 5 +++++ gfx/gl/GLContext.h | 1 + gfx/gl/GLContextProviderEGL.cpp | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp index d23c9eb65045..79b6d756964c 100644 --- a/gfx/gl/GLContext.cpp +++ b/gfx/gl/GLContext.cpp @@ -641,6 +641,11 @@ GLContext::CanUploadSubTextures() if (!mWorkAroundDriverBugs) return true; + // Lock surface feature allows to mmap texture memory and modify it directly + // this feature allow us modify texture partially without full upload + if (HasLockSurface()) + return true; + // There are certain GPUs that we don't want to use glTexSubImage2D on // because that function can be very slow and/or buggy if (Renderer() == RendererAdreno200 || Renderer() == RendererAdreno205) diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h index 497e2e4852b2..c93888963c9c 100644 --- a/gfx/gl/GLContext.h +++ b/gfx/gl/GLContext.h @@ -731,6 +731,7 @@ public: bool CanUploadSubTextures(); bool CanUploadNonPowerOfTwo(); bool WantsSmallTiles(); + virtual bool HasLockSurface() { return false; } /** * If this context wraps a double-buffered target, swap the back diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp index 72301873692e..dc567dfb5da2 100644 --- a/gfx/gl/GLContextProviderEGL.cpp +++ b/gfx/gl/GLContextProviderEGL.cpp @@ -597,6 +597,10 @@ public: return h; } + virtual bool HasLockSurface() { + return sEGLLibrary.HasKHRLockSurface(); + } + protected: friend class GLContextProviderEGL;