summaryrefslogtreecommitdiffstats
path: root/libs/ui
diff options
context:
space:
mode:
authorFred Quintana <fredq@google.com>2009-08-11 20:49:35 -0700
committerFred Quintana <fredq@google.com>2009-08-11 20:49:35 -0700
commit64e89a8aff9a45a491f1d7064a655b9021fe644a (patch)
tree5cad5d20370d2d77335324e55551ce2a2fe8b903 /libs/ui
parent50cb54ff5cdb233d01e1dd94b355cbfe0a371520 (diff)
downloadframeworks_base-64e89a8aff9a45a491f1d7064a655b9021fe644a.zip
frameworks_base-64e89a8aff9a45a491f1d7064a655b9021fe644a.tar.gz
frameworks_base-64e89a8aff9a45a491f1d7064a655b9021fe644a.tar.bz2
Revert "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 reverts commit 8b76a0ac6fbf07254629ed1ea86af014d5abe050.
Diffstat (limited to 'libs/ui')
-rw-r--r--libs/ui/FramebufferNativeWindow.cpp13
-rw-r--r--libs/ui/ISurface.cpp6
-rw-r--r--libs/ui/Surface.cpp37
3 files changed, 5 insertions, 51 deletions
diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp
index 90b5163..f6c666d 100644
--- a/libs/ui/FramebufferNativeWindow.cpp
+++ b/libs/ui/FramebufferNativeWindow.cpp
@@ -132,7 +132,6 @@ FramebufferNativeWindow::FramebufferNativeWindow()
android_native_window_t::lockBuffer = lockBuffer;
android_native_window_t::queueBuffer = queueBuffer;
android_native_window_t::query = query;
- android_native_window_t::perform = perform;
}
FramebufferNativeWindow::~FramebufferNativeWindow()
@@ -236,18 +235,6 @@ int FramebufferNativeWindow::query(android_native_window_t* window,
return BAD_VALUE;
}
-int FramebufferNativeWindow::perform(android_native_window_t* window,
- int operation, ...)
-{
- switch (operation) {
- case NATIVE_WINDOW_SET_USAGE:
- break;
- default:
- return NAME_NOT_FOUND;
- }
- return NO_ERROR;
-}
-
// ----------------------------------------------------------------------------
}; // namespace android
// ----------------------------------------------------------------------------
diff --git a/libs/ui/ISurface.cpp b/libs/ui/ISurface.cpp
index b78e8b5..9fbae1e 100644
--- a/libs/ui/ISurface.cpp
+++ b/libs/ui/ISurface.cpp
@@ -71,11 +71,10 @@ public:
{
}
- virtual sp<SurfaceBuffer> getBuffer(int usage)
+ virtual sp<SurfaceBuffer> getBuffer()
{
Parcel data, reply;
data.writeInterfaceToken(ISurface::getInterfaceDescriptor());
- data.writeInt32(usage);
remote()->transact(GET_BUFFER, data, &reply);
sp<SurfaceBuffer> buffer = new SurfaceBuffer(reply);
return buffer;
@@ -136,8 +135,7 @@ status_t BnSurface::onTransact(
switch(code) {
case GET_BUFFER: {
CHECK_INTERFACE(ISurface, data, reply);
- int usage = data.readInt32();
- sp<SurfaceBuffer> buffer(getBuffer(usage));
+ sp<SurfaceBuffer> buffer(getBuffer());
return SurfaceBuffer::writeToParcel(reply, buffer.get());
}
case REGISTER_BUFFERS: {
diff --git a/libs/ui/Surface.cpp b/libs/ui/Surface.cpp
index 2b6905f..4abb7f6 100644
--- a/libs/ui/Surface.cpp
+++ b/libs/ui/Surface.cpp
@@ -414,7 +414,6 @@ void Surface::init()
android_native_window_t::lockBuffer = lockBuffer;
android_native_window_t::queueBuffer = queueBuffer;
android_native_window_t::query = query;
- android_native_window_t::perform = perform;
mSwapRectangle.makeInvalid();
DisplayInfo dinfo;
SurfaceComposerClient::getDisplayInfo(0, &dinfo);
@@ -424,8 +423,6 @@ void Surface::init()
const_cast<int&>(android_native_window_t::minSwapInterval) = 1;
const_cast<int&>(android_native_window_t::maxSwapInterval) = 1;
const_cast<uint32_t&>(android_native_window_t::flags) = 0;
- // be default we request a hardware surface
- mUsage = GRALLOC_USAGE_HW_RENDER;
}
@@ -515,17 +512,6 @@ int Surface::query(android_native_window_t* window,
return self->query(what, value);
}
-int Surface::perform(android_native_window_t* window,
- int operation, ...)
-{
- va_list args;
- va_start(args, operation);
- Surface* self = getSelf(window);
- int res = self->perform(operation, args);
- va_end(args);
- return res;
-}
-
// ----------------------------------------------------------------------------
status_t Surface::dequeueBuffer(sp<SurfaceBuffer>* buffer)
@@ -575,7 +561,7 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer)
volatile const surface_info_t* const back = lcblk->surface + backIdx;
if (back->flags & surface_info_t::eNeedNewBuffer) {
- err = getBufferLocked(backIdx, mUsage);
+ err = getBufferLocked(backIdx);
}
if (err == NO_ERROR) {
@@ -641,20 +627,6 @@ int Surface::query(int what, int* value)
return BAD_VALUE;
}
-int Surface::perform(int operation, va_list args)
-{
- int res = NO_ERROR;
- switch (operation) {
- case NATIVE_WINDOW_SET_USAGE:
- mUsage = va_arg(args, int);
- break;
- default:
- res = NAME_NOT_FOUND;
- break;
- }
- return res;
-}
-
// ----------------------------------------------------------------------------
status_t Surface::lock(SurfaceInfo* info, bool blocking) {
@@ -664,9 +636,6 @@ status_t Surface::lock(SurfaceInfo* info, bool blocking) {
status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn, bool blocking)
{
// FIXME: needs some locking here
-
- // we're intending to do software rendering from this point
- mUsage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN;
sp<SurfaceBuffer> backBuffer;
status_t err = dequeueBuffer(&backBuffer);
@@ -756,10 +725,10 @@ void Surface::setSwapRectangle(const Rect& r) {
mSwapRectangle = r;
}
-status_t Surface::getBufferLocked(int index, int usage)
+status_t Surface::getBufferLocked(int index)
{
status_t err = NO_MEMORY;
- sp<SurfaceBuffer> buffer = mSurface->getBuffer(usage);
+ sp<SurfaceBuffer> buffer = mSurface->getBuffer();
LOGE_IF(buffer==0, "ISurface::getBuffer() returned NULL");
if (buffer != 0) {
sp<SurfaceBuffer>& currentBuffer(mBuffers[index]);