Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(845)

Unified Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 491773002: Directly composited images are images: ASSERT that (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add isImage() test to contentChanged(). Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9dcc29b989d32463a201e0214ca07f6174113355 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);
@@ -1761,7 +1762,7 @@ bool CompositedLayerMapping::isDirectlyCompositedImage() const
void CompositedLayerMapping::contentChanged(ContentChangeType changeType)
{
- if ((changeType == ImageChanged) && isDirectlyCompositedImage()) {
+ if ((changeType == ImageChanged) && renderer()->isImage() && isDirectlyCompositedImage()) {
updateImageContents();
return;
}
@@ -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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698