diff options
| author | Mathias Agopian <mathias@google.com> | 2009-05-04 19:29:25 -0700 |
|---|---|---|
| committer | Mathias Agopian <mathias@google.com> | 2009-05-07 15:07:33 -0700 |
| commit | 2e20bffbab8084fedce39d14d7dd17b08f6e9ba2 (patch) | |
| tree | be397ea1383b74bc09e48d591ca7aa2cc54f0539 /libs/surfaceflinger/SurfaceFlinger.cpp | |
| parent | 9bd5da4db97fec7cdbe6e07870411c1fcaff4365 (diff) | |
| download | frameworks_base-2e20bffbab8084fedce39d14d7dd17b08f6e9ba2.zip frameworks_base-2e20bffbab8084fedce39d14d7dd17b08f6e9ba2.tar.gz frameworks_base-2e20bffbab8084fedce39d14d7dd17b08f6e9ba2.tar.bz2 | |
created an new EGL extension called ANDROID_swap_rectangle
ANDROID_swap_rectangle allows to specify the rectangle affected by eglSwapBuffers(), anything outside of this rectangle is unchanged. in particular EGL_BUFFER_DESTROYED only applies to that rectangle. This extension as well as EGL_BUFFER_PRESERVED allow major optimizations on surfaceflinger, which can redraw only the dirty area during compositing.
However, ANDROID_swap_rectangle allows further optimizations in EGL by reducing the amount of copy-back needed. ANDROID_swap_rectangle is particularily important for software implementations.
Diffstat (limited to 'libs/surfaceflinger/SurfaceFlinger.cpp')
| -rw-r--r-- | libs/surfaceflinger/SurfaceFlinger.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp index 5fd979e..b8c246c 100644 --- a/libs/surfaceflinger/SurfaceFlinger.cpp +++ b/libs/surfaceflinger/SurfaceFlinger.cpp @@ -803,12 +803,14 @@ void SurfaceFlinger::handleRepaint() mInvalidRegion.orSelf(mDirtyRegion); uint32_t flags = hw.getFlags(); - if (flags & DisplayHardware::BUFFER_PRESERVED) { - // here we assume DisplayHardware::flip()'s implementation - // performs the copy-back optimization. + if ((flags & DisplayHardware::SWAP_RECTANGLE) || + (flags & DisplayHardware::BUFFER_PRESERVED)) + { + // we can redraw only what's dirty } else { if (flags & DisplayHardware::UPDATE_ON_DEMAND) { - // we need to fully redraw the part that will be updated + // we need to redraw the rectangle that will be updated + // (pushed to the framebuffer). mDirtyRegion.set(mInvalidRegion.bounds()); } else { // we need to redraw everything @@ -890,7 +892,9 @@ void SurfaceFlinger::debugFlashRegions() { const DisplayHardware& hw(graphicPlane(0).displayHardware()); const uint32_t flags = hw.getFlags(); - if (!(flags & DisplayHardware::BUFFER_PRESERVED)) { + + if (!((flags & DisplayHardware::SWAP_RECTANGLE) || + (flags & DisplayHardware::BUFFER_PRESERVED))) { const Region repaint((flags & DisplayHardware::UPDATE_ON_DEMAND) ? mDirtyRegion.bounds() : hw.bounds()); composeSurfaces(repaint); |
