From 97b8056c3182a973c67d3c1b196150d4b9e30f3a Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Thu, 7 May 2009 17:40:23 -0700 Subject: add support for update-on-demand in SurfaceFlinger --- libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp') diff --git a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp index 31db31f..25e351c 100644 --- a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp +++ b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp @@ -183,9 +183,11 @@ void DisplayHardware::init(uint32_t dpy) LOGI("extensions: %s", egl_extensions); LOGI("Client API: %s", eglQueryString(display, EGL_CLIENT_APIS)?:"Not Supported"); - // TODO: get the real "update_on_demand" behavior (probably should be HAL module) - // FIXME: mFlags |= UPDATE_ON_DEMAND; + if (mNativeWindow->isUpdateOnDemand()) { + mFlags |= UPDATE_ON_DEMAND; + } + if (eglGetConfigAttrib(display, config, EGL_CONFIG_CAVEAT, &dummy) == EGL_TRUE) { if (dummy == EGL_SLOW_CONFIG) mFlags |= SLOW_CONFIG; @@ -210,7 +212,7 @@ void DisplayHardware::init(uint32_t dpy) mDpiX = mNativeWindow->xdpi; mDpiX = mNativeWindow->ydpi; - mRefreshRate = mNativeWindow->getDevice()->fps; + mRefreshRate = fbDev->fps; char property[PROPERTY_VALUE_MAX]; if (property_get("ro.sf.lcd_density", property, NULL) <= 0) { @@ -314,6 +316,10 @@ void DisplayHardware::flip(const Region& dirty) const b.left, b.top, b.width(), b.height()); } + if (mFlags & UPDATE_ON_DEMAND) { + mNativeWindow->setUpdateRectangle(dirty.bounds()); + } + mPageFlipCount++; eglSwapBuffers(dpy, surface); checkEGLErrors("eglSwapBuffers"); -- cgit v1.1