diff options
author | Mathias Agopian <mathias@google.com> | 2009-08-10 21:59:56 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-08-11 16:12:56 -0700 |
commit | df37b62c62f8efd3b5a433f9b4d40d30cec13a31 (patch) | |
tree | 43c783e665b9e1c47210d3c5a8f929b33acda72f /libs/surfaceflinger/Layer.cpp | |
parent | d779f052b4180f347ed0bd725fdfedda504773e5 (diff) | |
download | frameworks_native-df37b62c62f8efd3b5a433f9b4d40d30cec13a31.zip frameworks_native-df37b62c62f8efd3b5a433f9b4d40d30cec13a31.tar.gz frameworks_native-df37b62c62f8efd3b5a433f9b4d40d30cec13a31.tar.bz2 |
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.
This change makes SurfaceHolder.setType(GPU) obsolete (it's now ignored).
Added an API to android_native_window_t to allow extending the functionality without ever breaking binary compatibility. This is used to implement the new set_usage() API. This API needs to be called by software renderers because the default is to use usage flags suitable for h/w.
Diffstat (limited to 'libs/surfaceflinger/Layer.cpp')
-rw-r--r-- | libs/surfaceflinger/Layer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp index d1142cc..8c0b40d 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<SurfaceBuffer> Layer::peekBuffer() +sp<SurfaceBuffer> Layer::peekBuffer(int usage) { /* * This is called from the client's Surface::lock(), after it locked @@ -250,7 +250,7 @@ sp<SurfaceBuffer> Layer::peekBuffer() } LayerBitmap& layerBitmap(mBuffers[backBufferIndex]); - sp<SurfaceBuffer> buffer = layerBitmap.allocate(); + sp<SurfaceBuffer> 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<SurfaceBuffer> Layer::SurfaceLayer::getBuffer() +sp<SurfaceBuffer> Layer::SurfaceLayer::getBuffer(int usage) { sp<SurfaceBuffer> buffer = 0; sp<Layer> owner(getOwner()); if (owner != 0) { - buffer = owner->peekBuffer(); + buffer = owner->peekBuffer(usage); } return buffer; } |