Loading services/surfaceflinger/SurfaceFlinger.cpp +5 −7 Original line number Original line Diff line number Diff line Loading @@ -600,7 +600,7 @@ sp<FreezeLock> SurfaceFlinger::getFreezeLock() const } } void SurfaceFlinger::computeVisibleRegions( void SurfaceFlinger::computeVisibleRegions( LayerVector& currentLayers, Region& dirtyRegion, Region& opaqueRegion) const LayerVector& currentLayers, Region& dirtyRegion, Region& opaqueRegion) { { const GraphicPlane& plane(graphicPlane(0)); const GraphicPlane& plane(graphicPlane(0)); const Transform& planeTransform(plane.transform()); const Transform& planeTransform(plane.transform()); Loading Loading @@ -735,8 +735,7 @@ void SurfaceFlinger::commitTransaction() void SurfaceFlinger::handlePageFlip() void SurfaceFlinger::handlePageFlip() { { bool visibleRegions = mVisibleRegionsDirty; bool visibleRegions = mVisibleRegionsDirty; LayerVector& currentLayers( const LayerVector& currentLayers(mDrawingState.layersSortedByZ); const_cast<LayerVector&>(mDrawingState.layersSortedByZ)); visibleRegions |= lockPageFlip(currentLayers); visibleRegions |= lockPageFlip(currentLayers); const DisplayHardware& hw = graphicPlane(0).displayHardware(); const DisplayHardware& hw = graphicPlane(0).displayHardware(); Loading @@ -748,9 +747,8 @@ void SurfaceFlinger::handlePageFlip() /* /* * rebuild the visible layer list * rebuild the visible layer list */ */ const size_t count = currentLayers.size(); mVisibleLayersSortedByZ.clear(); mVisibleLayersSortedByZ.clear(); const LayerVector& currentLayers(mDrawingState.layersSortedByZ); size_t count = currentLayers.size(); mVisibleLayersSortedByZ.setCapacity(count); mVisibleLayersSortedByZ.setCapacity(count); for (size_t i=0 ; i<count ; i++) { for (size_t i=0 ; i<count ; i++) { if (!currentLayers[i]->visibleRegionScreen.isEmpty()) if (!currentLayers[i]->visibleRegionScreen.isEmpty()) Loading Loading @@ -2515,7 +2513,7 @@ ssize_t UserClient::getTokenForSurface(const sp<ISurface>& sur) const } } break; break; } } if (++name >= SharedBufferStack::NUM_LAYERS_MAX) if (++name >= int32_t(SharedBufferStack::NUM_LAYERS_MAX)) name = NO_MEMORY; name = NO_MEMORY; } while(name >= 0); } while(name >= 0); Loading Loading @@ -2562,7 +2560,7 @@ sp<GraphicBuffer> GraphicBufferAlloc::createGraphicBuffer(uint32_t w, uint32_t h void GraphicBufferAlloc::freeAllGraphicBuffersExcept(int bufIdx) { void GraphicBufferAlloc::freeAllGraphicBuffersExcept(int bufIdx) { Mutex::Autolock _l(mLock); Mutex::Autolock _l(mLock); if (0 <= bufIdx && bufIdx < mBuffers.size()) { if (bufIdx >= 0 && size_t(bufIdx) < mBuffers.size()) { sp<GraphicBuffer> b(mBuffers[bufIdx]); sp<GraphicBuffer> b(mBuffers[bufIdx]); mBuffers.clear(); mBuffers.clear(); mBuffers.add(b); mBuffers.add(b); Loading services/surfaceflinger/SurfaceFlinger.h +2 −2 Original line number Original line Diff line number Diff line Loading @@ -304,7 +304,7 @@ private: Vector< sp<LayerBase> >& ditchedLayers); Vector< sp<LayerBase> >& ditchedLayers); void computeVisibleRegions( void computeVisibleRegions( LayerVector& currentLayers, const LayerVector& currentLayers, Region& dirtyRegion, Region& dirtyRegion, Region& wormholeRegion); Region& wormholeRegion); Loading Loading @@ -371,7 +371,6 @@ private: // access must be protected by mStateLock // access must be protected by mStateLock mutable Mutex mStateLock; mutable Mutex mStateLock; State mCurrentState; State mCurrentState; State mDrawingState; volatile int32_t mTransactionFlags; volatile int32_t mTransactionFlags; volatile int32_t mTransactionCount; volatile int32_t mTransactionCount; Condition mTransactionCV; Condition mTransactionCV; Loading @@ -395,6 +394,7 @@ private: // Can only accessed from the main thread, these members // Can only accessed from the main thread, these members // don't need synchronization // don't need synchronization State mDrawingState; Region mDirtyRegion; Region mDirtyRegion; Region mDirtyRegionRemovedLayer; Region mDirtyRegionRemovedLayer; Region mInvalidRegion; Region mInvalidRegion; Loading Loading
services/surfaceflinger/SurfaceFlinger.cpp +5 −7 Original line number Original line Diff line number Diff line Loading @@ -600,7 +600,7 @@ sp<FreezeLock> SurfaceFlinger::getFreezeLock() const } } void SurfaceFlinger::computeVisibleRegions( void SurfaceFlinger::computeVisibleRegions( LayerVector& currentLayers, Region& dirtyRegion, Region& opaqueRegion) const LayerVector& currentLayers, Region& dirtyRegion, Region& opaqueRegion) { { const GraphicPlane& plane(graphicPlane(0)); const GraphicPlane& plane(graphicPlane(0)); const Transform& planeTransform(plane.transform()); const Transform& planeTransform(plane.transform()); Loading Loading @@ -735,8 +735,7 @@ void SurfaceFlinger::commitTransaction() void SurfaceFlinger::handlePageFlip() void SurfaceFlinger::handlePageFlip() { { bool visibleRegions = mVisibleRegionsDirty; bool visibleRegions = mVisibleRegionsDirty; LayerVector& currentLayers( const LayerVector& currentLayers(mDrawingState.layersSortedByZ); const_cast<LayerVector&>(mDrawingState.layersSortedByZ)); visibleRegions |= lockPageFlip(currentLayers); visibleRegions |= lockPageFlip(currentLayers); const DisplayHardware& hw = graphicPlane(0).displayHardware(); const DisplayHardware& hw = graphicPlane(0).displayHardware(); Loading @@ -748,9 +747,8 @@ void SurfaceFlinger::handlePageFlip() /* /* * rebuild the visible layer list * rebuild the visible layer list */ */ const size_t count = currentLayers.size(); mVisibleLayersSortedByZ.clear(); mVisibleLayersSortedByZ.clear(); const LayerVector& currentLayers(mDrawingState.layersSortedByZ); size_t count = currentLayers.size(); mVisibleLayersSortedByZ.setCapacity(count); mVisibleLayersSortedByZ.setCapacity(count); for (size_t i=0 ; i<count ; i++) { for (size_t i=0 ; i<count ; i++) { if (!currentLayers[i]->visibleRegionScreen.isEmpty()) if (!currentLayers[i]->visibleRegionScreen.isEmpty()) Loading Loading @@ -2515,7 +2513,7 @@ ssize_t UserClient::getTokenForSurface(const sp<ISurface>& sur) const } } break; break; } } if (++name >= SharedBufferStack::NUM_LAYERS_MAX) if (++name >= int32_t(SharedBufferStack::NUM_LAYERS_MAX)) name = NO_MEMORY; name = NO_MEMORY; } while(name >= 0); } while(name >= 0); Loading Loading @@ -2562,7 +2560,7 @@ sp<GraphicBuffer> GraphicBufferAlloc::createGraphicBuffer(uint32_t w, uint32_t h void GraphicBufferAlloc::freeAllGraphicBuffersExcept(int bufIdx) { void GraphicBufferAlloc::freeAllGraphicBuffersExcept(int bufIdx) { Mutex::Autolock _l(mLock); Mutex::Autolock _l(mLock); if (0 <= bufIdx && bufIdx < mBuffers.size()) { if (bufIdx >= 0 && size_t(bufIdx) < mBuffers.size()) { sp<GraphicBuffer> b(mBuffers[bufIdx]); sp<GraphicBuffer> b(mBuffers[bufIdx]); mBuffers.clear(); mBuffers.clear(); mBuffers.add(b); mBuffers.add(b); Loading
services/surfaceflinger/SurfaceFlinger.h +2 −2 Original line number Original line Diff line number Diff line Loading @@ -304,7 +304,7 @@ private: Vector< sp<LayerBase> >& ditchedLayers); Vector< sp<LayerBase> >& ditchedLayers); void computeVisibleRegions( void computeVisibleRegions( LayerVector& currentLayers, const LayerVector& currentLayers, Region& dirtyRegion, Region& dirtyRegion, Region& wormholeRegion); Region& wormholeRegion); Loading Loading @@ -371,7 +371,6 @@ private: // access must be protected by mStateLock // access must be protected by mStateLock mutable Mutex mStateLock; mutable Mutex mStateLock; State mCurrentState; State mCurrentState; State mDrawingState; volatile int32_t mTransactionFlags; volatile int32_t mTransactionFlags; volatile int32_t mTransactionCount; volatile int32_t mTransactionCount; Condition mTransactionCV; Condition mTransactionCV; Loading @@ -395,6 +394,7 @@ private: // Can only accessed from the main thread, these members // Can only accessed from the main thread, these members // don't need synchronization // don't need synchronization State mDrawingState; Region mDirtyRegion; Region mDirtyRegion; Region mDirtyRegionRemovedLayer; Region mDirtyRegionRemovedLayer; Region mInvalidRegion; Region mInvalidRegion; Loading