OSDN Git Service

Merge "add some missing parameter validation in GLES java bindings" into jb-mr2-dev
authorMathias Agopian <mathias@google.com>
Tue, 26 Feb 2013 00:53:13 +0000 (00:53 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 26 Feb 2013 00:53:13 +0000 (00:53 +0000)
services/surfaceflinger/Layer.cpp

index 1401154..439acb5 100644 (file)
@@ -526,7 +526,7 @@ void Layer::onPostComposition() {
         mFrameTracker.setDesiredPresentTime(desiredPresentTime);
 
         sp<Fence> frameReadyFence = mSurfaceFlingerConsumer->getCurrentFence();
-        if (frameReadyFence != NULL) {
+        if (frameReadyFence->isValid()) {
             mFrameTracker.setFrameReadyFence(frameReadyFence);
         } else {
             // There was no fence for this frame, so assume that it was ready
@@ -536,7 +536,7 @@ void Layer::onPostComposition() {
 
         const HWComposer& hwc = mFlinger->getHwComposer();
         sp<Fence> presentFence = hwc.getDisplayFence(HWC_DISPLAY_PRIMARY);
-        if (presentFence != NULL) {
+        if (presentFence->isValid()) {
             mFrameTracker.setActualPresentFence(presentFence);
         } else {
             // The HWC doesn't support present fences, so use the refresh