Loading services/surfaceflinger/Android.mk +3 −0 Original line number Diff line number Diff line Loading @@ -75,11 +75,14 @@ include $(BUILD_SHARED_LIBRARY) # build surfaceflinger's executable include $(CLEAR_VARS) LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\" LOCAL_SRC_FILES:= \ main_surfaceflinger.cpp LOCAL_SHARED_LIBRARIES := \ libsurfaceflinger \ liblog \ libbinder \ libutils Loading services/surfaceflinger/Client.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <sys/types.h> #include <binder/PermissionCache.h> #include <binder/IPCThreadState.h> #include <private/android_filesystem_config.h> Loading services/surfaceflinger/DisplayDevice.h +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #include <EGL/eglext.h> #include <utils/Mutex.h> #include <utils/String8.h> #include <utils/Timers.h> #include <hardware/hwcomposer_defs.h> Loading services/surfaceflinger/SurfaceFlinger.cpp +13 −18 Original line number Diff line number Diff line Loading @@ -22,6 +22,10 @@ #include <math.h> #include <dlfcn.h> #if defined(HAVE_PTHREADS) #include <sys/resource.h> #endif #include <EGL/egl.h> #include <cutils/log.h> Loading Loading @@ -70,7 +74,6 @@ #include "RenderEngine/RenderEngine.h" #define DISPLAY_COUNT 1 /* Loading @@ -92,7 +95,7 @@ const String16 sDump("android.permission.DUMP"); // --------------------------------------------------------------------------- SurfaceFlinger::SurfaceFlinger() : BnSurfaceComposer(), Thread(false), : BnSurfaceComposer(), mTransactionFlags(0), mTransactionPending(false), mAnimTransactionPending(false), Loading Loading @@ -139,14 +142,8 @@ SurfaceFlinger::SurfaceFlinger() void SurfaceFlinger::onFirstRef() { mEventQueue.init(this); run("SurfaceFlinger", PRIORITY_URGENT_DISPLAY); // Wait for the main thread to be done with its initialization mReadyToRunBarrier.wait(); } SurfaceFlinger::~SurfaceFlinger() { EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); Loading Loading @@ -414,9 +411,8 @@ success: return config; } void SurfaceFlinger::init() { status_t SurfaceFlinger::readyToRun() { ALOGI( "SurfaceFlinger's main thread ready to run. " "Initializing graphics H/W..."); Loading Loading @@ -498,16 +494,11 @@ status_t SurfaceFlinger::readyToRun() // initialize our drawing state mDrawingState = mCurrentState; // We're now ready to accept clients... mReadyToRunBarrier.open(); // set initial conditions (e.g. unblank default device) initializeDisplays(); // start boot animation startBootAnim(); return NO_ERROR; } int32_t SurfaceFlinger::allocateHwcDisplayId(DisplayDevice::DisplayType type) { Loading Loading @@ -648,9 +639,13 @@ status_t SurfaceFlinger::postMessageSync(const sp<MessageBase>& msg, return res; } bool SurfaceFlinger::threadLoop() { void SurfaceFlinger::run() { #if defined(HAVE_PTHREADS) setpriority(PRIO_PROCESS, 0, PRIORITY_URGENT_DISPLAY); #endif do { waitForEvent(); return true; } while (true); } void SurfaceFlinger::onVSyncReceived(int type, nsecs_t timestamp) { Loading services/surfaceflinger/SurfaceFlinger.h +8 −8 Original line number Diff line number Diff line Loading @@ -35,7 +35,6 @@ #include <utils/SortedVector.h> #include <utils/threads.h> #include <binder/BinderService.h> #include <binder/IMemory.h> #include <ui/PixelFormat.h> Loading Loading @@ -76,10 +75,8 @@ enum { eTransactionMask = 0x07 }; class SurfaceFlinger : public BinderService<SurfaceFlinger>, public BnSurfaceComposer, class SurfaceFlinger : public BnSurfaceComposer, private IBinder::DeathRecipient, private Thread, private HWComposer::EventHandler { public: Loading @@ -89,6 +86,12 @@ public: SurfaceFlinger() ANDROID_API; // must be called before clients can connect void init() ANDROID_API; // starts SurfaceFlinger main loop in the current thread void run() ANDROID_API; enum { EVENT_VSYNC = HWC_EVENT_VSYNC }; Loading Loading @@ -209,10 +212,8 @@ private: virtual void binderDied(const wp<IBinder>& who); /* ------------------------------------------------------------------------ * Thread interface * RefBase interface */ virtual bool threadLoop(); virtual status_t readyToRun(); virtual void onFirstRef(); /* ------------------------------------------------------------------------ Loading Loading @@ -447,7 +448,6 @@ private: // these are thread safe mutable MessageQueue mEventQueue; mutable Barrier mReadyToRunBarrier; FrameTracker mAnimFrameTracker; // protected by mDestroyedLayerLock; Loading Loading
services/surfaceflinger/Android.mk +3 −0 Original line number Diff line number Diff line Loading @@ -75,11 +75,14 @@ include $(BUILD_SHARED_LIBRARY) # build surfaceflinger's executable include $(CLEAR_VARS) LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\" LOCAL_SRC_FILES:= \ main_surfaceflinger.cpp LOCAL_SHARED_LIBRARIES := \ libsurfaceflinger \ liblog \ libbinder \ libutils Loading
services/surfaceflinger/Client.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <sys/types.h> #include <binder/PermissionCache.h> #include <binder/IPCThreadState.h> #include <private/android_filesystem_config.h> Loading
services/surfaceflinger/DisplayDevice.h +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ #include <EGL/eglext.h> #include <utils/Mutex.h> #include <utils/String8.h> #include <utils/Timers.h> #include <hardware/hwcomposer_defs.h> Loading
services/surfaceflinger/SurfaceFlinger.cpp +13 −18 Original line number Diff line number Diff line Loading @@ -22,6 +22,10 @@ #include <math.h> #include <dlfcn.h> #if defined(HAVE_PTHREADS) #include <sys/resource.h> #endif #include <EGL/egl.h> #include <cutils/log.h> Loading Loading @@ -70,7 +74,6 @@ #include "RenderEngine/RenderEngine.h" #define DISPLAY_COUNT 1 /* Loading @@ -92,7 +95,7 @@ const String16 sDump("android.permission.DUMP"); // --------------------------------------------------------------------------- SurfaceFlinger::SurfaceFlinger() : BnSurfaceComposer(), Thread(false), : BnSurfaceComposer(), mTransactionFlags(0), mTransactionPending(false), mAnimTransactionPending(false), Loading Loading @@ -139,14 +142,8 @@ SurfaceFlinger::SurfaceFlinger() void SurfaceFlinger::onFirstRef() { mEventQueue.init(this); run("SurfaceFlinger", PRIORITY_URGENT_DISPLAY); // Wait for the main thread to be done with its initialization mReadyToRunBarrier.wait(); } SurfaceFlinger::~SurfaceFlinger() { EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); Loading Loading @@ -414,9 +411,8 @@ success: return config; } void SurfaceFlinger::init() { status_t SurfaceFlinger::readyToRun() { ALOGI( "SurfaceFlinger's main thread ready to run. " "Initializing graphics H/W..."); Loading Loading @@ -498,16 +494,11 @@ status_t SurfaceFlinger::readyToRun() // initialize our drawing state mDrawingState = mCurrentState; // We're now ready to accept clients... mReadyToRunBarrier.open(); // set initial conditions (e.g. unblank default device) initializeDisplays(); // start boot animation startBootAnim(); return NO_ERROR; } int32_t SurfaceFlinger::allocateHwcDisplayId(DisplayDevice::DisplayType type) { Loading Loading @@ -648,9 +639,13 @@ status_t SurfaceFlinger::postMessageSync(const sp<MessageBase>& msg, return res; } bool SurfaceFlinger::threadLoop() { void SurfaceFlinger::run() { #if defined(HAVE_PTHREADS) setpriority(PRIO_PROCESS, 0, PRIORITY_URGENT_DISPLAY); #endif do { waitForEvent(); return true; } while (true); } void SurfaceFlinger::onVSyncReceived(int type, nsecs_t timestamp) { Loading
services/surfaceflinger/SurfaceFlinger.h +8 −8 Original line number Diff line number Diff line Loading @@ -35,7 +35,6 @@ #include <utils/SortedVector.h> #include <utils/threads.h> #include <binder/BinderService.h> #include <binder/IMemory.h> #include <ui/PixelFormat.h> Loading Loading @@ -76,10 +75,8 @@ enum { eTransactionMask = 0x07 }; class SurfaceFlinger : public BinderService<SurfaceFlinger>, public BnSurfaceComposer, class SurfaceFlinger : public BnSurfaceComposer, private IBinder::DeathRecipient, private Thread, private HWComposer::EventHandler { public: Loading @@ -89,6 +86,12 @@ public: SurfaceFlinger() ANDROID_API; // must be called before clients can connect void init() ANDROID_API; // starts SurfaceFlinger main loop in the current thread void run() ANDROID_API; enum { EVENT_VSYNC = HWC_EVENT_VSYNC }; Loading Loading @@ -209,10 +212,8 @@ private: virtual void binderDied(const wp<IBinder>& who); /* ------------------------------------------------------------------------ * Thread interface * RefBase interface */ virtual bool threadLoop(); virtual status_t readyToRun(); virtual void onFirstRef(); /* ------------------------------------------------------------------------ Loading Loading @@ -447,7 +448,6 @@ private: // these are thread safe mutable MessageQueue mEventQueue; mutable Barrier mReadyToRunBarrier; FrameTracker mAnimFrameTracker; // protected by mDestroyedLayerLock; Loading