Loading libs/gui/LayerState.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,7 @@ status_t layer_state_t::write(Parcel& output) const output.writeInt32(frameRateSelectionPriority); output.writeFloat(frameRate); output.writeByte(frameRateCompatibility); output.writeUint32(fixedTransformHint); return NO_ERROR; } Loading Loading @@ -198,6 +199,7 @@ status_t layer_state_t::read(const Parcel& input) frameRateSelectionPriority = input.readInt32(); frameRate = input.readFloat(); frameRateCompatibility = input.readByte(); fixedTransformHint = static_cast<ui::Transform::RotationFlags>(input.readUint32()); return NO_ERROR; } Loading Loading @@ -433,6 +435,10 @@ void layer_state_t::merge(const layer_state_t& other) { frameRate = other.frameRate; frameRateCompatibility = other.frameRateCompatibility; } if (other.what & eFixedTransformHintChanged) { what |= eFixedTransformHintChanged; fixedTransformHint = other.fixedTransformHint; } if ((other.what & what) != other.what) { ALOGE("Unmerged SurfaceComposer Transaction properties. LayerState::merge needs updating? " "other.what=0x%" PRIu64 " what=0x%" PRIu64, Loading libs/gui/SurfaceComposerClient.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -1437,6 +1437,22 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrame return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFixedTransformHint( const sp<SurfaceControl>& sc, int32_t fixedTransformHint) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } const ui::Transform::RotationFlags transform = fixedTransformHint == -1 ? ui::Transform::ROT_INVALID : ui::Transform::toRotationFlags(static_cast<ui::Rotation>(fixedTransformHint)); s->what |= layer_state_t::eFixedTransformHintChanged; s->fixedTransformHint = transform; return *this; } // --------------------------------------------------------------------------- DisplayState& SurfaceComposerClient::Transaction::getDisplayState(const sp<IBinder>& token) { Loading libs/gui/include/gui/LayerState.h +13 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include <ui/Rect.h> #include <ui/Region.h> #include <ui/Rotation.h> #include <ui/Transform.h> #include <utils/Errors.h> namespace android { Loading Loading @@ -103,6 +104,7 @@ struct layer_state_t { eFrameRateChanged = 0x40'00000000, eBackgroundBlurRadiusChanged = 0x80'00000000, eProducerDisconnect = 0x100'00000000, eFixedTransformHintChanged = 0x200'00000000, }; layer_state_t() Loading Loading @@ -136,7 +138,8 @@ struct layer_state_t { shadowRadius(0.0f), frameRateSelectionPriority(-1), frameRate(0.0f), frameRateCompatibility(ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT) { frameRateCompatibility(ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT), fixedTransformHint(ui::Transform::ROT_INVALID) { matrix.dsdx = matrix.dtdy = 1.0f; matrix.dsdy = matrix.dtdx = 0.0f; hdrMetadata.validTypes = 0; Loading Loading @@ -225,6 +228,15 @@ struct layer_state_t { // Layer frame rate and compatibility. See ANativeWindow_setFrameRate(). float frameRate; int8_t frameRateCompatibility; // Set by window manager indicating the layer and all its children are // in a different orientation than the display. The hint suggests that // the graphic producers should receive a transform hint as if the // display was in this orientation. When the display changes to match // the layer orientation, the graphic producer may not need to allocate // a buffer of a different size. -1 means the transform hint is not set, // otherwise the value will be a valid ui::Rotation. ui::Transform::RotationFlags fixedTransformHint; }; struct ComposerState { Loading libs/gui/include/gui/SurfaceComposerClient.h +8 −0 Original line number Diff line number Diff line Loading @@ -519,6 +519,14 @@ public: Transaction& setFrameRate(const sp<SurfaceControl>& sc, float frameRate, int8_t compatibility); // Set by window manager indicating the layer and all its children are // in a different orientation than the display. The hint suggests that // the graphic producers should receive a transform hint as if the // display was in this orientation. When the display changes to match // the layer orientation, the graphic producer may not need to allocate // a buffer of a different size. Transaction& setFixedTransformHint(const sp<SurfaceControl>& sc, int32_t transformHint); status_t setDisplaySurface(const sp<IBinder>& token, const sp<IGraphicBufferProducer>& bufferProducer); Loading services/surfaceflinger/BufferLayer.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -843,6 +843,13 @@ void BufferLayer::updateCloneBufferInfo() { mDrawingState.inputInfo = tmpInputInfo; } void BufferLayer::setTransformHint(ui::Transform::RotationFlags displayTransformHint) const { mTransformHint = getFixedTransformHint(); if (mTransformHint == ui::Transform::ROT_INVALID) { mTransformHint = displayTransformHint; } } } // namespace android #if defined(__gl_h_) Loading Loading
libs/gui/LayerState.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,7 @@ status_t layer_state_t::write(Parcel& output) const output.writeInt32(frameRateSelectionPriority); output.writeFloat(frameRate); output.writeByte(frameRateCompatibility); output.writeUint32(fixedTransformHint); return NO_ERROR; } Loading Loading @@ -198,6 +199,7 @@ status_t layer_state_t::read(const Parcel& input) frameRateSelectionPriority = input.readInt32(); frameRate = input.readFloat(); frameRateCompatibility = input.readByte(); fixedTransformHint = static_cast<ui::Transform::RotationFlags>(input.readUint32()); return NO_ERROR; } Loading Loading @@ -433,6 +435,10 @@ void layer_state_t::merge(const layer_state_t& other) { frameRate = other.frameRate; frameRateCompatibility = other.frameRateCompatibility; } if (other.what & eFixedTransformHintChanged) { what |= eFixedTransformHintChanged; fixedTransformHint = other.fixedTransformHint; } if ((other.what & what) != other.what) { ALOGE("Unmerged SurfaceComposer Transaction properties. LayerState::merge needs updating? " "other.what=0x%" PRIu64 " what=0x%" PRIu64, Loading
libs/gui/SurfaceComposerClient.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -1437,6 +1437,22 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrame return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFixedTransformHint( const sp<SurfaceControl>& sc, int32_t fixedTransformHint) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } const ui::Transform::RotationFlags transform = fixedTransformHint == -1 ? ui::Transform::ROT_INVALID : ui::Transform::toRotationFlags(static_cast<ui::Rotation>(fixedTransformHint)); s->what |= layer_state_t::eFixedTransformHintChanged; s->fixedTransformHint = transform; return *this; } // --------------------------------------------------------------------------- DisplayState& SurfaceComposerClient::Transaction::getDisplayState(const sp<IBinder>& token) { Loading
libs/gui/include/gui/LayerState.h +13 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ #include <ui/Rect.h> #include <ui/Region.h> #include <ui/Rotation.h> #include <ui/Transform.h> #include <utils/Errors.h> namespace android { Loading Loading @@ -103,6 +104,7 @@ struct layer_state_t { eFrameRateChanged = 0x40'00000000, eBackgroundBlurRadiusChanged = 0x80'00000000, eProducerDisconnect = 0x100'00000000, eFixedTransformHintChanged = 0x200'00000000, }; layer_state_t() Loading Loading @@ -136,7 +138,8 @@ struct layer_state_t { shadowRadius(0.0f), frameRateSelectionPriority(-1), frameRate(0.0f), frameRateCompatibility(ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT) { frameRateCompatibility(ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT), fixedTransformHint(ui::Transform::ROT_INVALID) { matrix.dsdx = matrix.dtdy = 1.0f; matrix.dsdy = matrix.dtdx = 0.0f; hdrMetadata.validTypes = 0; Loading Loading @@ -225,6 +228,15 @@ struct layer_state_t { // Layer frame rate and compatibility. See ANativeWindow_setFrameRate(). float frameRate; int8_t frameRateCompatibility; // Set by window manager indicating the layer and all its children are // in a different orientation than the display. The hint suggests that // the graphic producers should receive a transform hint as if the // display was in this orientation. When the display changes to match // the layer orientation, the graphic producer may not need to allocate // a buffer of a different size. -1 means the transform hint is not set, // otherwise the value will be a valid ui::Rotation. ui::Transform::RotationFlags fixedTransformHint; }; struct ComposerState { Loading
libs/gui/include/gui/SurfaceComposerClient.h +8 −0 Original line number Diff line number Diff line Loading @@ -519,6 +519,14 @@ public: Transaction& setFrameRate(const sp<SurfaceControl>& sc, float frameRate, int8_t compatibility); // Set by window manager indicating the layer and all its children are // in a different orientation than the display. The hint suggests that // the graphic producers should receive a transform hint as if the // display was in this orientation. When the display changes to match // the layer orientation, the graphic producer may not need to allocate // a buffer of a different size. Transaction& setFixedTransformHint(const sp<SurfaceControl>& sc, int32_t transformHint); status_t setDisplaySurface(const sp<IBinder>& token, const sp<IGraphicBufferProducer>& bufferProducer); Loading
services/surfaceflinger/BufferLayer.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -843,6 +843,13 @@ void BufferLayer::updateCloneBufferInfo() { mDrawingState.inputInfo = tmpInputInfo; } void BufferLayer::setTransformHint(ui::Transform::RotationFlags displayTransformHint) const { mTransformHint = getFixedTransformHint(); if (mTransformHint == ui::Transform::ROT_INVALID) { mTransformHint = displayTransformHint; } } } // namespace android #if defined(__gl_h_) Loading