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/Layer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libs/surfaceflinger/Layer.cpp') diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp index d1142cca86da..8c0b40d9e471 100644 --- a/libs/surfaceflinger/Layer.cpp +++ b/libs/surfaceflinger/Layer.cpp @@ -217,7 +217,7 @@ void Layer::onDraw(const Region& clip) const drawWithOpenGL(clip, mTextures[index]); } -sp Layer::peekBuffer() +sp Layer::peekBuffer(int usage) { /* * This is called from the client's Surface::lock(), after it locked @@ -250,7 +250,7 @@ sp Layer::peekBuffer() } LayerBitmap& layerBitmap(mBuffers[backBufferIndex]); - sp buffer = layerBitmap.allocate(); + sp buffer = layerBitmap.allocate(usage); LOGD_IF(DEBUG_RESIZE, "Layer::getBuffer(this=%p), index=%d, (%d,%d), (%d,%d)", @@ -649,12 +649,12 @@ Layer::SurfaceLayer::~SurfaceLayer() { } -sp Layer::SurfaceLayer::getBuffer() +sp Layer::SurfaceLayer::getBuffer(int usage) { sp buffer = 0; sp owner(getOwner()); if (owner != 0) { - buffer = owner->peekBuffer(); + buffer = owner->peekBuffer(usage); } return buffer; } -- cgit v1.2.3-59-g8ed1b