Loading libs/gui/SurfaceComposerClient.cpp +21 −3 Original line number Diff line number Diff line Loading @@ -611,8 +611,26 @@ sp<SurfaceControl> SurfaceComposerClient::createSurface( SurfaceControl* parent, uint32_t windowType, uint32_t ownerUid) { sp<SurfaceControl> s; createSurfaceChecked(name, w, h, format, &s, flags, parent, windowType, ownerUid); return s; } status_t SurfaceComposerClient::createSurfaceChecked( const String8& name, uint32_t w, uint32_t h, PixelFormat format, sp<SurfaceControl>* outSurface, uint32_t flags, SurfaceControl* parent, uint32_t windowType, uint32_t ownerUid) { sp<SurfaceControl> sur; status_t err = NO_ERROR; if (mStatus == NO_ERROR) { sp<IBinder> handle; sp<IBinder> parentHandle; Loading @@ -621,14 +639,14 @@ sp<SurfaceControl> SurfaceComposerClient::createSurface( if (parent != nullptr) { parentHandle = parent->getHandle(); } status_t err = mClient->createSurface(name, w, h, format, flags, parentHandle, err = mClient->createSurface(name, w, h, format, flags, parentHandle, windowType, ownerUid, &handle, &gbp); ALOGE_IF(err, "SurfaceComposerClient::createSurface error %s", strerror(-err)); if (err == NO_ERROR) { sur = new SurfaceControl(this, handle, gbp, true /* owned */); *outSurface = new SurfaceControl(this, handle, gbp, true /* owned */); } } return sur; return err; } status_t SurfaceComposerClient::destroySurface(const sp<IBinder>& sid) { Loading libs/gui/include/gui/SurfaceComposerClient.h +12 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,18 @@ public: uint32_t ownerUid = 0 // UID of the task ); status_t createSurfaceChecked( const String8& name,// name of the surface uint32_t w, // width in pixel uint32_t h, // height in pixel PixelFormat format, // pixel-format desired sp<SurfaceControl>* outSurface, uint32_t flags = 0, // usage flags SurfaceControl* parent = nullptr, // parent uint32_t windowType = 0, // from WindowManager.java (STATUS_BAR, INPUT_METHOD, etc.) uint32_t ownerUid = 0 // UID of the task ); //! Create a virtual display static sp<IBinder> createDisplay(const String8& displayName, bool secure); Loading Loading
libs/gui/SurfaceComposerClient.cpp +21 −3 Original line number Diff line number Diff line Loading @@ -611,8 +611,26 @@ sp<SurfaceControl> SurfaceComposerClient::createSurface( SurfaceControl* parent, uint32_t windowType, uint32_t ownerUid) { sp<SurfaceControl> s; createSurfaceChecked(name, w, h, format, &s, flags, parent, windowType, ownerUid); return s; } status_t SurfaceComposerClient::createSurfaceChecked( const String8& name, uint32_t w, uint32_t h, PixelFormat format, sp<SurfaceControl>* outSurface, uint32_t flags, SurfaceControl* parent, uint32_t windowType, uint32_t ownerUid) { sp<SurfaceControl> sur; status_t err = NO_ERROR; if (mStatus == NO_ERROR) { sp<IBinder> handle; sp<IBinder> parentHandle; Loading @@ -621,14 +639,14 @@ sp<SurfaceControl> SurfaceComposerClient::createSurface( if (parent != nullptr) { parentHandle = parent->getHandle(); } status_t err = mClient->createSurface(name, w, h, format, flags, parentHandle, err = mClient->createSurface(name, w, h, format, flags, parentHandle, windowType, ownerUid, &handle, &gbp); ALOGE_IF(err, "SurfaceComposerClient::createSurface error %s", strerror(-err)); if (err == NO_ERROR) { sur = new SurfaceControl(this, handle, gbp, true /* owned */); *outSurface = new SurfaceControl(this, handle, gbp, true /* owned */); } } return sur; return err; } status_t SurfaceComposerClient::destroySurface(const sp<IBinder>& sid) { Loading
libs/gui/include/gui/SurfaceComposerClient.h +12 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,18 @@ public: uint32_t ownerUid = 0 // UID of the task ); status_t createSurfaceChecked( const String8& name,// name of the surface uint32_t w, // width in pixel uint32_t h, // height in pixel PixelFormat format, // pixel-format desired sp<SurfaceControl>* outSurface, uint32_t flags = 0, // usage flags SurfaceControl* parent = nullptr, // parent uint32_t windowType = 0, // from WindowManager.java (STATUS_BAR, INPUT_METHOD, etc.) uint32_t ownerUid = 0 // UID of the task ); //! Create a virtual display static sp<IBinder> createDisplay(const String8& displayName, bool secure); Loading