Loading include/gui/SurfaceComposerClient.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -133,6 +133,7 @@ public: status_t setPosition(const sp<IBinder>& id, float x, float y); status_t setPosition(const sp<IBinder>& id, float x, float y); status_t setSize(const sp<IBinder>& id, uint32_t w, uint32_t h); status_t setSize(const sp<IBinder>& id, uint32_t w, uint32_t h); status_t setCrop(const sp<IBinder>& id, const Rect& crop); status_t setCrop(const sp<IBinder>& id, const Rect& crop); status_t setFinalCrop(const sp<IBinder>& id, const Rect& crop); status_t setLayerStack(const sp<IBinder>& id, uint32_t layerStack); status_t setLayerStack(const sp<IBinder>& id, uint32_t layerStack); status_t deferTransactionUntil(const sp<IBinder>& id, status_t deferTransactionUntil(const sp<IBinder>& id, const sp<IBinder>& handle, uint64_t frameNumber); const sp<IBinder>& handle, uint64_t frameNumber); Loading include/gui/SurfaceControl.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -71,6 +71,7 @@ public: status_t setAlpha(float alpha=1.0f); status_t setAlpha(float alpha=1.0f); status_t setMatrix(float dsdx, float dtdx, float dsdy, float dtdy); status_t setMatrix(float dsdx, float dtdx, float dsdy, float dtdy); status_t setCrop(const Rect& crop); status_t setCrop(const Rect& crop); status_t setFinalCrop(const Rect& crop); // Defers applying any changes made in this transaction until the Layer // Defers applying any changes made in this transaction until the Layer // identified by handle reaches the given frameNumber // identified by handle reaches the given frameNumber Loading include/private/gui/LayerState.h +5 −2 Original line number Original line Diff line number Diff line Loading @@ -52,14 +52,16 @@ struct layer_state_t { eFlagsChanged = 0x00000040, eFlagsChanged = 0x00000040, eLayerStackChanged = 0x00000080, eLayerStackChanged = 0x00000080, eCropChanged = 0x00000100, eCropChanged = 0x00000100, eDeferTransaction = 0x00000200 eDeferTransaction = 0x00000200, eFinalCropChanged = 0x00000400 }; }; layer_state_t() layer_state_t() : what(0), : what(0), x(0), y(0), z(0), w(0), h(0), layerStack(0), x(0), y(0), z(0), w(0), h(0), layerStack(0), alpha(0), flags(0), mask(0), alpha(0), flags(0), mask(0), reserved(0), crop(Rect::INVALID_RECT), frameNumber(0) reserved(0), crop(Rect::INVALID_RECT), finalCrop(Rect::INVALID_RECT), frameNumber(0) { { matrix.dsdx = matrix.dtdy = 1.0f; matrix.dsdx = matrix.dtdy = 1.0f; matrix.dsdy = matrix.dtdx = 0.0f; matrix.dsdy = matrix.dtdx = 0.0f; Loading Loading @@ -88,6 +90,7 @@ struct layer_state_t { uint8_t reserved; uint8_t reserved; matrix22_t matrix; matrix22_t matrix; Rect crop; Rect crop; Rect finalCrop; sp<IBinder> handle; sp<IBinder> handle; uint64_t frameNumber; uint64_t frameNumber; // non POD must be last. see write/read // non POD must be last. see write/read Loading libs/gui/LayerState.cpp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -38,6 +38,7 @@ status_t layer_state_t::write(Parcel& output) const *reinterpret_cast<layer_state_t::matrix22_t *>( *reinterpret_cast<layer_state_t::matrix22_t *>( output.writeInplace(sizeof(layer_state_t::matrix22_t))) = matrix; output.writeInplace(sizeof(layer_state_t::matrix22_t))) = matrix; output.write(crop); output.write(crop); output.write(finalCrop); output.writeStrongBinder(handle); output.writeStrongBinder(handle); output.writeUint64(frameNumber); output.writeUint64(frameNumber); output.write(transparentRegion); output.write(transparentRegion); Loading @@ -64,6 +65,7 @@ status_t layer_state_t::read(const Parcel& input) return BAD_VALUE; return BAD_VALUE; } } input.read(crop); input.read(crop); input.read(finalCrop); handle = input.readStrongBinder(); handle = input.readStrongBinder(); frameNumber = input.readUint64(); frameNumber = input.readUint64(); input.read(transparentRegion); input.read(transparentRegion); Loading libs/gui/SurfaceComposerClient.cpp +19 −0 Original line number Original line Diff line number Diff line Loading @@ -156,6 +156,8 @@ public: status_t setOrientation(int orientation); status_t setOrientation(int orientation); status_t setCrop(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, status_t setCrop(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, const Rect& crop); const Rect& crop); status_t setFinalCrop(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, const Rect& crop); status_t setLayerStack(const sp<SurfaceComposerClient>& client, status_t setLayerStack(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, uint32_t layerStack); const sp<IBinder>& id, uint32_t layerStack); status_t deferTransactionUntil(const sp<SurfaceComposerClient>& client, status_t deferTransactionUntil(const sp<SurfaceComposerClient>& client, Loading Loading @@ -386,6 +388,18 @@ status_t Composer::setCrop(const sp<SurfaceComposerClient>& client, return NO_ERROR; return NO_ERROR; } } status_t Composer::setFinalCrop(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, const Rect& crop) { Mutex::Autolock _l(mLock); layer_state_t* s = getLayerStateLocked(client, id); if (!s) { return BAD_INDEX; } s->what |= layer_state_t::eFinalCropChanged; s->finalCrop = crop; return NO_ERROR; } status_t Composer::deferTransactionUntil( status_t Composer::deferTransactionUntil( const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, const sp<IBinder>& handle, uint64_t frameNumber) { const sp<IBinder>& handle, uint64_t frameNumber) { Loading Loading @@ -579,6 +593,11 @@ status_t SurfaceComposerClient::setCrop(const sp<IBinder>& id, const Rect& crop) return getComposer().setCrop(this, id, crop); return getComposer().setCrop(this, id, crop); } } status_t SurfaceComposerClient::setFinalCrop(const sp<IBinder>& id, const Rect& crop) { return getComposer().setFinalCrop(this, id, crop); } status_t SurfaceComposerClient::setPosition(const sp<IBinder>& id, float x, float y) { status_t SurfaceComposerClient::setPosition(const sp<IBinder>& id, float x, float y) { return getComposer().setPosition(this, id, x, y); return getComposer().setPosition(this, id, x, y); } } Loading Loading
include/gui/SurfaceComposerClient.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -133,6 +133,7 @@ public: status_t setPosition(const sp<IBinder>& id, float x, float y); status_t setPosition(const sp<IBinder>& id, float x, float y); status_t setSize(const sp<IBinder>& id, uint32_t w, uint32_t h); status_t setSize(const sp<IBinder>& id, uint32_t w, uint32_t h); status_t setCrop(const sp<IBinder>& id, const Rect& crop); status_t setCrop(const sp<IBinder>& id, const Rect& crop); status_t setFinalCrop(const sp<IBinder>& id, const Rect& crop); status_t setLayerStack(const sp<IBinder>& id, uint32_t layerStack); status_t setLayerStack(const sp<IBinder>& id, uint32_t layerStack); status_t deferTransactionUntil(const sp<IBinder>& id, status_t deferTransactionUntil(const sp<IBinder>& id, const sp<IBinder>& handle, uint64_t frameNumber); const sp<IBinder>& handle, uint64_t frameNumber); Loading
include/gui/SurfaceControl.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -71,6 +71,7 @@ public: status_t setAlpha(float alpha=1.0f); status_t setAlpha(float alpha=1.0f); status_t setMatrix(float dsdx, float dtdx, float dsdy, float dtdy); status_t setMatrix(float dsdx, float dtdx, float dsdy, float dtdy); status_t setCrop(const Rect& crop); status_t setCrop(const Rect& crop); status_t setFinalCrop(const Rect& crop); // Defers applying any changes made in this transaction until the Layer // Defers applying any changes made in this transaction until the Layer // identified by handle reaches the given frameNumber // identified by handle reaches the given frameNumber Loading
include/private/gui/LayerState.h +5 −2 Original line number Original line Diff line number Diff line Loading @@ -52,14 +52,16 @@ struct layer_state_t { eFlagsChanged = 0x00000040, eFlagsChanged = 0x00000040, eLayerStackChanged = 0x00000080, eLayerStackChanged = 0x00000080, eCropChanged = 0x00000100, eCropChanged = 0x00000100, eDeferTransaction = 0x00000200 eDeferTransaction = 0x00000200, eFinalCropChanged = 0x00000400 }; }; layer_state_t() layer_state_t() : what(0), : what(0), x(0), y(0), z(0), w(0), h(0), layerStack(0), x(0), y(0), z(0), w(0), h(0), layerStack(0), alpha(0), flags(0), mask(0), alpha(0), flags(0), mask(0), reserved(0), crop(Rect::INVALID_RECT), frameNumber(0) reserved(0), crop(Rect::INVALID_RECT), finalCrop(Rect::INVALID_RECT), frameNumber(0) { { matrix.dsdx = matrix.dtdy = 1.0f; matrix.dsdx = matrix.dtdy = 1.0f; matrix.dsdy = matrix.dtdx = 0.0f; matrix.dsdy = matrix.dtdx = 0.0f; Loading Loading @@ -88,6 +90,7 @@ struct layer_state_t { uint8_t reserved; uint8_t reserved; matrix22_t matrix; matrix22_t matrix; Rect crop; Rect crop; Rect finalCrop; sp<IBinder> handle; sp<IBinder> handle; uint64_t frameNumber; uint64_t frameNumber; // non POD must be last. see write/read // non POD must be last. see write/read Loading
libs/gui/LayerState.cpp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -38,6 +38,7 @@ status_t layer_state_t::write(Parcel& output) const *reinterpret_cast<layer_state_t::matrix22_t *>( *reinterpret_cast<layer_state_t::matrix22_t *>( output.writeInplace(sizeof(layer_state_t::matrix22_t))) = matrix; output.writeInplace(sizeof(layer_state_t::matrix22_t))) = matrix; output.write(crop); output.write(crop); output.write(finalCrop); output.writeStrongBinder(handle); output.writeStrongBinder(handle); output.writeUint64(frameNumber); output.writeUint64(frameNumber); output.write(transparentRegion); output.write(transparentRegion); Loading @@ -64,6 +65,7 @@ status_t layer_state_t::read(const Parcel& input) return BAD_VALUE; return BAD_VALUE; } } input.read(crop); input.read(crop); input.read(finalCrop); handle = input.readStrongBinder(); handle = input.readStrongBinder(); frameNumber = input.readUint64(); frameNumber = input.readUint64(); input.read(transparentRegion); input.read(transparentRegion); Loading
libs/gui/SurfaceComposerClient.cpp +19 −0 Original line number Original line Diff line number Diff line Loading @@ -156,6 +156,8 @@ public: status_t setOrientation(int orientation); status_t setOrientation(int orientation); status_t setCrop(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, status_t setCrop(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, const Rect& crop); const Rect& crop); status_t setFinalCrop(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, const Rect& crop); status_t setLayerStack(const sp<SurfaceComposerClient>& client, status_t setLayerStack(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, uint32_t layerStack); const sp<IBinder>& id, uint32_t layerStack); status_t deferTransactionUntil(const sp<SurfaceComposerClient>& client, status_t deferTransactionUntil(const sp<SurfaceComposerClient>& client, Loading Loading @@ -386,6 +388,18 @@ status_t Composer::setCrop(const sp<SurfaceComposerClient>& client, return NO_ERROR; return NO_ERROR; } } status_t Composer::setFinalCrop(const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, const Rect& crop) { Mutex::Autolock _l(mLock); layer_state_t* s = getLayerStateLocked(client, id); if (!s) { return BAD_INDEX; } s->what |= layer_state_t::eFinalCropChanged; s->finalCrop = crop; return NO_ERROR; } status_t Composer::deferTransactionUntil( status_t Composer::deferTransactionUntil( const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, const sp<SurfaceComposerClient>& client, const sp<IBinder>& id, const sp<IBinder>& handle, uint64_t frameNumber) { const sp<IBinder>& handle, uint64_t frameNumber) { Loading Loading @@ -579,6 +593,11 @@ status_t SurfaceComposerClient::setCrop(const sp<IBinder>& id, const Rect& crop) return getComposer().setCrop(this, id, crop); return getComposer().setCrop(this, id, crop); } } status_t SurfaceComposerClient::setFinalCrop(const sp<IBinder>& id, const Rect& crop) { return getComposer().setFinalCrop(this, id, crop); } status_t SurfaceComposerClient::setPosition(const sp<IBinder>& id, float x, float y) { status_t SurfaceComposerClient::setPosition(const sp<IBinder>& id, float x, float y) { return getComposer().setPosition(this, id, x, y); return getComposer().setPosition(this, id, x, y); } } Loading