From 5cec4742b3a1d7448bd32ae57cb4cf70b484c64c Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 11 Aug 2009 22:34:02 -0700 Subject: second take, hopefully this time it doesn't break one of the builds: "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything." --- libs/surfaceflinger/LayerDim.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libs/surfaceflinger/LayerDim.cpp') diff --git a/libs/surfaceflinger/LayerDim.cpp b/libs/surfaceflinger/LayerDim.cpp index 8e9df9c..6ebb49f 100644 --- a/libs/surfaceflinger/LayerDim.cpp +++ b/libs/surfaceflinger/LayerDim.cpp @@ -21,6 +21,7 @@ #include #include +#include "BufferAllocator.h" #include "LayerDim.h" #include "SurfaceFlinger.h" #include "DisplayHardware/DisplayHardware.h" @@ -68,7 +69,11 @@ void LayerDim::initDimmer(SurfaceFlinger* flinger, uint32_t w, uint32_t h) if (LIKELY(flags & DisplayHardware::DIRECT_TEXTURE)) { // TODO: api to pass the usage flags - sp buffer = new Buffer(w, h, PIXEL_FORMAT_RGB_565); + sp buffer = new Buffer(w, h, PIXEL_FORMAT_RGB_565, + BufferAllocator::USAGE_SW_WRITE_OFTEN | + BufferAllocator::USAGE_HW_TEXTURE | + BufferAllocator::USAGE_HW_2D); + android_native_buffer_t* clientBuf = buffer->getNativeBuffer(); glGenTextures(1, &sTexId); -- cgit v1.1