File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -466,6 +466,18 @@ bool Layer::setBypass(bool enable)
466466 return true ;
467467}
468468
469+ void Layer::updateBuffersOrientation ()
470+ {
471+ sp<GraphicBuffer> buffer (getBypassBuffer ());
472+ if (buffer != NULL && mOrientation != buffer->transform ) {
473+ ClientRef::Access sharedClient (mUserClientRef );
474+ SharedBufferServer* lcblk (sharedClient.get ());
475+ if (lcblk) { // all buffers need reallocation
476+ lcblk->reallocateAll ();
477+ }
478+ }
479+ }
480+
469481uint32_t Layer::doTransaction (uint32_t flags)
470482{
471483 const Layer::State& front (drawingState ());
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ class Layer : public LayerBaseClient
8383 virtual void onRemoved ();
8484 virtual bool setBypass (bool enable);
8585
86+ void updateBuffersOrientation ();
87+
8688 inline sp<GraphicBuffer> getBypassBuffer () const {
8789 return mBufferManager .getActiveBuffer (); }
8890
Original file line number Diff line number Diff line change @@ -725,8 +725,12 @@ void SurfaceFlinger::setBypassLayer(const sp<LayerBase>& layer)
725725{
726726 // if this layer is already the bypass layer, do nothing
727727 sp<Layer> cur (mBypassLayer .promote ());
728- if (mBypassLayer == layer)
728+ if (mBypassLayer == layer) {
729+ if (cur != NULL ) {
730+ cur->updateBuffersOrientation ();
731+ }
729732 return ;
733+ }
730734
731735 // clear the current bypass layer
732736 mBypassLayer .clear ();
You can’t perform that action at this time.
0 commit comments