Changeset 203500 in webkit
- Timestamp:
- Jul 21, 2016, 12:35:49 AM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/gtk/RedirectedXCompositeWindow.cpp (modified) (5 diffs)
-
UIProcess/gtk/RedirectedXCompositeWindow.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r203497 r203500 1 2016-07-21 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] White page when loaded tab is visited until it's hovered when AC mode is always on 4 https://bugs.webkit.org/show_bug.cgi?id=159512 5 6 Reviewed by Michael Catanzaro. 7 8 The redirected window is always mapped, but offscreen, to ensure that the web process can always render 9 there. When the web process renders something into the offscreen window, we receive a damage event in the UI 10 process and queue a redraw of the web view. However, when the web view is not mapped, even if we still receive 11 the damage events, the web view redraws are ignored until the view is mapped again (gtk_widget_queue_draw() 12 returns early when the widget is not visible). The redirected window updates its pixmap on demand when the 13 surface is requested, which happens when the web view draws its contents. So when the web view becames visible, 14 the redirected window creates a new pixmap and surface (the first time or if the web view was resized), that we 15 initialize to avoid artifacts when the web process hasn't render anything yet. That initialization is actually 16 overwriting anything rendered into the redirected window while the view was unmapped. That's why see white pages 17 the first time, and previous contents after a resize, and we don't see the actual contents until the web process 18 renders again and we reuse the existing pixmap. The white page didn't happen for tabs with accelerated content, 19 because in those cases the web process was rendering a new frame every 16ms, but instead there was a flickering 20 effect due to the current frame being overwritten when the view is mapped until the next frame. 21 So, instead of lazily create and initialize the redirected window pixmap and surface, we should always create 22 the new pixmap as soon as the window is created or resized (and not empty) This fixes the issues but also makes 23 resizing the window a bit smoother when AC mode is enabled. 24 25 * UIProcess/gtk/RedirectedXCompositeWindow.cpp: 26 (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow): Create the pixmap and surface if the window is 27 not empty. 28 (WebKit::RedirectedXCompositeWindow::resize): Ditto. 29 (WebKit::RedirectedXCompositeWindow::createNewPixampAndPixampSurface): Create the pixmap and surface. 30 (WebKit::RedirectedXCompositeWindow::surface): Deleted. 31 * UIProcess/gtk/RedirectedXCompositeWindow.h: 32 (WebKit::RedirectedXCompositeWindow::surface): 33 1 34 2016-07-21 Carlos Garcia Campos <cgarcia@igalia.com> 2 35 -
trunk/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp
r203496 r203500 205 205 XSelectInput(m_display, m_window.get(), NoEventMask); 206 206 XCompositeRedirectWindow(m_display, m_window.get(), CompositeRedirectManual); 207 if (!m_size.isEmpty()) 208 createNewPixampAndPixampSurface(); 207 209 m_damage = XDamageCreate(m_display, m_window.get(), XDamageReportNonEmpty); 208 210 } … … 235 237 236 238 m_size = scaledSize; 237 m_needsNewPixmapAfterResize = true;238 239 if (m_size.isEmpty()) 239 240 cleanupPixmapAndPixmapSurface(); 241 else 242 createNewPixampAndPixampSurface(); 240 243 } 241 244 … … 249 252 } 250 253 251 cairo_surface_t* RedirectedXCompositeWindow::surface()254 void RedirectedXCompositeWindow::createNewPixampAndPixampSurface() 252 255 { 253 256 // This should never be called with an empty size (not in Accelerated Compositing mode). 254 257 ASSERT(!m_size.isEmpty()); 255 256 if (!m_needsNewPixmapAfterResize && m_surface)257 return m_surface.get();258 259 m_needsNewPixmapAfterResize = false;260 261 258 XUniquePixmap newPixmap(XCompositeNameWindowPixmap(m_display, m_window.get())); 262 259 if (!newPixmap) { 263 260 cleanupPixmapAndPixmapSurface(); 264 return nullptr;261 return; 265 262 } 266 263 … … 268 265 if (!XGetWindowAttributes(m_display, m_window.get(), &windowAttributes)) { 269 266 cleanupPixmapAndPixmapSurface(); 270 return nullptr;267 return; 271 268 } 272 269 … … 293 290 cleanupPixmapAndPixmapSurface(); 294 291 m_pixmap = WTFMove(newPixmap); 295 m_surface = newSurface; 296 return m_surface.get(); 292 m_surface = WTFMove(newSurface); 297 293 } 298 294 -
trunk/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.h
r203495 r203500 51 51 Window windowID() const { return m_window.get(); } 52 52 void resize(const WebCore::IntSize&); 53 cairo_surface_t* surface() ;53 cairo_surface_t* surface() const { return m_surface.get(); }; 54 54 55 55 private: 56 56 RedirectedXCompositeWindow(WebPageProxy&, const WebCore::IntSize&, std::function<void ()>&& damageNotify); 57 void createNewPixampAndPixampSurface(); 57 58 void cleanupPixmapAndPixmapSurface(); 58 59 … … 65 66 WebCore::XUniqueDamage m_damage; 66 67 RefPtr<cairo_surface_t> m_surface; 67 bool m_needsNewPixmapAfterResize { false };68 68 }; 69 69
Note:
See TracChangeset
for help on using the changeset viewer.