Loading libs/hwui/Caches.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ Caches::Caches(): Singleton<Caches>(), mExtensions(Extensions::getInstance()), m initFont(); initConstraints(); initProperties(); initStaticProperties(); initExtensions(); mDebugLevel = readDebugLevel(); Loading Loading @@ -137,6 +138,18 @@ void Caches::initConstraints() { glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); } void Caches::initStaticProperties() { gpuPixelBuffersEnabled = false; // OpenGL ES 3.0+ specific features if (mExtensions.getMajorGlVersion() >= 3) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_ENABLE_GPU_PIXEL_BUFFERS, property, "true") > 0) { gpuPixelBuffersEnabled = !strcmp(property, "true"); } } } bool Caches::initProperties() { bool prevDebugLayersUpdates = debugLayersUpdates; bool prevDebugOverdraw = debugOverdraw; Loading libs/hwui/Caches.h +3 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,8 @@ public: AssetAtlas assetAtlas; bool gpuPixelBuffersEnabled; // Debug methods PFNGLINSERTEVENTMARKEREXTPROC eventMark; PFNGLPUSHGROUPMARKEREXTPROC startMark; Loading @@ -314,6 +316,7 @@ private: void initFont(); void initExtensions(); void initConstraints(); void initStaticProperties(); static void eventMarkNull(GLsizei length, const GLchar* marker) { } static void startMarkNull(GLsizei length, const GLchar* marker) { } Loading libs/hwui/PixelBuffer.cpp +2 −8 Original line number Diff line number Diff line Loading @@ -147,15 +147,9 @@ void GpuPixelBuffer::upload(uint32_t x, uint32_t y, uint32_t width, uint32_t hei /////////////////////////////////////////////////////////////////////////////// PixelBuffer* PixelBuffer::create(GLenum format, uint32_t width, uint32_t height, BufferType type) { bool gpuBuffer = type == kBufferType_Auto && Extensions::getInstance().getMajorGlVersion() >= 3; if (gpuBuffer) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_ENABLE_GPU_PIXEL_BUFFERS, property, "false") > 0) { if (!strcmp(property, "true")) { if (type == kBufferType_Auto && Caches::getInstance().gpuPixelBuffersEnabled) { return new GpuPixelBuffer(format, width, height); } } } return new CpuPixelBuffer(format, width, height); } Loading libs/hwui/Properties.h +2 −2 Original line number Diff line number Diff line Loading @@ -123,9 +123,9 @@ enum DebugLevel { /** * Indicates whether PBOs can be used to back pixel buffers. * Accepted values are "true" and "false". * Accepted values are "true" and "false". Default is true. */ #define PROPERTY_ENABLE_GPU_PIXEL_BUFFERS "hwui.use_gpu_pixel_buffers" #define PROPERTY_ENABLE_GPU_PIXEL_BUFFERS "ro.hwui.use_gpu_pixel_buffers" // These properties are defined in mega-bytes #define PROPERTY_TEXTURE_CACHE_SIZE "ro.hwui.texture_cache_size" Loading Loading
libs/hwui/Caches.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ Caches::Caches(): Singleton<Caches>(), mExtensions(Extensions::getInstance()), m initFont(); initConstraints(); initProperties(); initStaticProperties(); initExtensions(); mDebugLevel = readDebugLevel(); Loading Loading @@ -137,6 +138,18 @@ void Caches::initConstraints() { glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); } void Caches::initStaticProperties() { gpuPixelBuffersEnabled = false; // OpenGL ES 3.0+ specific features if (mExtensions.getMajorGlVersion() >= 3) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_ENABLE_GPU_PIXEL_BUFFERS, property, "true") > 0) { gpuPixelBuffersEnabled = !strcmp(property, "true"); } } } bool Caches::initProperties() { bool prevDebugLayersUpdates = debugLayersUpdates; bool prevDebugOverdraw = debugOverdraw; Loading
libs/hwui/Caches.h +3 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,8 @@ public: AssetAtlas assetAtlas; bool gpuPixelBuffersEnabled; // Debug methods PFNGLINSERTEVENTMARKEREXTPROC eventMark; PFNGLPUSHGROUPMARKEREXTPROC startMark; Loading @@ -314,6 +316,7 @@ private: void initFont(); void initExtensions(); void initConstraints(); void initStaticProperties(); static void eventMarkNull(GLsizei length, const GLchar* marker) { } static void startMarkNull(GLsizei length, const GLchar* marker) { } Loading
libs/hwui/PixelBuffer.cpp +2 −8 Original line number Diff line number Diff line Loading @@ -147,15 +147,9 @@ void GpuPixelBuffer::upload(uint32_t x, uint32_t y, uint32_t width, uint32_t hei /////////////////////////////////////////////////////////////////////////////// PixelBuffer* PixelBuffer::create(GLenum format, uint32_t width, uint32_t height, BufferType type) { bool gpuBuffer = type == kBufferType_Auto && Extensions::getInstance().getMajorGlVersion() >= 3; if (gpuBuffer) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_ENABLE_GPU_PIXEL_BUFFERS, property, "false") > 0) { if (!strcmp(property, "true")) { if (type == kBufferType_Auto && Caches::getInstance().gpuPixelBuffersEnabled) { return new GpuPixelBuffer(format, width, height); } } } return new CpuPixelBuffer(format, width, height); } Loading
libs/hwui/Properties.h +2 −2 Original line number Diff line number Diff line Loading @@ -123,9 +123,9 @@ enum DebugLevel { /** * Indicates whether PBOs can be used to back pixel buffers. * Accepted values are "true" and "false". * Accepted values are "true" and "false". Default is true. */ #define PROPERTY_ENABLE_GPU_PIXEL_BUFFERS "hwui.use_gpu_pixel_buffers" #define PROPERTY_ENABLE_GPU_PIXEL_BUFFERS "ro.hwui.use_gpu_pixel_buffers" // These properties are defined in mega-bytes #define PROPERTY_TEXTURE_CACHE_SIZE "ro.hwui.texture_cache_size" Loading