| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 if (!renderer->style()->hasBackground()) | 132 if (!renderer->style()->hasBackground()) |
| 133 return true; | 133 return true; |
| 134 | 134 |
| 135 // Simple background that is contained within the contents rect. | 135 // Simple background that is contained within the contents rect. |
| 136 return contentsRect(renderer).contains(backgroundRect(renderer)); | 136 return contentsRect(renderer).contains(backgroundRect(renderer)); |
| 137 } | 137 } |
| 138 | 138 |
| 139 static inline bool isAcceleratedContents(RenderObject* renderer) | 139 static inline bool isAcceleratedContents(RenderObject* renderer) |
| 140 { | 140 { |
| 141 return isAcceleratedCanvas(renderer) | 141 return isAcceleratedCanvas(renderer) |
| 142 || (renderer->isEmbeddedObject() && toRenderEmbeddedObject(renderer)->al
lowsAcceleratedCompositing()) | 142 || (renderer->isEmbeddedObject() && toRenderEmbeddedObject(renderer)->re
quiresAcceleratedCompositing()) |
| 143 || renderer->isVideo(); | 143 || renderer->isVideo(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 // Get the scrolling coordinator in a way that works inside CompositedLayerMappi
ng's destructor. | 146 // Get the scrolling coordinator in a way that works inside CompositedLayerMappi
ng's destructor. |
| 147 static ScrollingCoordinator* scrollingCoordinatorFromLayer(RenderLayer& layer) | 147 static ScrollingCoordinator* scrollingCoordinatorFromLayer(RenderLayer& layer) |
| 148 { | 148 { |
| 149 Page* page = layer.renderer()->frame()->page(); | 149 Page* page = layer.renderer()->frame()->page(); |
| 150 if (!page) | 150 if (!page) |
| 151 return 0; | 151 return 0; |
| 152 | 152 |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 } | 520 } |
| 521 } else { | 521 } else { |
| 522 m_graphicsLayer->setReplicatedByLayer(0); | 522 m_graphicsLayer->setReplicatedByLayer(0); |
| 523 } | 523 } |
| 524 | 524 |
| 525 updateBackgroundColor(); | 525 updateBackgroundColor(); |
| 526 | 526 |
| 527 if (isDirectlyCompositedImage()) | 527 if (isDirectlyCompositedImage()) |
| 528 updateImageContents(); | 528 updateImageContents(); |
| 529 | 529 |
| 530 if (renderer->isEmbeddedObject() && toRenderEmbeddedObject(renderer)->allows
AcceleratedCompositing()) { | 530 if (renderer->isEmbeddedObject() && toRenderEmbeddedObject(renderer)->requir
esAcceleratedCompositing()) { |
| 531 PluginView* pluginView = toPluginView(toRenderWidget(renderer)->widget()
); | 531 PluginView* pluginView = toPluginView(toRenderWidget(renderer)->widget()
); |
| 532 m_graphicsLayer->setContentsToPlatformLayer(pluginView->platformLayer())
; | 532 m_graphicsLayer->setContentsToPlatformLayer(pluginView->platformLayer())
; |
| 533 } else if (renderer->node() && renderer->node()->isFrameOwnerElement() && to
HTMLFrameOwnerElement(renderer->node())->contentFrame()) { | 533 } else if (renderer->node() && renderer->node()->isFrameOwnerElement() && to
HTMLFrameOwnerElement(renderer->node())->contentFrame()) { |
| 534 blink::WebLayer* layer = toHTMLFrameOwnerElement(renderer->node())->cont
entFrame()->remotePlatformLayer(); | 534 blink::WebLayer* layer = toHTMLFrameOwnerElement(renderer->node())->cont
entFrame()->remotePlatformLayer(); |
| 535 if (layer) | 535 if (layer) |
| 536 m_graphicsLayer->setContentsToPlatformLayer(layer); | 536 m_graphicsLayer->setContentsToPlatformLayer(layer); |
| 537 } else if (renderer->isVideo()) { | 537 } else if (renderer->isVideo()) { |
| 538 HTMLMediaElement* mediaElement = toHTMLMediaElement(renderer->node()); | 538 HTMLMediaElement* mediaElement = toHTMLMediaElement(renderer->node()); |
| 539 m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer(
)); | 539 m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer(
)); |
| 540 } else if (isAcceleratedCanvas(renderer)) { | 540 } else if (isAcceleratedCanvas(renderer)) { |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 return true; | 1534 return true; |
| 1535 | 1535 |
| 1536 if (hasVisibleNonCompositingDescendantLayers()) | 1536 if (hasVisibleNonCompositingDescendantLayers()) |
| 1537 return true; | 1537 return true; |
| 1538 | 1538 |
| 1539 return false; | 1539 return false; |
| 1540 } | 1540 } |
| 1541 | 1541 |
| 1542 static bool isCompositedPlugin(RenderObject* renderer) | 1542 static bool isCompositedPlugin(RenderObject* renderer) |
| 1543 { | 1543 { |
| 1544 return renderer->isEmbeddedObject() && toRenderEmbeddedObject(renderer)->all
owsAcceleratedCompositing(); | 1544 return renderer->isEmbeddedObject() && toRenderEmbeddedObject(renderer)->req
uiresAcceleratedCompositing(); |
| 1545 } | 1545 } |
| 1546 | 1546 |
| 1547 static bool hasVisibleNonCompositingDescendant(RenderLayer* parent) | 1547 static bool hasVisibleNonCompositingDescendant(RenderLayer* parent) |
| 1548 { | 1548 { |
| 1549 if (!parent->hasVisibleDescendant()) | 1549 if (!parent->hasVisibleDescendant()) |
| 1550 return false; | 1550 return false; |
| 1551 | 1551 |
| 1552 // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512. | 1552 // FIXME: We shouldn't be called with a stale z-order lists. See bug 85512. |
| 1553 parent->stackingNode()->updateLayerListsIfNeeded(); | 1553 parent->stackingNode()->updateLayerListsIfNeeded(); |
| 1554 | 1554 |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2146 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2146 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 2147 name = "Scrolling Contents Layer"; | 2147 name = "Scrolling Contents Layer"; |
| 2148 } else { | 2148 } else { |
| 2149 ASSERT_NOT_REACHED(); | 2149 ASSERT_NOT_REACHED(); |
| 2150 } | 2150 } |
| 2151 | 2151 |
| 2152 return name; | 2152 return name; |
| 2153 } | 2153 } |
| 2154 | 2154 |
| 2155 } // namespace WebCore | 2155 } // namespace WebCore |
| OLD | NEW |