Loading include/gui/BufferQueue.h +2 −0 Original line number Diff line number Diff line Loading @@ -402,9 +402,11 @@ private: Rect mCrop; // mTransform is the current transform flags for this buffer slot. // (example: NATIVE_WINDOW_TRANSFORM_ROT_90) uint32_t mTransform; // mScalingMode is the current scaling mode for this buffer slot. // (example: NATIVE_WINDOW_SCALING_MODE_FREEZE) uint32_t mScalingMode; // mTimestamp is the current timestamp for this buffer slot. This gets Loading libs/gui/BufferQueue.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ status_t BufferQueue::setConsumerUsageBits(uint32_t usage) { } status_t BufferQueue::setTransformHint(uint32_t hint) { ST_LOGV("setTransformHint: %02x", hint); Mutex::Autolock lock(mMutex); mTransformHint = hint; return OK; Loading Loading @@ -737,9 +738,10 @@ void BufferQueue::dump(String8& result, const char* prefix, snprintf(buffer, SIZE, "%s-BufferQueue maxBufferCount=%d, mSynchronousMode=%d, default-size=[%dx%d], " "default-format=%d, FIFO(%d)={%s}\n", "default-format=%d, transform-hint=%02x, FIFO(%d)={%s}\n", prefix, maxBufferCount, mSynchronousMode, mDefaultWidth, mDefaultHeight, mDefaultBufferFormat, fifoSize, fifo.string()); mDefaultHeight, mDefaultBufferFormat, mTransformHint, fifoSize, fifo.string()); result.append(buffer); Loading services/surfaceflinger/Layer.cpp +10 −12 Original line number Diff line number Diff line Loading @@ -109,6 +109,8 @@ void Layer::onFirstRef() #else mSurfaceTexture->setDefaultMaxBufferCount(3); #endif updateTransformHint(); } Layer::~Layer() Loading Loading @@ -429,12 +431,12 @@ uint32_t Layer::doTransaction(uint32_t flags) if (sizeChanged) { // the size changed, we need to ask our client to request a new buffer ALOGD_IF(DEBUG_RESIZE, "doTransaction: geometry (layer=%p), scalingMode=%d\n" "doTransaction: geometry (layer=%p '%s'), tr=%02x, scalingMode=%d\n" " current={ active ={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }\n" " requested={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }}\n" " drawing={ active ={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }\n" " requested={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }}\n", this, mCurrentScalingMode, this, (const char*) getName(), mCurrentTransform, mCurrentScalingMode, temp.active.w, temp.active.h, temp.active.crop.left, temp.active.crop.top, Loading Loading @@ -597,10 +599,10 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions) } ALOGD_IF(DEBUG_RESIZE, "lockPageFlip: (layer=%p), buffer (%ux%u, tr=%02x), scalingMode=%d\n" "latchBuffer/reject: buffer (%ux%u, tr=%02x), scalingMode=%d\n" " drawing={ active ={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }\n" " requested={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }}\n", this, bufWidth, bufHeight, item.mTransform, item.mScalingMode, bufWidth, bufHeight, item.mTransform, item.mScalingMode, front.active.w, front.active.h, front.active.crop.left, front.active.crop.top, Loading Loading @@ -631,10 +633,6 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions) Reject r(mDrawingState, currentState(), recomputeVisibleRegions); // XXX: not sure if setTransformHint belongs here // it should only be needed when the main screen orientation changes mSurfaceTexture->setTransformHint(getTransformHint()); if (mSurfaceTexture->updateTexImage(&r) < NO_ERROR) { // something happened! recomputeVisibleRegions = true; Loading Loading @@ -711,9 +709,9 @@ void Layer::dump(String8& result, char* buffer, size_t SIZE) const snprintf(buffer, SIZE, " " "format=%2d, activeBuffer=[%4ux%4u:%4u,%3X]," " transform-hint=0x%02x, queued-frames=%d, mRefreshPending=%d\n", " queued-frames=%d, mRefreshPending=%d\n", mFormat, w0, h0, s0,f0, getTransformHint(), mQueuedFrames, mRefreshPending); mQueuedFrames, mRefreshPending); result.append(buffer); Loading Loading @@ -759,7 +757,7 @@ uint32_t Layer::getEffectiveUsage(uint32_t usage) const return usage; } uint32_t Layer::getTransformHint() const { void Layer::updateTransformHint() const { uint32_t orientation = 0; if (!mFlinger->mDebugDisableTransformHint) { // The transform hint is used to improve performance on the main Loading @@ -774,7 +772,7 @@ uint32_t Layer::getTransformHint() const { orientation = 0; } } return orientation; mSurfaceTexture->setTransformHint(orientation); } // --------------------------------------------------------------------------- Loading services/surfaceflinger/Layer.h +4 −1 Original line number Diff line number Diff line Loading @@ -89,6 +89,10 @@ public: // only for debugging inline const sp<GraphicBuffer>& getActiveBuffer() const { return mActiveBuffer; } // Updates the transform hint in our SurfaceTexture to match // the current orientation of the default display device. virtual void updateTransformHint() const; protected: virtual void onFirstRef(); virtual void dump(String8& result, char* scratch, size_t size) const; Loading @@ -100,7 +104,6 @@ private: void onFrameQueued(); virtual sp<ISurface> createSurface(); uint32_t getEffectiveUsage(uint32_t usage) const; uint32_t getTransformHint() const; bool isCropped() const; Rect computeBufferCrop() const; static bool getOpacityForFormat(uint32_t format); Loading services/surfaceflinger/LayerBase.h +6 −0 Original line number Diff line number Diff line Loading @@ -229,6 +229,12 @@ public: */ virtual void onPostComposition() { } /** * Updates the SurfaceTexture's transform hint, for layers that have * a SurfaceTexture. */ virtual void updateTransformHint() const { } /** always call base class first */ virtual void dump(String8& result, char* scratch, size_t size) const; virtual void shortDump(String8& result, char* scratch, size_t size) const; Loading Loading
include/gui/BufferQueue.h +2 −0 Original line number Diff line number Diff line Loading @@ -402,9 +402,11 @@ private: Rect mCrop; // mTransform is the current transform flags for this buffer slot. // (example: NATIVE_WINDOW_TRANSFORM_ROT_90) uint32_t mTransform; // mScalingMode is the current scaling mode for this buffer slot. // (example: NATIVE_WINDOW_SCALING_MODE_FREEZE) uint32_t mScalingMode; // mTimestamp is the current timestamp for this buffer slot. This gets Loading
libs/gui/BufferQueue.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ status_t BufferQueue::setConsumerUsageBits(uint32_t usage) { } status_t BufferQueue::setTransformHint(uint32_t hint) { ST_LOGV("setTransformHint: %02x", hint); Mutex::Autolock lock(mMutex); mTransformHint = hint; return OK; Loading Loading @@ -737,9 +738,10 @@ void BufferQueue::dump(String8& result, const char* prefix, snprintf(buffer, SIZE, "%s-BufferQueue maxBufferCount=%d, mSynchronousMode=%d, default-size=[%dx%d], " "default-format=%d, FIFO(%d)={%s}\n", "default-format=%d, transform-hint=%02x, FIFO(%d)={%s}\n", prefix, maxBufferCount, mSynchronousMode, mDefaultWidth, mDefaultHeight, mDefaultBufferFormat, fifoSize, fifo.string()); mDefaultHeight, mDefaultBufferFormat, mTransformHint, fifoSize, fifo.string()); result.append(buffer); Loading
services/surfaceflinger/Layer.cpp +10 −12 Original line number Diff line number Diff line Loading @@ -109,6 +109,8 @@ void Layer::onFirstRef() #else mSurfaceTexture->setDefaultMaxBufferCount(3); #endif updateTransformHint(); } Layer::~Layer() Loading Loading @@ -429,12 +431,12 @@ uint32_t Layer::doTransaction(uint32_t flags) if (sizeChanged) { // the size changed, we need to ask our client to request a new buffer ALOGD_IF(DEBUG_RESIZE, "doTransaction: geometry (layer=%p), scalingMode=%d\n" "doTransaction: geometry (layer=%p '%s'), tr=%02x, scalingMode=%d\n" " current={ active ={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }\n" " requested={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }}\n" " drawing={ active ={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }\n" " requested={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }}\n", this, mCurrentScalingMode, this, (const char*) getName(), mCurrentTransform, mCurrentScalingMode, temp.active.w, temp.active.h, temp.active.crop.left, temp.active.crop.top, Loading Loading @@ -597,10 +599,10 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions) } ALOGD_IF(DEBUG_RESIZE, "lockPageFlip: (layer=%p), buffer (%ux%u, tr=%02x), scalingMode=%d\n" "latchBuffer/reject: buffer (%ux%u, tr=%02x), scalingMode=%d\n" " drawing={ active ={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }\n" " requested={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }}\n", this, bufWidth, bufHeight, item.mTransform, item.mScalingMode, bufWidth, bufHeight, item.mTransform, item.mScalingMode, front.active.w, front.active.h, front.active.crop.left, front.active.crop.top, Loading Loading @@ -631,10 +633,6 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions) Reject r(mDrawingState, currentState(), recomputeVisibleRegions); // XXX: not sure if setTransformHint belongs here // it should only be needed when the main screen orientation changes mSurfaceTexture->setTransformHint(getTransformHint()); if (mSurfaceTexture->updateTexImage(&r) < NO_ERROR) { // something happened! recomputeVisibleRegions = true; Loading Loading @@ -711,9 +709,9 @@ void Layer::dump(String8& result, char* buffer, size_t SIZE) const snprintf(buffer, SIZE, " " "format=%2d, activeBuffer=[%4ux%4u:%4u,%3X]," " transform-hint=0x%02x, queued-frames=%d, mRefreshPending=%d\n", " queued-frames=%d, mRefreshPending=%d\n", mFormat, w0, h0, s0,f0, getTransformHint(), mQueuedFrames, mRefreshPending); mQueuedFrames, mRefreshPending); result.append(buffer); Loading Loading @@ -759,7 +757,7 @@ uint32_t Layer::getEffectiveUsage(uint32_t usage) const return usage; } uint32_t Layer::getTransformHint() const { void Layer::updateTransformHint() const { uint32_t orientation = 0; if (!mFlinger->mDebugDisableTransformHint) { // The transform hint is used to improve performance on the main Loading @@ -774,7 +772,7 @@ uint32_t Layer::getTransformHint() const { orientation = 0; } } return orientation; mSurfaceTexture->setTransformHint(orientation); } // --------------------------------------------------------------------------- Loading
services/surfaceflinger/Layer.h +4 −1 Original line number Diff line number Diff line Loading @@ -89,6 +89,10 @@ public: // only for debugging inline const sp<GraphicBuffer>& getActiveBuffer() const { return mActiveBuffer; } // Updates the transform hint in our SurfaceTexture to match // the current orientation of the default display device. virtual void updateTransformHint() const; protected: virtual void onFirstRef(); virtual void dump(String8& result, char* scratch, size_t size) const; Loading @@ -100,7 +104,6 @@ private: void onFrameQueued(); virtual sp<ISurface> createSurface(); uint32_t getEffectiveUsage(uint32_t usage) const; uint32_t getTransformHint() const; bool isCropped() const; Rect computeBufferCrop() const; static bool getOpacityForFormat(uint32_t format); Loading
services/surfaceflinger/LayerBase.h +6 −0 Original line number Diff line number Diff line Loading @@ -229,6 +229,12 @@ public: */ virtual void onPostComposition() { } /** * Updates the SurfaceTexture's transform hint, for layers that have * a SurfaceTexture. */ virtual void updateTransformHint() const { } /** always call base class first */ virtual void dump(String8& result, char* scratch, size_t size) const; virtual void shortDump(String8& result, char* scratch, size_t size) const; Loading