summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/EglManager.h
diff options
context:
space:
mode:
authorSeason Li <seasonl@nvidia.com>2015-07-29 17:16:19 -0700
committerJohn Reck <jreck@google.com>2015-08-04 13:01:54 -0700
commit13d1b4ab10fbee5e81a2ba1ac59cfae1e51d3ef0 (patch)
tree6844646af7e67205908076b0fa641dcf24cc6e9d /libs/hwui/renderthread/EglManager.h
parent4692f42b7869110631b0521188afe56a4641ebf2 (diff)
renderthread: add EGL_EXT_buffer_age support
EGL_EXT_buffer_age is better than EGL_BUFFER_PRESERVED because it can save memory bandwidth used to blit back buffer into front buffer. Change-Id: I2fea0ee08dc7dd66e348b04dd694d075d509d01b
Diffstat (limited to 'libs/hwui/renderthread/EglManager.h')
-rw-r--r--libs/hwui/renderthread/EglManager.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/libs/hwui/renderthread/EglManager.h b/libs/hwui/renderthread/EglManager.h
index 0a8cfd30df71..bb5d24b0557f 100644
--- a/libs/hwui/renderthread/EglManager.h
+++ b/libs/hwui/renderthread/EglManager.h
@@ -21,6 +21,7 @@
#include <SkRect.h>
#include <ui/GraphicBuffer.h>
#include <utils/StrongPointer.h>
+#include <set>
namespace android {
namespace uirenderer {
@@ -37,6 +38,8 @@ public:
bool hasEglContext();
+ bool hasEglExtension(const char* extension) const;
+
EGLSurface createSurface(EGLNativeWindowType window);
void destroySurface(EGLSurface surface);
@@ -45,12 +48,14 @@ public:
bool isCurrent(EGLSurface surface) { return mCurrentSurface == surface; }
// Returns true if the current surface changed, false if it was already current
bool makeCurrent(EGLSurface surface, EGLint* errOut = nullptr);
- void beginFrame(EGLSurface surface, EGLint* width, EGLint* height);
+ void beginFrame(EGLSurface surface, EGLint* width, EGLint* height, EGLint* framebufferAge);
bool swapBuffers(EGLSurface surface, const SkRect& dirty, EGLint width, EGLint height);
// Returns true iff the surface is now preserving buffers.
bool setPreserveBuffer(EGLSurface surface, bool preserve);
+ bool useBufferAgeExt();
+
void setTextureAtlas(const sp<GraphicBuffer>& buffer, int64_t* map, size_t mapSize);
void fence();
@@ -63,10 +68,12 @@ private:
~EglManager();
void createPBufferSurface();
- void loadConfig();
+ void loadConfig(bool useBufferAgeExt);
void createContext();
void initAtlas();
+ void findExtensions(const char* extensions, std::set<std::string>& list) const;
+
RenderThread& mRenderThread;
EGLDisplay mEglDisplay;
@@ -77,11 +84,15 @@ private:
const bool mAllowPreserveBuffer;
bool mCanSetPreserveBuffer;
+ bool mHasBufferAgeExt;
+
EGLSurface mCurrentSurface;
sp<GraphicBuffer> mAtlasBuffer;
int64_t* mAtlasMap;
size_t mAtlasMapSize;
+
+ std::set<std::string> mEglExtensionList;
};
} /* namespace renderthread */