Loading services/surfaceflinger/DisplayHardware/HWComposer.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -53,7 +53,9 @@ HWComposer::HWComposer(const sp<SurfaceFlinger>& flinger) if (mHwc->registerProcs) { mCBContext.hwc = this; mCBContext.procs.invalidate = &hook_invalidate; mCBContext.procs.vsync = &hook_vsync; mHwc->registerProcs(mHwc, &mCBContext.procs); memset(mCBContext.procs.zero, 0, sizeof(mCBContext.procs.zero)); } } } Loading @@ -74,10 +76,17 @@ void HWComposer::hook_invalidate(struct hwc_procs* procs) { reinterpret_cast<cb_context *>(procs)->hwc->invalidate(); } void HWComposer::hook_vsync(struct hwc_procs* procs, int dpy, int64_t timestamp) { reinterpret_cast<cb_context *>(procs)->hwc->vsync(dpy, timestamp); } void HWComposer::invalidate() { mFlinger->repaintEverything(); } void HWComposer::vsync(int dpy, int64_t timestamp) { } void HWComposer::setFrameBuffer(EGLDisplay dpy, EGLSurface sur) { mDpy = (hwc_display_t)dpy; mSur = (hwc_surface_t)sur; Loading services/surfaceflinger/DisplayHardware/HWComposer.h +13 −1 Original line number Diff line number Diff line Loading @@ -72,12 +72,24 @@ public: const Vector< sp<LayerBase> >& visibleLayersSortedByZ) const; private: struct callbacks : public hwc_procs_t { // these are here to facilitate the transition when adding // new callbacks (an implementation can check for NULL before // calling a new callback). void (*zero[4])(void); }; struct cb_context { hwc_procs_t procs; callbacks procs; HWComposer* hwc; }; static void hook_invalidate(struct hwc_procs* procs); static void hook_vsync(struct hwc_procs* procs, int dpy, int64_t timestamp); void invalidate(); void vsync(int dpy, int64_t timestamp); sp<SurfaceFlinger> mFlinger; hw_module_t const* mModule; Loading Loading
services/surfaceflinger/DisplayHardware/HWComposer.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -53,7 +53,9 @@ HWComposer::HWComposer(const sp<SurfaceFlinger>& flinger) if (mHwc->registerProcs) { mCBContext.hwc = this; mCBContext.procs.invalidate = &hook_invalidate; mCBContext.procs.vsync = &hook_vsync; mHwc->registerProcs(mHwc, &mCBContext.procs); memset(mCBContext.procs.zero, 0, sizeof(mCBContext.procs.zero)); } } } Loading @@ -74,10 +76,17 @@ void HWComposer::hook_invalidate(struct hwc_procs* procs) { reinterpret_cast<cb_context *>(procs)->hwc->invalidate(); } void HWComposer::hook_vsync(struct hwc_procs* procs, int dpy, int64_t timestamp) { reinterpret_cast<cb_context *>(procs)->hwc->vsync(dpy, timestamp); } void HWComposer::invalidate() { mFlinger->repaintEverything(); } void HWComposer::vsync(int dpy, int64_t timestamp) { } void HWComposer::setFrameBuffer(EGLDisplay dpy, EGLSurface sur) { mDpy = (hwc_display_t)dpy; mSur = (hwc_surface_t)sur; Loading
services/surfaceflinger/DisplayHardware/HWComposer.h +13 −1 Original line number Diff line number Diff line Loading @@ -72,12 +72,24 @@ public: const Vector< sp<LayerBase> >& visibleLayersSortedByZ) const; private: struct callbacks : public hwc_procs_t { // these are here to facilitate the transition when adding // new callbacks (an implementation can check for NULL before // calling a new callback). void (*zero[4])(void); }; struct cb_context { hwc_procs_t procs; callbacks procs; HWComposer* hwc; }; static void hook_invalidate(struct hwc_procs* procs); static void hook_vsync(struct hwc_procs* procs, int dpy, int64_t timestamp); void invalidate(); void vsync(int dpy, int64_t timestamp); sp<SurfaceFlinger> mFlinger; hw_module_t const* mModule; Loading