Changeset 238379 in webkit
- Timestamp:
- Nov 19, 2018 1:22:51 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r238378 r238379 1 2018-11-19 Tomoki Imai <Tomoki.Imai@sony.com> 2 3 [cairo] BackingStore::incorporateUpdate should use CompositeCopy to support drawsBackground=false in general Cairo ports 4 https://bugs.webkit.org/show_bug.cgi?id=191577 5 6 Reviewed by Carlos Garcia Campos. 7 8 We should use CompositeCopy operator to update bitmap to overwrite existing bitmap even if source contains 9 transparent parts. It enables ports which uses Cairo to set drawsBackground to false. 10 GTK ports has custom background extension, and in such case, we need to use CompositeSourceOver to retain 11 custom background. 12 13 * UIProcess/cairo/BackingStoreCairo.cpp: 14 (WebKit::BackingStore::incorporateUpdate): Use CompositeCopy operator to update bitmap. 15 1 16 2018-11-19 Joseph Pecoraro <pecoraro@apple.com> 2 17 -
trunk/Source/WebKit/UIProcess/cairo/BackingStoreCairo.cpp
r228373 r238379 90 90 RefPtr<cairo_t> cairoContext = adoptRef(cairo_create(m_backend->surface())); 91 91 GraphicsContext graphicsContext(GraphicsContextImplCairo::createFactory(cairoContext.get())); 92 93 // When m_webPageProxy.drawsBackground() is false, bitmap contains transparent parts as a background of the webpage. 94 // For such case, bitmap must be drawn using CompositeCopy to overwrite the existing surface. 95 graphicsContext.setCompositeOperation(WebCore::CompositeCopy); 96 92 97 for (const auto& updateRect : updateInfo.updateRects) { 93 98 IntRect srcRect = updateRect; … … 96 101 if (!m_webPageProxy.drawsBackground()) { 97 102 const WebCore::Color color = m_webPageProxy.backgroundColor(); 98 if (!color.isOpaque()) 99 graphicsContext.clearRect(srcRect); 100 if (color.isVisible()) 103 if (color.isVisible()) { 104 // When the application sets the background color through m_webPageProxy.backgroundColor(), we update the surface in 2 steps. 105 // 1. Fill the surface by m_webPageProxy.backgroundColor(). 106 // 2. Composite webpage's bitmap which has a transparent background. 107 // In step 1, we use CompositeCopy as m_webPageProxy.backgroundColor() may not be opaque. 108 // On the other hand, in step 2, bitmap should be composited by CompositeSourceOver 109 // because it should be blended with m_webPageProxy.backgroundColor(). 101 110 graphicsContext.fillRect(srcRect, color); 111 graphicsContext.setCompositeOperation(WebCore::CompositeSourceOver); 112 bitmap->paint(graphicsContext, deviceScaleFactor(), updateRect.location(), srcRect); 113 graphicsContext.setCompositeOperation(WebCore::CompositeCopy); 114 continue; 115 } 102 116 } 103 117 #endif
Note: See TracChangeset
for help on using the changeset viewer.