From: Jamie Gennis Date: Mon, 25 Feb 2013 21:37:54 +0000 (-0800) Subject: SurfaceFlinger: fix a couple NULL fence checks X-Git-Tag: android-x86-4.4-r1~115^2~165 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=789a6c3f;p=android-x86%2Fframeworks-native.git SurfaceFlinger: fix a couple NULL fence checks This change replaces checks for a NULL fence pointer with calls to Fence::isValid. There should no longer be NULL fences. Change-Id: If17c9c132fcb1801531bf7588f8ba53476c57dad --- diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 1401154d3c..439acb52ae 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -526,7 +526,7 @@ void Layer::onPostComposition() { mFrameTracker.setDesiredPresentTime(desiredPresentTime); sp 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 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