Changeset 180924 in webkit
- Timestamp:
- Mar 3, 2015, 12:10:01 AM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
-
ChangeLog (modified) (1 diff)
-
WebProcess/WebPage/DrawingArea.h (modified) (1 diff)
-
WebProcess/WebPage/DrawingAreaImpl.cpp (modified) (2 diffs)
-
WebProcess/WebPage/LayerTreeHost.h (modified) (1 diff)
-
WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp (modified) (6 diffs)
-
WebProcess/WebPage/gtk/LayerTreeHostGtk.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r180921 r180924 1 2015-03-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 REGRESSION(r177075): WebProcess crashes when entering accelerating compositing mode before the WebView is realized 4 https://bugs.webkit.org/show_bug.cgi?id=142079 5 6 Reviewed by Žan Doberšek. 7 8 The problem is that the texture mapper and native window handler 9 are initialized when the LayerTreeHost is initialized, assuming 10 the UI process has already sent the native window handler to the 11 web process, but that doesn't always happen since we moved the 12 redirected window creation to realize in r177075. 13 14 * WebProcess/WebPage/DrawingArea.h: 15 (WebKit::DrawingArea::nativeSurfaceHandleForCompositing): Deleted. 16 * WebProcess/WebPage/DrawingAreaImpl.cpp: 17 (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): Call 18 LayerTreeHost::setNativeSurfaceHandleForCompositing if we 19 already have a native window handle at this point. 20 (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing): 21 Call LayerTreeHost::setNativeSurfaceHandleForCompositing also when 22 not using threaded compositing. 23 * WebProcess/WebPage/LayerTreeHost.h: 24 * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: 25 (WebKit::LayerTreeHostGtk::makeContextCurrent): Helper function to 26 ensure a context and making it current. 27 (WebKit::LayerTreeHostGtk::ensureTextureMapper): Ensure a texture 28 is created for the current context. 29 (WebKit::LayerTreeHostGtk::initialize): Use makeContextCurrent() 30 and ensureTextureMapper(), and remove the LayerTreeContext 31 initialization since that's is now always initialized in 32 setNativeSurfaceHandleForCompositing(). 33 (WebKit::LayerTreeHostGtk::compositeLayersToContext): Use 34 makeContextCurrent() helper function and also call 35 ensureTextureMapper() just in case the texture could not be 36 created during initialization because the native window handle was 37 not yet available. 38 (WebKit::LayerTreeHostGtk::flushAndRenderLayers): Use makeContextCurrent(). 39 (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing): 40 Initialize the LayerTreeContext. 41 (WebKit::LayerTreeHostGtk::glContext): Deleted. 42 * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: 43 1 44 2015-03-02 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 45 -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
r178095 r180924 125 125 virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) { } 126 126 127 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK)128 uint64_t nativeSurfaceHandleForCompositing() { return m_nativeSurfaceHandleForCompositing; }129 #endif130 131 127 protected: 132 128 DrawingArea(DrawingAreaType, WebPage&); -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
r179182 r180924 457 457 458 458 m_layerTreeHost = LayerTreeHost::create(&m_webPage); 459 if (m_nativeSurfaceHandleForCompositing) 460 m_layerTreeHost->setNativeSurfaceHandleForCompositing(m_nativeSurfaceHandleForCompositing); 459 461 if (!m_inUpdateBackingStoreState) 460 462 m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(true); … … 678 680 m_webPage.corePage()->settings().setAcceleratedCompositingEnabled(true); 679 681 680 #if USE(COORDINATED_GRAPHICS_THREADED)681 682 if (m_layerTreeHost) 682 683 m_layerTreeHost->setNativeSurfaceHandleForCompositing(handle); 684 } 683 685 #endif 684 }685 #endif686 686 687 687 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
r179182 r180924 94 94 #endif 95 95 96 #if USE(TEXTURE_MAPPER_GL) && PLATFORM(GTK) 97 virtual void setNativeSurfaceHandleForCompositing(uint64_t) = 0; 98 #endif 99 96 100 virtual void setViewOverlayRootLayer(WebCore::GraphicsLayer*) = 0; 97 101 -
trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
r179182 r180924 79 79 } 80 80 81 GLContext* LayerTreeHostGtk::glContext() 82 { 83 if (m_context) 84 return m_context.get(); 85 86 uint64_t windowHandle = m_webPage->drawingArea()->nativeSurfaceHandleForCompositing(); 87 if (!windowHandle) 88 return 0; 89 90 m_context = GLContext::createContextForWindow(windowHandle, GLContext::sharingContext()); 91 return m_context.get(); 81 bool LayerTreeHostGtk::makeContextCurrent() 82 { 83 if (!m_context) { 84 if (!m_layerTreeContext.contextID) 85 return false; 86 87 m_context = GLContext::createContextForWindow(m_layerTreeContext.contextID, GLContext::sharingContext()); 88 if (!m_context) 89 return false; 90 } 91 92 return m_context->makeContextCurrent(); 93 } 94 95 void LayerTreeHostGtk::ensureTextureMapper() 96 { 97 if (m_textureMapper) 98 return; 99 100 ASSERT(m_isValid); 101 m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode); 102 static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true); 103 downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setTextureMapper(m_textureMapper.get()); 92 104 } 93 105 … … 114 126 m_nonCompositedContentLayer->setNeedsDisplay(); 115 127 116 m_layerTreeContext.contextID = m_webPage->drawingArea()->nativeSurfaceHandleForCompositing();117 118 GLContext* context = glContext();119 if (!context)120 return;121 122 128 // The creation of the TextureMapper needs an active OpenGL context. 123 context->makeContextCurrent(); 124 125 m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode); 126 static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true); 127 downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setTextureMapper(m_textureMapper.get()); 128 129 if (!makeContextCurrent()) 130 return; 131 132 ensureTextureMapper(); 129 133 scheduleLayerFlush(); 130 134 } … … 290 294 void LayerTreeHostGtk::compositeLayersToContext(CompositePurpose purpose) 291 295 { 292 GLContext* context = glContext(); 293 if (!context || !context->makeContextCurrent()) 294 return; 296 if (!makeContextCurrent()) 297 return; 298 299 ensureTextureMapper(); 295 300 296 301 // The window size may be out of sync with the page size at this point, and getting … … 309 314 m_textureMapper->endPainting(); 310 315 311 context->swapBuffers();316 m_context->swapBuffers(); 312 317 } 313 318 … … 322 327 } 323 328 324 GLContext* context = glContext(); 325 if (!context || !context->makeContextCurrent()) 329 if (!makeContextCurrent()) 326 330 return; 327 331 … … 381 385 } 382 386 387 void LayerTreeHostGtk::setNativeSurfaceHandleForCompositing(uint64_t handle) 388 { 389 m_layerTreeContext.contextID = handle; 390 } 391 383 392 } // namespace WebKit 384 393 -
trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h
r179182 r180924 62 62 virtual void pageBackgroundTransparencyChanged() override; 63 63 64 virtual void setNativeSurfaceHandleForCompositing(uint64_t) override; 65 64 66 private: 65 67 // LayerTreeHost … … 85 87 void layerFlushTimerFired(); 86 88 87 WebCore::GLContext* glContext(); 89 bool makeContextCurrent(); 90 void ensureTextureMapper(); 88 91 89 92 LayerTreeContext m_layerTreeContext;
Note:
See TracChangeset
for help on using the changeset viewer.