| Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp
|
| diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
|
| index 1924a3268a64f8c9bdbe32b0526ef477db51102e..ea2e8e59d2a65b85ebcc07f7c934bc5bf7ee86d6 100644
|
| --- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
|
| +++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
|
| @@ -457,7 +457,7 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration()
|
|
|
| updateBackgroundColor();
|
|
|
| - if (isDirectlyCompositedImage())
|
| + if (renderer->isImage() && isDirectlyCompositedImage())
|
| updateImageContents();
|
|
|
| if (WebLayer* layer = platformLayerForPlugin(renderer)) {
|
| @@ -1698,7 +1698,7 @@ bool CompositedLayerMapping::containsPaintedContent() const
|
| if (paintsIntoCompositedAncestor() || m_owningLayer.isReflection())
|
| return false;
|
|
|
| - if (isDirectlyCompositedImage())
|
| + if (renderer()->isImage() && isDirectlyCompositedImage())
|
| return false;
|
|
|
| RenderObject* renderObject = renderer();
|
| @@ -1742,9 +1742,10 @@ bool CompositedLayerMapping::containsPaintedContent() const
|
| // that require painting. Direct compositing saves backing store.
|
| bool CompositedLayerMapping::isDirectlyCompositedImage() const
|
| {
|
| - RenderObject* renderObject = renderer();
|
| + ASSERT(renderer()->isImage());
|
|
|
| - if (!renderObject->isImage() || m_owningLayer.hasBoxDecorationsOrBackground() || renderObject->hasClip())
|
| + RenderObject* renderObject = renderer();
|
| + if (m_owningLayer.hasBoxDecorationsOrBackground() || renderObject->hasClip())
|
| return false;
|
|
|
| RenderImage* imageRenderer = toRenderImage(renderObject);
|
| @@ -1791,6 +1792,8 @@ void CompositedLayerMapping::updateImageContents()
|
|
|
| // This is a no-op if the layer doesn't have an inner layer for the image.
|
| m_graphicsLayer->setContentsToImage(image);
|
| +
|
| + // Prevent double-drawing: https://bugs.webkit.org/show_bug.cgi?id=58632
|
| updateDrawsContent();
|
|
|
| // Image animation is "lazy", in that it automatically stops unless someone is drawing
|
|
|