Loading libs/gui/ISurfaceComposer.cpp +24 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,18 @@ public: return reply.readInt32(); } virtual status_t captureLayers(const sp<IBinder>& layerHandleBinder, const sp<IGraphicBufferProducer>& producer, ISurfaceComposer::Rotation rotation) { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); data.writeStrongBinder(layerHandleBinder); data.writeStrongBinder(IInterface::asBinder(producer)); data.writeInt32(static_cast<int32_t>(rotation)); remote()->transact(BnSurfaceComposer::CAPTURE_LAYERS, data, &reply); return reply.readInt32(); } virtual bool authenticateSurfaceTexture( const sp<IGraphicBufferProducer>& bufferProducer) const { Loading Loading @@ -588,6 +600,18 @@ status_t BnSurfaceComposer::onTransact( reply->writeInt32(res); return NO_ERROR; } case CAPTURE_LAYERS: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> layerHandleBinder = data.readStrongBinder(); sp<IGraphicBufferProducer> producer = interface_cast<IGraphicBufferProducer>(data.readStrongBinder()); int32_t rotation = data.readInt32(); status_t res = captureLayers(layerHandleBinder, producer, static_cast<ISurfaceComposer::Rotation>(rotation)); reply->writeInt32(res); return NO_ERROR; } case AUTHENTICATE_SURFACE: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IGraphicBufferProducer> bufferProducer = Loading libs/gui/SurfaceComposerClient.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -731,6 +731,15 @@ status_t ScreenshotClient::captureToBuffer(const sp<IBinder>& display, return ret; } status_t ScreenshotClient::captureLayers(const sp<IBinder>& layerHandle, const sp<IGraphicBufferProducer>& producer, uint32_t rotation) { sp<ISurfaceComposer> s(ComposerService::getComposerService()); if (s == NULL) return NO_INIT; return s->captureLayers(layerHandle, producer, static_cast<ISurfaceComposer::Rotation>(rotation)); } ScreenshotClient::ScreenshotClient() : mHaveBuffer(false) { memset(&mBuffer, 0, sizeof(mBuffer)); Loading libs/gui/include/gui/ISurfaceComposer.h +5 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,10 @@ public: bool useIdentityTransform, Rotation rotation = eRotateNone) = 0; virtual status_t captureLayers(const sp<IBinder>& layerHandleBinder, const sp<IGraphicBufferProducer>& producer, Rotation rotation = eRotateNone) = 0; /* Clears the frame statistics for animations. * * Requires the ACCESS_SURFACE_FLINGER permission. Loading Loading @@ -226,6 +230,7 @@ public: SET_ACTIVE_CONFIG, CONNECT_DISPLAY, CAPTURE_SCREEN, CAPTURE_LAYERS, CLEAR_ANIMATION_FRAME_STATS, GET_ANIMATION_FRAME_STATS, SET_POWER_MODE, Loading libs/gui/include/gui/SurfaceComposerClient.h +3 −0 Original line number Diff line number Diff line Loading @@ -297,6 +297,9 @@ public: bool useIdentityTransform, uint32_t rotation, sp<GraphicBuffer>* outbuffer); static status_t captureLayers(const sp<IBinder>& layerHandle, const sp<IGraphicBufferProducer>& producer, uint32_t rotation); private: mutable sp<CpuConsumer> mCpuConsumer; mutable sp<IGraphicBufferProducer> mProducer; Loading libs/gui/tests/Surface_test.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -529,6 +529,11 @@ public: int32_t /*minLayerZ*/, int32_t /*maxLayerZ*/, bool /*useIdentityTransform*/, Rotation /*rotation*/) override { return NO_ERROR; } virtual status_t captureLayers(const sp<IBinder>& /*parentHandle*/, const sp<IGraphicBufferProducer>& /*producer*/, ISurfaceComposer::Rotation /*rotation*/) override { return NO_ERROR; } status_t clearAnimationFrameStats() override { return NO_ERROR; } status_t getAnimationFrameStats(FrameStats* /*outStats*/) const override { return NO_ERROR; Loading Loading
libs/gui/ISurfaceComposer.cpp +24 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,18 @@ public: return reply.readInt32(); } virtual status_t captureLayers(const sp<IBinder>& layerHandleBinder, const sp<IGraphicBufferProducer>& producer, ISurfaceComposer::Rotation rotation) { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); data.writeStrongBinder(layerHandleBinder); data.writeStrongBinder(IInterface::asBinder(producer)); data.writeInt32(static_cast<int32_t>(rotation)); remote()->transact(BnSurfaceComposer::CAPTURE_LAYERS, data, &reply); return reply.readInt32(); } virtual bool authenticateSurfaceTexture( const sp<IGraphicBufferProducer>& bufferProducer) const { Loading Loading @@ -588,6 +600,18 @@ status_t BnSurfaceComposer::onTransact( reply->writeInt32(res); return NO_ERROR; } case CAPTURE_LAYERS: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> layerHandleBinder = data.readStrongBinder(); sp<IGraphicBufferProducer> producer = interface_cast<IGraphicBufferProducer>(data.readStrongBinder()); int32_t rotation = data.readInt32(); status_t res = captureLayers(layerHandleBinder, producer, static_cast<ISurfaceComposer::Rotation>(rotation)); reply->writeInt32(res); return NO_ERROR; } case AUTHENTICATE_SURFACE: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IGraphicBufferProducer> bufferProducer = Loading
libs/gui/SurfaceComposerClient.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -731,6 +731,15 @@ status_t ScreenshotClient::captureToBuffer(const sp<IBinder>& display, return ret; } status_t ScreenshotClient::captureLayers(const sp<IBinder>& layerHandle, const sp<IGraphicBufferProducer>& producer, uint32_t rotation) { sp<ISurfaceComposer> s(ComposerService::getComposerService()); if (s == NULL) return NO_INIT; return s->captureLayers(layerHandle, producer, static_cast<ISurfaceComposer::Rotation>(rotation)); } ScreenshotClient::ScreenshotClient() : mHaveBuffer(false) { memset(&mBuffer, 0, sizeof(mBuffer)); Loading
libs/gui/include/gui/ISurfaceComposer.h +5 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,10 @@ public: bool useIdentityTransform, Rotation rotation = eRotateNone) = 0; virtual status_t captureLayers(const sp<IBinder>& layerHandleBinder, const sp<IGraphicBufferProducer>& producer, Rotation rotation = eRotateNone) = 0; /* Clears the frame statistics for animations. * * Requires the ACCESS_SURFACE_FLINGER permission. Loading Loading @@ -226,6 +230,7 @@ public: SET_ACTIVE_CONFIG, CONNECT_DISPLAY, CAPTURE_SCREEN, CAPTURE_LAYERS, CLEAR_ANIMATION_FRAME_STATS, GET_ANIMATION_FRAME_STATS, SET_POWER_MODE, Loading
libs/gui/include/gui/SurfaceComposerClient.h +3 −0 Original line number Diff line number Diff line Loading @@ -297,6 +297,9 @@ public: bool useIdentityTransform, uint32_t rotation, sp<GraphicBuffer>* outbuffer); static status_t captureLayers(const sp<IBinder>& layerHandle, const sp<IGraphicBufferProducer>& producer, uint32_t rotation); private: mutable sp<CpuConsumer> mCpuConsumer; mutable sp<IGraphicBufferProducer> mProducer; Loading
libs/gui/tests/Surface_test.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -529,6 +529,11 @@ public: int32_t /*minLayerZ*/, int32_t /*maxLayerZ*/, bool /*useIdentityTransform*/, Rotation /*rotation*/) override { return NO_ERROR; } virtual status_t captureLayers(const sp<IBinder>& /*parentHandle*/, const sp<IGraphicBufferProducer>& /*producer*/, ISurfaceComposer::Rotation /*rotation*/) override { return NO_ERROR; } status_t clearAnimationFrameStats() override { return NO_ERROR; } status_t getAnimationFrameStats(FrameStats* /*outStats*/) const override { return NO_ERROR; Loading