diff options
| author | Romain Guy <romainguy@google.com> | 2011-03-07 18:06:46 -0800 |
|---|---|---|
| committer | Romain Guy <romainguy@google.com> | 2011-03-07 18:09:03 -0800 |
| commit | cabfcc1364eb7e4de0b15b3574fba45027b45cfc (patch) | |
| tree | f38e237ba2009dcacb5082a99928aad379a7adc0 /libs/hwui/DisplayListRenderer.cpp | |
| parent | 9b7146db6d9c0586b98b062fbcdb3fac6cc54d19 (diff) | |
| download | frameworks_base-cabfcc1364eb7e4de0b15b3574fba45027b45cfc.zip frameworks_base-cabfcc1364eb7e4de0b15b3574fba45027b45cfc.tar.gz frameworks_base-cabfcc1364eb7e4de0b15b3574fba45027b45cfc.tar.bz2 | |
Add support for partial invalidates in WebView
Bug #3461349
This change also fixes two bugs that prevented partial invalidates
from working with other views. Both bugs were in our EGL implementation:
they were preventing the caller from comparing the current context/surface
with another context/surface. This was causing HardwareRenderer to always
redraw the entire screen.
Change-Id: I33e096b304d4a0b7e6c8f92930f71d2ece9bebf5
Diffstat (limited to 'libs/hwui/DisplayListRenderer.cpp')
| -rw-r--r-- | libs/hwui/DisplayListRenderer.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp index d5d2ba0..737fa02 100644 --- a/libs/hwui/DisplayListRenderer.cpp +++ b/libs/hwui/DisplayListRenderer.cpp @@ -166,7 +166,7 @@ void DisplayList::initFromDisplayListRenderer(const DisplayListRenderer& recorde void DisplayList::init() { } -bool DisplayList::replay(OpenGLRenderer& renderer, uint32_t level) { +bool DisplayList::replay(OpenGLRenderer& renderer, Rect& dirty, uint32_t level) { bool needsInvalidate = false; TextContainer text; mReader.rewind(); @@ -189,7 +189,7 @@ bool DisplayList::replay(OpenGLRenderer& renderer, uint32_t level) { case DrawGLFunction: { Functor *functor = (Functor *) getInt(); DISPLAY_LIST_LOGD("%s%s %p", (char*) indent, OP_NAMES[op], functor); - needsInvalidate |= renderer.callDrawGLFunction(functor); + needsInvalidate |= renderer.callDrawGLFunction(functor, dirty); } break; case Save: { @@ -287,7 +287,7 @@ bool DisplayList::replay(OpenGLRenderer& renderer, uint32_t level) { DisplayList* displayList = getDisplayList(); DISPLAY_LIST_LOGD("%s%s %p, %d", (char*) indent, OP_NAMES[op], displayList, level + 1); - needsInvalidate |= renderer.drawDisplayList(displayList, level + 1); + needsInvalidate |= renderer.drawDisplayList(displayList, dirty, level + 1); } break; case DrawLayer: { @@ -589,7 +589,8 @@ void DisplayListRenderer::interrupt() { void DisplayListRenderer::resume() { } -bool DisplayListRenderer::callDrawGLFunction(Functor *functor) { +bool DisplayListRenderer::callDrawGLFunction(Functor *functor, Rect& dirty) { + // Ignore dirty during recording, it matters only when we replay addOp(DisplayList::DrawGLFunction); addInt((int) functor); return false; // No invalidate needed at record-time @@ -673,7 +674,9 @@ bool DisplayListRenderer::clipRect(float left, float top, float right, float bot return OpenGLRenderer::clipRect(left, top, right, bottom, op); } -bool DisplayListRenderer::drawDisplayList(DisplayList* displayList, uint32_t level) { +bool DisplayListRenderer::drawDisplayList(DisplayList* displayList, Rect& dirty, uint32_t level) { + // dirty is an out parameter and should not be recorded, + // it matters only when replaying the display list addOp(DisplayList::DrawDisplayList); addDisplayList(displayList); return false; |
