Changeset 210954 in webkit
- Timestamp:
- Jan 19, 2017 10:55:46 PM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r210949 r210954 1 2017-01-19 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [Threaded Compositor] Initialize the threaded compositor with the current size 4 https://bugs.webkit.org/show_bug.cgi?id=167196 5 6 Reviewed by Žan Doberšek. 7 8 We are always creating the threaded compositor with an empty size and then a sizeDidChange always happen when 9 the backing store state changes. This is always happening because the threaded compositor is created before the 10 first backing store state, but if we wanted to create it later, for example to enter/leave AC mode on demand, 11 the threaded compositor will not have the viewport size unless the window is resized, or sizeDidChange is called 12 manually when entering AC mode. Creating the threaded compositor is sync and changing the size too, so it's 13 better to do both things at the same time using the same sync operation. 14 15 * Shared/CoordinatedGraphics/SimpleViewportController.cpp: 16 (WebKit::SimpleViewportController::SimpleViewportController): Pass an initial size to the constructor. 17 * Shared/CoordinatedGraphics/SimpleViewportController.h: 18 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: 19 (WebKit::ThreadedCompositor::create): Add viewportSize and scaleFactor construction parameters, 20 (WebKit::ThreadedCompositor::ThreadedCompositor): Ditto. Also mark as needs resize if the given size is not empty. 21 * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 22 * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: 23 (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Initialize the threaded compositor 24 with an initial viewport size and scale factor. 25 1 26 2017-01-19 Chris Dumez <cdumez@apple.com> 2 27 -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/SimpleViewportController.cpp
r205395 r210954 29 29 namespace WebKit { 30 30 31 SimpleViewportController::SimpleViewportController() 31 SimpleViewportController::SimpleViewportController(const IntSize& size) 32 : m_viewportSize(size) 32 33 { 33 34 resetViewportToDefaultState(); -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/SimpleViewportController.h
r205395 r210954 38 38 WTF_MAKE_NONCOPYABLE(SimpleViewportController); 39 39 public: 40 SimpleViewportController( );40 SimpleViewportController(const WebCore::IntSize&); 41 41 42 42 void didChangeViewportSize(const WebCore::IntSize&); -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
r206080 r210954 43 43 namespace WebKit { 44 44 45 Ref<ThreadedCompositor> ThreadedCompositor::create(Client& client, uint64_t nativeSurfaceHandle, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags)46 { 47 return adoptRef(*new ThreadedCompositor(client, nativeSurfaceHandle, doFrameSync, paintFlags));48 } 49 50 ThreadedCompositor::ThreadedCompositor(Client& client, uint64_t nativeSurfaceHandle, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags)45 Ref<ThreadedCompositor> ThreadedCompositor::create(Client& client, const IntSize& viewportSize, float scaleFactor, uint64_t nativeSurfaceHandle, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags) 46 { 47 return adoptRef(*new ThreadedCompositor(client, viewportSize, scaleFactor, nativeSurfaceHandle, doFrameSync, paintFlags)); 48 } 49 50 ThreadedCompositor::ThreadedCompositor(Client& client, const IntSize& viewportSize, float scaleFactor, uint64_t nativeSurfaceHandle, ShouldDoFrameSync doFrameSync, TextureMapper::PaintFlags paintFlags) 51 51 : m_client(client) 52 , m_viewportSize(viewportSize) 53 , m_scaleFactor(scaleFactor) 52 54 , m_nativeSurfaceHandle(nativeSurfaceHandle) 53 55 , m_doFrameSync(doFrameSync) 54 56 , m_paintFlags(paintFlags) 57 , m_needsResize(!viewportSize.isEmpty()) 55 58 , m_compositingRunLoop(std::make_unique<CompositingRunLoop>([this] { renderLayerTree(); })) 56 59 { -
trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h
r206080 r210954 59 59 enum class ShouldDoFrameSync { No, Yes }; 60 60 61 static Ref<ThreadedCompositor> create(Client&, uint64_t nativeSurfaceHandle = 0, ShouldDoFrameSync = ShouldDoFrameSync::Yes, WebCore::TextureMapper::PaintFlags = 0);61 static Ref<ThreadedCompositor> create(Client&, const WebCore::IntSize&, float scaleFactor, uint64_t nativeSurfaceHandle = 0, ShouldDoFrameSync = ShouldDoFrameSync::Yes, WebCore::TextureMapper::PaintFlags = 0); 62 62 virtual ~ThreadedCompositor(); 63 63 … … 75 75 76 76 private: 77 ThreadedCompositor(Client&, uint64_t nativeSurfaceHandle, ShouldDoFrameSync, WebCore::TextureMapper::PaintFlags);77 ThreadedCompositor(Client&, const WebCore::IntSize&, float scaleFactor, uint64_t nativeSurfaceHandle, ShouldDoFrameSync, WebCore::TextureMapper::PaintFlags); 78 78 79 79 // CoordinatedGraphicsSceneClient -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp
r206080 r210954 54 54 , m_compositorClient(*this) 55 55 , m_surface(AcceleratedSurface::create(webPage)) 56 , m_viewportController(webPage.size()) 56 57 { 58 IntSize scaledSize(m_webPage.size()); 59 scaledSize.scale(m_webPage.deviceScaleFactor()); 60 float scaleFactor = m_webPage.deviceScaleFactor() * m_viewportController.pageScaleFactor(); 61 57 62 if (m_surface) { 58 63 TextureMapper::PaintFlags paintFlags = 0; … … 64 69 // Rendering to the actual screen will happen later anyway since the UI process schedules a redraw for every update, 65 70 // the compositor will take care of syncing to vblank. 66 m_compositor = ThreadedCompositor::create(m_compositorClient, m_surface->window(), ThreadedCompositor::ShouldDoFrameSync::No, paintFlags);71 m_compositor = ThreadedCompositor::create(m_compositorClient, scaledSize, scaleFactor, m_surface->window(), ThreadedCompositor::ShouldDoFrameSync::No, paintFlags); 67 72 m_layerTreeContext.contextID = m_surface->surfaceID(); 68 73 } else 69 m_compositor = ThreadedCompositor::create(m_compositorClient); 74 m_compositor = ThreadedCompositor::create(m_compositorClient, scaledSize, scaleFactor); 75 76 didChangeViewport(); 70 77 } 71 78
Note: See TracChangeset
for help on using the changeset viewer.