Changeset 216101 in webkit
- Timestamp:
- May 2, 2017, 3:50:46 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r216097 r216101 1 2017-05-02 Gwang Yoon Hwang <yoon@igalia.com> 2 3 [GTK] Drop coordinated surfaces from the compositing thread as soon as possible 4 https://bugs.webkit.org/show_bug.cgi?id=171544 5 6 Reviewed by Žan Doberšek. 7 8 * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h: 9 Remove atlasesToRemove from the GraphicsState. It is not a commit 10 state anymore. 11 1 12 2017-05-02 Gwang Yoon Hwang <yoon@igalia.com> 2 13 -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h
r215259 r216101 187 187 188 188 Vector<std::pair<uint32_t /* atlasID */, RefPtr<CoordinatedSurface> > > updateAtlasesToCreate; 189 Vector<uint32_t /* atlasID */> updateAtlasesToRemove;190 189 }; 191 190 -
trunk/Source/WebKit2/ChangeLog
r216098 r216101 1 2017-05-02 Gwang Yoon Hwang <yoon@igalia.com> 2 3 [GTK] Drop coordinated surfaces from the compositing thread as soon as possible 4 https://bugs.webkit.org/show_bug.cgi?id=171544 5 6 Reviewed by Žan Doberšek. 7 8 Released coordinated surface from the main thread didn't be freed until 9 next commit message because the deletion of coordinated surfaces is 10 considered as a part of scene state. We need to release corresponding 11 surfaces whenever the compositing coordinator drops update atlases to 12 reduce memory usages. 13 14 No new tests, only an optimization. 15 16 * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: 17 Remove atlasesToRemove from the GraphicsState. it is not a commit 18 state anymore. 19 * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: 20 (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases): 21 (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases): 22 * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: 23 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: 24 (WebKit::CompositingCoordinator::releaseAtlases): Pass the list of 25 released update atlases to the compositing thread right after cleaning 26 up deactivated update atlases. 27 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 28 * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: 29 (WebKit::CompositingCoordinator::clearPendingStateChanges): 30 (WebKit::CompositingCoordinator::removeUpdateAtlas): 31 (WebKit::CompositingCoordinator::releaseAtlases): 32 * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: 33 * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: 34 * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: 35 (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): 36 * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: 37 1 38 2017-05-02 Timothy Horton <timothy_horton@apple.com> 2 39 -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp
r212638 r216101 847 847 encodeCoordinatedSurface(encoder, state.updateAtlasesToCreate[i].second); 848 848 } 849 encoder << state.updateAtlasesToRemove;850 849 } 851 850 … … 914 913 } 915 914 916 if (!decoder.decode(state.updateAtlasesToRemove))917 return false;918 919 915 return true; 920 916 } -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
r215259 r216101 425 425 for (auto& atlas : state.updateAtlasesToCreate) 426 426 createUpdateAtlas(atlas.first, atlas.second); 427 428 for (auto& atlas : state.updateAtlasesToRemove)429 removeUpdateAtlas(atlas);430 427 } 431 428 … … 440 437 ASSERT(m_surfaces.contains(atlasID)); 441 438 m_surfaces.remove(atlasID); 439 } 440 441 void CoordinatedGraphicsScene::releaseUpdateAtlases(const Vector<uint32_t>& atlasesToRemove) 442 { 443 for (auto& atlas : atlasesToRemove) 444 removeUpdateAtlas(atlas); 442 445 } 443 446 -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h
r215259 r216101 85 85 void setViewBackgroundColor(const WebCore::Color& color) { m_viewBackgroundColor = color; } 86 86 WebCore::Color viewBackgroundColor() const { return m_viewBackgroundColor; } 87 88 void releaseUpdateAtlases(const Vector<uint32_t>&); 87 89 88 90 private: -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
r215259 r216101 245 245 } 246 246 247 void ThreadedCompositor::releaseUpdateAtlases(Vector<uint32_t>&& atlasesToRemove) 248 { 249 ASSERT(isMainThread()); 250 m_compositingRunLoop->performTask([scene = makeRef(*m_scene), atlasesToRemove = WTFMove(atlasesToRemove)] { 251 scene->releaseUpdateAtlases(atlasesToRemove); 252 }); 253 } 254 247 255 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 248 256 RefPtr<WebCore::DisplayRefreshMonitor> ThreadedCompositor::displayRefreshMonitor(PlatformDisplayID) -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h
r215259 r216101 75 75 76 76 void updateSceneState(const WebCore::CoordinatedGraphicsState&); 77 void releaseUpdateAtlases(Vector<uint32_t>&&); 77 78 78 79 void invalidate(); -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
r215167 r216101 182 182 183 183 m_state.updateAtlasesToCreate.clear(); 184 m_state.updateAtlasesToRemove.clear();185 184 } 186 185 … … 305 304 if (m_isPurging) 306 305 return; 307 m_ state.updateAtlasesToRemove.append(atlasID);306 m_atlasesToRemove.append(atlasID); 308 307 } 309 308 … … 444 443 if (m_updateAtlases.size() <= 1) 445 444 m_releaseInactiveAtlasesTimer.stop(); 445 446 if (!m_atlasesToRemove.isEmpty()) 447 m_client.releaseUpdateAtlases(WTFMove(m_atlasesToRemove)); 446 448 } 447 449 -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h
r215088 r216101 61 61 virtual void commitSceneState(const WebCore::CoordinatedGraphicsState&) = 0; 62 62 virtual void paintLayerContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, const WebCore::IntRect& clipRect) = 0; 63 virtual void releaseUpdateAtlases(Vector<uint32_t>&&) = 0; 63 64 }; 64 65 … … 149 150 ImageBackingMap m_imageBackings; 150 151 Vector<std::unique_ptr<UpdateAtlas>> m_updateAtlases; 152 Vector<uint32_t> m_atlasesToRemove; 151 153 152 154 // We don't send the messages related to releasing resources to renderer during purging, because renderer already had removed all resources. -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h
r212608 r216101 73 73 void commitSceneState(const WebCore::CoordinatedGraphicsState&) override; 74 74 void paintLayerContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, const WebCore::IntRect& clipRect) override; 75 void releaseUpdateAtlases(Vector<uint32_t>&&) override { }; 75 76 76 77 private: -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
r215259 r216101 221 221 } 222 222 223 void ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases(Vector<uint32_t>&& atlasesToRemove) 224 { 225 m_compositor->releaseUpdateAtlases(WTFMove(atlasesToRemove)); 226 } 227 223 228 void ThreadedCoordinatedLayerTreeHost::setIsDiscardable(bool discardable) 224 229 { -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h
r215259 r216101 101 101 void didFlushRootLayer(const WebCore::FloatRect&) override { } 102 102 void commitSceneState(const WebCore::CoordinatedGraphicsState&) override; 103 void releaseUpdateAtlases(Vector<uint32_t>&&) override; 103 104 104 105 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
Note:
See TracChangeset
for help on using the changeset viewer.