OSDN Git Service

handle surfaces posts independently from composition
authorMathias Agopian <mathias@google.com>
Sun, 25 Mar 2012 00:47:24 +0000 (17:47 -0700)
committerMathias Agopian <mathias@google.com>
Thu, 12 Apr 2012 01:17:30 +0000 (18:17 -0700)
surfaceflinger will now handle each surface post
as soon as possible and handle the composition
itself at VSYNC time as usual.

Change-Id: I6b1ae33fd56062d86e5419ebab8def0ca5803fbf

services/surfaceflinger/MessageQueue.cpp
services/surfaceflinger/SurfaceFlinger.cpp

index 290fff4..1ff3567 100644 (file)
@@ -133,8 +133,7 @@ status_t MessageQueue::postMessage(
 }
 
 void MessageQueue::invalidate() {
-//    mHandler->signalInvalidate();
-    mEvents->requestNextVsync();
+    mHandler->signalInvalidate();
 }
 
 void MessageQueue::refresh() {
index ce6c4a0..c68f5c1 100644 (file)
@@ -407,8 +407,7 @@ void SurfaceFlinger::onMessageReceived(int32_t what)
 {
     ATRACE_CALL();
     switch (what) {
-        case MessageQueue::REFRESH: {
-//        case MessageQueue::INVALIDATE: {
+        case MessageQueue::INVALIDATE: {
             // if we're in a global transaction, don't do anything.
             const uint32_t mask = eTransactionNeeded | eTraversalNeeded;
             uint32_t transactionFlags = peekTransactionFlags(mask);
@@ -419,20 +418,16 @@ void SurfaceFlinger::onMessageReceived(int32_t what)
             // post surfaces (if needed)
             handlePageFlip();
 
-//            signalRefresh();
-//
-//        } break;
-//
-//        case MessageQueue::REFRESH: {
+            signalRefresh();
+
+        } break;
+
+        case MessageQueue::REFRESH: {
 
             handleRefresh();
 
             const DisplayHardware& hw(graphicPlane(0).displayHardware());
 
-//            if (mDirtyRegion.isEmpty()) {
-//                return;
-//            }
-
             if (CC_UNLIKELY(mHwWorkListDirty)) {
                 // build the h/w work list
                 handleWorkList();