Changeset 246400 in webkit
- Timestamp:
- Jun 13, 2019 7:05:39 AM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r246399 r246400 1 2019-06-13 Zan Dobersek <zdobersek@igalia.com> 2 3 [Nicosia] Add SceneIntegration 4 https://bugs.webkit.org/show_bug.cgi?id=198791 5 6 Reviewed by Carlos Garcia Campos. 7 8 Add the SceneIntegration class to the Nicosia namespace, primarily for 9 the purpose of being able to conveniently trigger scene updates whenever 10 changes are done to the state of layers that are included in that scene. 11 Initially this would be used for layer changes done on a 12 scrolling-dedicated thread. 13 14 Each Nicosia::PlatformLayer can have a SceneIntegration object reference 15 associated. Helper createUpdateScope() method returns a 16 SceneIntegration::UpdateScope instance that triggers an update for the 17 scene when that instance is destroyed (normally when it goes out of the 18 scope). 19 20 * platform/TextureMapper.cmake: 21 * platform/graphics/nicosia/NicosiaPlatformLayer.h: 22 (Nicosia::PlatformLayer::setSceneIntegration): 23 (Nicosia::PlatformLayer::createUpdateScope): 24 * platform/graphics/nicosia/NicosiaSceneIntegration.cpp: Added. 25 (Nicosia::SceneIntegration::SceneIntegration): 26 (Nicosia::SceneIntegration::~SceneIntegration): 27 (Nicosia::SceneIntegration::setClient): 28 (Nicosia::SceneIntegration::invalidate): 29 (Nicosia::SceneIntegration::requestUpdate): 30 (Nicosia::SceneIntegration::createUpdateScope): 31 (Nicosia::SceneIntegration::UpdateScope::UpdateScope): 32 (Nicosia::SceneIntegration::UpdateScope::~UpdateScope): 33 * platform/graphics/nicosia/NicosiaSceneIntegration.h: Added. 34 1 35 2019-06-13 Philippe Normand <pnormand@igalia.com> 2 36 -
trunk/Source/WebCore/platform/TextureMapper.cmake
r244443 r246400 83 83 platform/graphics/nicosia/NicosiaPlatformLayer.cpp 84 84 platform/graphics/nicosia/NicosiaScene.cpp 85 platform/graphics/nicosia/NicosiaSceneIntegration.cpp 85 86 86 87 platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp … … 101 102 platform/graphics/nicosia/NicosiaPlatformLayer.h 102 103 platform/graphics/nicosia/NicosiaScene.h 104 platform/graphics/nicosia/NicosiaSceneIntegration.h 103 105 104 106 platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h -
trunk/Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h
r235221 r246400 35 35 #include "FloatRect.h" 36 36 #include "FloatSize.h" 37 #include "NicosiaSceneIntegration.h" 37 38 #include "TextureMapperAnimation.h" 38 39 #include "TransformationMatrix.h" … … 54 55 LayerID id() const { return m_id; } 55 56 57 void setSceneIntegration(RefPtr<SceneIntegration>&& sceneIntegration) 58 { 59 LockHolder locker(m_state.lock); 60 m_state.sceneIntegration = WTFMove(sceneIntegration); 61 } 62 63 std::unique_ptr<SceneIntegration::UpdateScope> createUpdateScope() 64 { 65 LockHolder locker(m_state.lock); 66 if (m_state.sceneIntegration) 67 return m_state.sceneIntegration->createUpdateScope(); 68 return nullptr; 69 } 70 56 71 protected: 57 72 explicit PlatformLayer(uint64_t); … … 61 76 struct { 62 77 Lock lock; 78 RefPtr<SceneIntegration> sceneIntegration; 63 79 } m_state; 64 80 }; -
trunk/Source/WebKit/ChangeLog
r246398 r246400 1 2019-06-13 Zan Dobersek <zdobersek@igalia.com> 2 3 [Nicosia] Add SceneIntegration 4 https://bugs.webkit.org/show_bug.cgi?id=198791 5 6 Reviewed by Carlos Garcia Campos. 7 8 Have the LayerTreeHost own the SceneIntegration object that's to be 9 associated with layers used inside the LayerTreeHost's scene. The 10 class now also inherits the SceneIntegration::Client interface, with the 11 requestUpdate() method scheduling a scene update in ThreadedCompositor. 12 13 CompositingCoordinator now retrieves the SceneIntegration object from 14 the LayerTreeHost instance and manages association to that object for 15 layers under the coordinator's control. 16 17 ThreadedCompositor class gets a new public updateScene() method that 18 schedules an update, enabling the SceneIntegration class to invoke 19 scene updates. 20 21 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: 22 (WebKit::ThreadedCompositor::updateScene): 23 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 24 * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: 25 (WebKit::CompositingCoordinator::createGraphicsLayer): 26 (WebKit::CompositingCoordinator::detachLayer): 27 (WebKit::CompositingCoordinator::attachLayer): 28 * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: 29 * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: 30 (WebKit::LayerTreeHost::LayerTreeHost): 31 (WebKit::LayerTreeHost::sceneIntegration): 32 (WebKit::LayerTreeHost::requestUpdate): 33 * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: 34 1 35 2019-06-13 Ludovico de Nittis <ludovico.denittis@collabora.com> 2 36 -
trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
r246308 r246400 270 270 } 271 271 272 void ThreadedCompositor::updateScene() 273 { 274 m_compositingRunLoop->scheduleUpdate(); 275 } 276 272 277 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 273 278 RefPtr<WebCore::DisplayRefreshMonitor> ThreadedCompositor::displayRefreshMonitor(PlatformDisplayID) -
trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h
r246308 r246400 70 70 71 71 void updateSceneState(const WebCore::CoordinatedGraphicsState&); 72 void updateScene(); 72 73 73 74 void invalidate(); -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp
r243163 r246400 236 236 auto layer = adoptRef(*new CoordinatedGraphicsLayer(layerType, client)); 237 237 layer->setCoordinator(this); 238 m_nicosia.state.layers.add(layer->compositionLayer()); 238 { 239 auto& compositionLayer = layer->compositionLayer(); 240 m_nicosia.state.layers.add(compositionLayer); 241 compositionLayer->setSceneIntegration(m_client.sceneIntegration()); 242 } 239 243 m_registeredLayers.add(layer->id(), layer.ptr()); 240 244 layer->setNeedsVisibleRectAdjustment(); … … 276 280 return; 277 281 278 m_nicosia.state.layers.remove(layer->compositionLayer()); 282 { 283 auto& compositionLayer = layer->compositionLayer(); 284 m_nicosia.state.layers.remove(compositionLayer); 285 compositionLayer->setSceneIntegration(nullptr); 286 } 279 287 m_registeredLayers.remove(layer->id()); 280 288 notifyFlushRequired(layer); … … 284 292 { 285 293 layer->setCoordinator(this); 286 m_nicosia.state.layers.add(layer->compositionLayer()); 294 { 295 auto& compositionLayer = layer->compositionLayer(); 296 m_nicosia.state.layers.add(compositionLayer); 297 compositionLayer->setSceneIntegration(m_client.sceneIntegration()); 298 } 287 299 m_registeredLayers.add(layer->id(), layer); 288 300 layer->setNeedsVisibleRectAdjustment(); -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h
r236016 r246400 41 41 namespace Nicosia { 42 42 class PaintingEngine; 43 class SceneIntegration; 43 44 } 44 45 … … 61 62 virtual void notifyFlushRequired() = 0; 62 63 virtual void commitSceneState(const WebCore::CoordinatedGraphicsState&) = 0; 64 virtual RefPtr<Nicosia::SceneIntegration> sceneIntegration() = 0; 63 65 }; 64 66 -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
r246308 r246400 54 54 , m_viewportController(webPage.size()) 55 55 , m_layerFlushTimer(RunLoop::main(), this, &LayerTreeHost::layerFlushTimerFired) 56 , m_sceneIntegration(Nicosia::SceneIntegration::create(*this)) 56 57 { 57 58 #if USE(GLIB_EVENT_LOOP) … … 367 368 } 368 369 370 RefPtr<Nicosia::SceneIntegration> LayerTreeHost::sceneIntegration() 371 { 372 return m_sceneIntegration.copyRef(); 373 } 374 369 375 void LayerTreeHost::frameComplete() 370 376 { 371 377 m_compositor->frameComplete(); 378 } 379 380 void LayerTreeHost::requestUpdate() 381 { 382 m_compositor->updateScene(); 372 383 } 373 384 -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h
r246308 r246400 40 40 #include <wtf/RunLoop.h> 41 41 42 #if USE(COORDINATED_GRAPHICS) 43 #include <WebCore/NicosiaSceneIntegration.h> 44 #endif 45 42 46 namespace WebCore { 43 47 class IntRect; … … 55 59 class LayerTreeHost 56 60 #if USE(COORDINATED_GRAPHICS) 57 final : public CompositingCoordinator::Client, public AcceleratedSurface::Client 61 final : public CompositingCoordinator::Client, public AcceleratedSurface::Client, public Nicosia::SceneIntegration::Client 58 62 #endif 59 63 { … … 104 108 void notifyFlushRequired() override { scheduleLayerFlush(); }; 105 109 void commitSceneState(const WebCore::CoordinatedGraphicsState&) override; 110 RefPtr<Nicosia::SceneIntegration> sceneIntegration() override; 106 111 107 112 // AcceleratedSurface::Client 108 113 void frameComplete() override; 114 115 // Nicosia::SceneIntegration::Client 116 void requestUpdate() override; 109 117 110 118 uint64_t nativeSurfaceHandleForCompositing(); … … 194 202 } m_forceRepaintAsync; 195 203 RunLoop::Timer<LayerTreeHost> m_layerFlushTimer; 204 Ref<Nicosia::SceneIntegration> m_sceneIntegration; 196 205 #endif // USE(COORDINATED_GRAPHICS) 197 206 };
Note: See TracChangeset
for help on using the changeset viewer.