| Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp
|
| diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
|
| index 8f2e9dd6ff369c2585001b7e05878d9b85d121a5..077129cedd2b7f52facbbe5dc044e895e0c985b0 100644
|
| --- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
|
| +++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
|
| @@ -456,10 +456,13 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration(GraphicsLayerUpdat
|
|
|
| updateBackgroundColor();
|
|
|
| - if (isDirectlyCompositedImage())
|
| - updateImageContents();
|
| -
|
| - if (blink::WebLayer* layer = platformLayerForPlugin(renderer)) {
|
| + if (renderer->isImage()) {
|
| + if (isDirectlyCompositedImage()) {
|
| + updateImageContents();
|
| + } else if (m_graphicsLayer->hasContentsLayer()) {
|
| + m_graphicsLayer->setContentsToImage(0);
|
| + }
|
| + } else if (blink::WebLayer* layer = platformLayerForPlugin(renderer)) {
|
| m_graphicsLayer->setContentsToPlatformLayer(layer);
|
| } else if (renderer->node() && renderer->node()->isFrameOwnerElement() && toHTMLFrameOwnerElement(renderer->node())->contentFrame()) {
|
| blink::WebLayer* layer = toHTMLFrameOwnerElement(renderer->node())->contentFrame()->remotePlatformLayer();
|
| @@ -1645,7 +1648,7 @@ bool CompositedLayerMapping::containsPaintedContent() const
|
| if (paintsIntoCompositedAncestor() || m_owningLayer.isReflection())
|
| return false;
|
|
|
| - if (isDirectlyCompositedImage())
|
| + if (renderer()->isImage() && isDirectlyCompositedImage())
|
| return false;
|
|
|
| RenderObject* renderObject = renderer();
|
| @@ -1689,9 +1692,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);
|
| @@ -1738,6 +1742,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
|
| @@ -2095,6 +2101,8 @@ void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G
|
| // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
|
| InspectorInstrumentation::willPaint(m_owningLayer.renderer(), graphicsLayer);
|
|
|
| + setCurrentScreenId(reinterpret_cast<long long>(renderer()->frame()->page()));
|
| +
|
| if (graphicsLayer == m_graphicsLayer.get()
|
| || graphicsLayer == m_foregroundLayer.get()
|
| || graphicsLayer == m_backgroundLayer.get()
|
| @@ -2130,6 +2138,9 @@ void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G
|
| m_owningLayer.scrollableArea()->paintResizer(&context, IntPoint(), transformedClip);
|
| context.restore();
|
| }
|
| +
|
| + setCurrentScreenId(0);
|
| +
|
| InspectorInstrumentation::didPaint(m_owningLayer.renderer(), graphicsLayer, &context, clip);
|
| #ifndef NDEBUG
|
| if (Page* page = renderer()->frame()->page())
|
|
|