summaryrefslogtreecommitdiffstats
path: root/libs/ui/FramebufferNativeWindow.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-07-30 18:14:56 -0700
committerMathias Agopian <mathias@google.com>2009-07-30 18:14:56 -0700
commitcb6b9041647b4f080324742eee5ce709960ff610 (patch)
tree14e5efafa0eace5d3a7943dc9c6316880ef22d11 /libs/ui/FramebufferNativeWindow.cpp
parent69bdcb9b7b5089984bf474f30029fa024f519e47 (diff)
downloadframeworks_native-cb6b9041647b4f080324742eee5ce709960ff610.zip
frameworks_native-cb6b9041647b4f080324742eee5ce709960ff610.tar.gz
frameworks_native-cb6b9041647b4f080324742eee5ce709960ff610.tar.bz2
fixed some issues with the software renderer when surfaces are made current.
there was several issues: - when a surface was made non-current, the last frame wasn't shown and the buffer could stay locked - when a surface was made current the 2nd time, it would not dequeue a new buffer now, queue/dequeue are done when the surface is made current. for this to work, a new query() hook had to be added on android_native_window_t, it allows to retrieve some attributes of a window (currently only width and height).
Diffstat (limited to 'libs/ui/FramebufferNativeWindow.cpp')
-rw-r--r--libs/ui/FramebufferNativeWindow.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp
index 8c8fd6b..8b7ea21 100644
--- a/libs/ui/FramebufferNativeWindow.cpp
+++ b/libs/ui/FramebufferNativeWindow.cpp
@@ -124,6 +124,7 @@ FramebufferNativeWindow::FramebufferNativeWindow()
android_native_window_t::dequeueBuffer = dequeueBuffer;
android_native_window_t::lockBuffer = lockBuffer;
android_native_window_t::queueBuffer = queueBuffer;
+ android_native_window_t::query = query;
}
FramebufferNativeWindow::~FramebufferNativeWindow() {
@@ -198,6 +199,23 @@ int FramebufferNativeWindow::queueBuffer(android_native_window_t* window,
return res;
}
+int FramebufferNativeWindow::query(android_native_window_t* window,
+ int what, int* value)
+{
+ FramebufferNativeWindow* self = getSelf(window);
+ Mutex::Autolock _l(self->mutex);
+ framebuffer_device_t* fb = self->fbDev;
+ switch (what) {
+ case NATIVE_WINDOW_WIDTH:
+ *value = fb->width;
+ return NO_ERROR;
+ case NATIVE_WINDOW_HEIGHT:
+ *value = fb->height;
+ return NO_ERROR;
+ }
+ return BAD_VALUE;
+}
+
// ----------------------------------------------------------------------------
}; // namespace android
// ----------------------------------------------------------------------------