| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 #endif | 229 #endif |
| 230 | 230 |
| 231 updateOpacity(renderer()->style()); | 231 updateOpacity(renderer()->style()); |
| 232 updateTransform(renderer()->style()); | 232 updateTransform(renderer()->style()); |
| 233 updateFilters(renderer()->style()); | 233 updateFilters(renderer()->style()); |
| 234 | 234 |
| 235 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { | 235 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { |
| 236 updateLayerBlendMode(renderer()->style()); | 236 updateLayerBlendMode(renderer()->style()); |
| 237 updateIsRootForIsolatedGroup(); | 237 updateIsRootForIsolatedGroup(); |
| 238 } | 238 } |
| 239 |
| 240 updateScrollBlocksOn(renderer()->style()); |
| 239 } | 241 } |
| 240 | 242 |
| 241 void CompositedLayerMapping::destroyGraphicsLayers() | 243 void CompositedLayerMapping::destroyGraphicsLayers() |
| 242 { | 244 { |
| 243 if (m_graphicsLayer) | 245 if (m_graphicsLayer) |
| 244 m_graphicsLayer->removeFromParent(); | 246 m_graphicsLayer->removeFromParent(); |
| 245 | 247 |
| 246 m_ancestorClippingLayer = nullptr; | 248 m_ancestorClippingLayer = nullptr; |
| 247 m_graphicsLayer = nullptr; | 249 m_graphicsLayer = nullptr; |
| 248 m_foregroundLayer = nullptr; | 250 m_foregroundLayer = nullptr; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 void CompositedLayerMapping::updateIsRootForIsolatedGroup() | 290 void CompositedLayerMapping::updateIsRootForIsolatedGroup() |
| 289 { | 291 { |
| 290 bool isolate = m_owningLayer.shouldIsolateCompositedDescendants(); | 292 bool isolate = m_owningLayer.shouldIsolateCompositedDescendants(); |
| 291 | 293 |
| 292 // non stacking context layers should never isolate | 294 // non stacking context layers should never isolate |
| 293 ASSERT(m_owningLayer.stackingNode()->isStackingContext() || !isolate); | 295 ASSERT(m_owningLayer.stackingNode()->isStackingContext() || !isolate); |
| 294 | 296 |
| 295 m_graphicsLayer->setIsRootForIsolatedGroup(isolate); | 297 m_graphicsLayer->setIsRootForIsolatedGroup(isolate); |
| 296 } | 298 } |
| 297 | 299 |
| 300 void CompositedLayerMapping::updateScrollBlocksOn(const RenderStyle* style) |
| 301 { |
| 302 // Note that blink determines the default scroll blocking policy, even |
| 303 // when the scroll-blocks-on CSS feature isn't enabled. |
| 304 WebScrollBlocksOn blockingMode = WebScrollBlocksOnStartTouch | WebScrollBloc
ksOnWheelEvent; |
| 305 |
| 306 if (RuntimeEnabledFeatures::cssScrollBlocksOnEnabled()) |
| 307 blockingMode = style->scrollBlocksOn(); |
| 308 |
| 309 m_graphicsLayer->setScrollBlocksOn(blockingMode); |
| 310 } |
| 311 |
| 298 void CompositedLayerMapping::updateContentsOpaque() | 312 void CompositedLayerMapping::updateContentsOpaque() |
| 299 { | 313 { |
| 300 ASSERT(m_isMainFrameRenderViewLayer || !m_backgroundLayer); | 314 ASSERT(m_isMainFrameRenderViewLayer || !m_backgroundLayer); |
| 301 if (isAcceleratedCanvas(renderer())) { | 315 if (isAcceleratedCanvas(renderer())) { |
| 302 // Determine whether the rendering context's external texture layer is o
paque. | 316 // Determine whether the rendering context's external texture layer is o
paque. |
| 303 CanvasRenderingContext* context = toHTMLCanvasElement(renderer()->node()
)->renderingContext(); | 317 CanvasRenderingContext* context = toHTMLCanvasElement(renderer()->node()
)->renderingContext(); |
| 304 if (!context->hasAlpha()) | 318 if (!context->hasAlpha()) |
| 305 m_graphicsLayer->setContentsOpaque(true); | 319 m_graphicsLayer->setContentsOpaque(true); |
| 306 else if (WebLayer* layer = context->platformLayer()) | 320 else if (WebLayer* layer = context->platformLayer()) |
| 307 m_graphicsLayer->setContentsOpaque(!Color(layer->backgroundColor()).
hasAlpha()); | 321 m_graphicsLayer->setContentsOpaque(!Color(layer->backgroundColor()).
hasAlpha()); |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 updateBackgroundColor(); | 722 updateBackgroundColor(); |
| 709 updateDrawsContent(); | 723 updateDrawsContent(); |
| 710 updateContentsOpaque(); | 724 updateContentsOpaque(); |
| 711 updateAfterPartResize(); | 725 updateAfterPartResize(); |
| 712 updateRenderingContext(); | 726 updateRenderingContext(); |
| 713 updateShouldFlattenTransform(); | 727 updateShouldFlattenTransform(); |
| 714 updateChildrenTransform(); | 728 updateChildrenTransform(); |
| 715 updateScrollParent(compositor()->preferCompositingToLCDTextEnabled() ? m_own
ingLayer.scrollParent() : 0); | 729 updateScrollParent(compositor()->preferCompositingToLCDTextEnabled() ? m_own
ingLayer.scrollParent() : 0); |
| 716 registerScrollingLayers(); | 730 registerScrollingLayers(); |
| 717 | 731 |
| 732 updateScrollBlocksOn(renderer()->style()); |
| 733 |
| 718 updateCompositingReasons(); | 734 updateCompositingReasons(); |
| 719 } | 735 } |
| 720 | 736 |
| 721 void CompositedLayerMapping::updateMainGraphicsLayerGeometry(const IntRect& rela
tiveCompositingBounds, const IntRect& localCompositingBounds, const IntPoint& gr
aphicsLayerParentLocation) | 737 void CompositedLayerMapping::updateMainGraphicsLayerGeometry(const IntRect& rela
tiveCompositingBounds, const IntRect& localCompositingBounds, const IntPoint& gr
aphicsLayerParentLocation) |
| 722 { | 738 { |
| 723 m_graphicsLayer->setPosition(FloatPoint(relativeCompositingBounds.location()
- graphicsLayerParentLocation)); | 739 m_graphicsLayer->setPosition(FloatPoint(relativeCompositingBounds.location()
- graphicsLayerParentLocation)); |
| 724 m_graphicsLayer->setOffsetFromRenderer(toIntSize(localCompositingBounds.loca
tion())); | 740 m_graphicsLayer->setOffsetFromRenderer(toIntSize(localCompositingBounds.loca
tion())); |
| 725 | 741 |
| 726 FloatSize oldSize = m_graphicsLayer->size(); | 742 FloatSize oldSize = m_graphicsLayer->size(); |
| 727 const IntSize& contentsSize = relativeCompositingBounds.size(); | 743 const IntSize& contentsSize = relativeCompositingBounds.size(); |
| (...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2318 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2334 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
| 2319 name = "Scrolling Block Selection Layer"; | 2335 name = "Scrolling Block Selection Layer"; |
| 2320 } else { | 2336 } else { |
| 2321 ASSERT_NOT_REACHED(); | 2337 ASSERT_NOT_REACHED(); |
| 2322 } | 2338 } |
| 2323 | 2339 |
| 2324 return name; | 2340 return name; |
| 2325 } | 2341 } |
| 2326 | 2342 |
| 2327 } // namespace blink | 2343 } // namespace blink |
| OLD | NEW |