From 9ef9d51ec9ded43d03d045f623edfa9ddd6d8620 Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Mon, 25 Feb 2013 13:37:54 -0800 Subject: [PATCH 1/2] 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 --- services/surfaceflinger/Layer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 1401154d3..439acb52a 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 From 0d69ad5d651ac3438cfdd527f6f26901e459d53e Mon Sep 17 00:00:00 2001 From: Dave Burke Date: Fri, 1 Mar 2013 20:39:03 +0000 Subject: [PATCH 2/2] Revert "Change SurfaceControl setPosition to take floats" Temporary, to fix weekend build, until we get Nvidia code drop. This reverts commit 9a867a8798fa6ea21f6341db31e38ea64fde6c83 DO NOT MERGE Change-Id: I7b5dbc4db46ef3d97dc8598057d5487d6971178b --- include/gui/SurfaceControl.h | 2 +- libs/gui/SurfaceControl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/gui/SurfaceControl.h b/include/gui/SurfaceControl.h index 9268e7dc8..f70888ddf 100644 --- a/include/gui/SurfaceControl.h +++ b/include/gui/SurfaceControl.h @@ -57,7 +57,7 @@ public: status_t setLayerStack(int32_t layerStack); status_t setLayer(int32_t layer); - status_t setPosition(float x, float y); + status_t setPosition(int32_t x, int32_t y); status_t setSize(uint32_t w, uint32_t h); status_t hide(); status_t show(); diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp index e621b22a0..ef52269b0 100644 --- a/libs/gui/SurfaceControl.cpp +++ b/libs/gui/SurfaceControl.cpp @@ -106,7 +106,7 @@ status_t SurfaceControl::setLayer(int32_t layer) { const sp& client(mClient); return client->setLayer(mSurface, layer); } -status_t SurfaceControl::setPosition(float x, float y) { +status_t SurfaceControl::setPosition(int32_t x, int32_t y) { status_t err = validate(); if (err < 0) return err; const sp& client(mClient);