Changeset 139750 in webkit
- Timestamp:
- Jan 15, 2013, 10:10:28 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r139749 r139750 1 2013-01-15 Simon Fraser <simon.fraser@apple.com> 2 3 Allow tiled WKViews to have transparent backgrounds 4 https://bugs.webkit.org/show_bug.cgi?id=106400 5 6 Reviewed by Anders Carlsson. 7 8 When WKViews were set to have transparent backgrounds, they still 9 obscured content behind the view, for several reasons. 10 11 First, when in tiled scrolling mode, WKView set the background 12 of its layer to opaque white. Fix by using the clearColor (effectively 13 removing the background color) if the view has a non-opaque background. 14 15 Second, RenderLayerBacking just looked at FrameViews's isTransparent() 16 when deciding to make TileCache tiles non-opaque, but it also needs to 17 consider FrameViews with a non-opaque base background color. The 18 same logic was necessary to avoid setting an opaque white background 19 color on the TileCache layer. 20 21 Finally, for views with non-opaque backgrounds, we don't want to display 22 linen, so RenderLayerCompositor::requiresOverhangAreasLayer() was changed 23 to return false in that case. 24 25 View transparency is not testable in layout tests. 26 27 * page/FrameView.cpp: 28 (WebCore::FrameView::hasOpaqueBackground): 29 * page/FrameView.h: 30 * rendering/RenderLayerBacking.cpp: 31 (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): 32 (WebCore::RenderLayerBacking::updateBackgroundColor): 33 * rendering/RenderLayerCompositor.cpp: 34 (WebCore::RenderLayerCompositor::requiresOverhangAreasLayer): 35 1 36 2013-01-15 Ojan Vafai <ojan@chromium.org> 2 37 -
trunk/Source/WebCore/page/FrameView.cpp
r139691 r139750 2326 2326 } 2327 2327 2328 bool FrameView::hasOpaqueBackground() const 2329 { 2330 return !m_isTransparent && !m_baseBackgroundColor.hasAlpha(); 2331 } 2332 2328 2333 Color FrameView::baseBackgroundColor() const 2329 2334 { -
trunk/Source/WebCore/page/FrameView.h
r139691 r139750 165 165 bool isTransparent() const; 166 166 void setTransparent(bool isTransparent); 167 168 // True if the FrameView is not transparent, and the base background color is opaque. 169 bool hasOpaqueBackground() const; 167 170 168 171 Color baseBackgroundColor() const; -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r139258 r139750 268 268 269 269 if (m_isMainFrameRenderViewLayer) { 270 bool isTransparent= false;270 bool hasOpaqueBackground = false; 271 271 if (FrameView* frameView = toRenderView(renderer())->frameView()) 272 isTransparent = frameView->isTransparent();273 274 m_graphicsLayer->setContentsOpaque(! isTransparent);272 hasOpaqueBackground = !frameView->hasOpaqueBackground(); 273 274 m_graphicsLayer->setContentsOpaque(!hasOpaqueBackground); 275 275 m_graphicsLayer->setAppliesPageScale(); 276 276 } … … 1181 1181 if (!frameView->isTransparent()) { 1182 1182 backgroundColor = frameView->documentBackgroundColor(); 1183 if ( !backgroundColor.isValid() || backgroundColor.hasAlpha())1183 if (frameView->hasOpaqueBackground() && (!backgroundColor.isValid() || backgroundColor.hasAlpha())) 1184 1184 backgroundColor = Color::white; 1185 1185 } -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r139493 r139750 2224 2224 2225 2225 // We do want a layer if we have a scrolling coordinator. 2226 if (scrollingCoordinator() )2226 if (scrollingCoordinator() && m_renderView->frameView()->hasOpaqueBackground()) 2227 2227 return true; 2228 2228 -
trunk/Source/WebKit2/ChangeLog
r139702 r139750 1 2013-01-15 Simon Fraser <simon.fraser@apple.com> 2 3 Allow tiled WKViews to have transparent backgrounds 4 https://bugs.webkit.org/show_bug.cgi?id=106400 5 6 Reviewed by Anders Carlsson. 7 8 When WKViews were set to have transparent backgrounds, they still 9 obscured content behind the view, for several reasons. 10 11 First, when in tiled scrolling mode, WKView set the background 12 of its layer to opaque white. Fix by using the clearColor (effectively 13 removing the background color) if the view has a non-opaque background. 14 15 Second, RenderLayerBacking just looked at FrameViews's isTransparent() 16 when deciding to make TileCache tiles non-opaque, but it also needs to 17 consider FrameViews with a non-opaque base background color. The 18 same logic was necessary to avoid setting an opaque white background 19 color on the TileCache layer. 20 21 Finally, for views with non-opaque backgrounds, we don't want to display 22 linen, so RenderLayerCompositor::requiresOverhangAreasLayer() was changed 23 to return false in that case. 24 25 * UIProcess/API/mac/WKView.mm: 26 (-[WKView updateLayer]): 27 1 28 2013-01-14 Dean Jackson <dino@apple.com> 2 29 -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r136620 r139750 2970 2970 - (void)updateLayer 2971 2971 { 2972 self.layer.backgroundColor = CGColorGetConstantColor(kCGColorWhite); 2972 if ([self drawsBackground] && ![self drawsTransparentBackground]) 2973 self.layer.backgroundColor = CGColorGetConstantColor(kCGColorWhite); 2974 else 2975 self.layer.backgroundColor = CGColorGetConstantColor(kCGColorClear); 2973 2976 2974 2977 if (DrawingAreaProxy* drawingArea = _data->_page->drawingArea())
Note:
See TracChangeset
for help on using the changeset viewer.