summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerBuffer.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-08-11 22:34:02 -0700
committerMathias Agopian <mathias@google.com>2009-08-11 23:32:29 -0700
commit5cec4742b3a1d7448bd32ae57cb4cf70b484c64c (patch)
tree9a3d6adb933fd0947ffc643e3d11f432a4baec4b /libs/surfaceflinger/LayerBuffer.cpp
parent064dbd076d431a7508b864aa0993cd59ef743e4e (diff)
downloadframeworks_base-5cec4742b3a1d7448bd32ae57cb4cf70b484c64c.zip
frameworks_base-5cec4742b3a1d7448bd32ae57cb4cf70b484c64c.tar.gz
frameworks_base-5cec4742b3a1d7448bd32ae57cb4cf70b484c64c.tar.bz2
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."
Diffstat (limited to 'libs/surfaceflinger/LayerBuffer.cpp')
-rw-r--r--libs/surfaceflinger/LayerBuffer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/surfaceflinger/LayerBuffer.cpp b/libs/surfaceflinger/LayerBuffer.cpp
index 90e7f50..e1f4bea 100644
--- a/libs/surfaceflinger/LayerBuffer.cpp
+++ b/libs/surfaceflinger/LayerBuffer.cpp
@@ -28,6 +28,7 @@
#include <hardware/copybit.h>
+#include "BufferAllocator.h"
#include "LayerBuffer.h"
#include "SurfaceFlinger.h"
#include "DisplayHardware/DisplayHardware.h"
@@ -464,7 +465,10 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const
mTempBitmap->getWidth() < tmp_w ||
mTempBitmap->getHeight() < tmp_h) {
mTempBitmap.clear();
- mTempBitmap = new android::Buffer(tmp_w, tmp_h, src.img.format);
+ mTempBitmap = new android::Buffer(
+ tmp_w, tmp_h, src.img.format,
+ BufferAllocator::USAGE_HW_TEXTURE |
+ BufferAllocator::USAGE_HW_2D);
err = mTempBitmap->initCheck();
}