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

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

Issue 202523008: Simplify CompositingReasonFinder::requiresCompositingForPlugin (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix bad merge Created 6 years, 9 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 | « Source/core/rendering/compositing/CompositingReasonFinder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/compositing/CompositingReasonFinder.cpp
diff --git a/Source/core/rendering/compositing/CompositingReasonFinder.cpp b/Source/core/rendering/compositing/CompositingReasonFinder.cpp
index 6013fa7f9242cf4104d79e25ad08a22d207ba3a2..e8c0212d234fb09993f3e40effb5287f030ae073 100644
--- a/Source/core/rendering/compositing/CompositingReasonFinder.cpp
+++ b/Source/core/rendering/compositing/CompositingReasonFinder.cpp
@@ -69,7 +69,7 @@ CompositingReasons CompositingReasonFinder::directReasons(const RenderLayer* lay
// Only zero or one of the following conditions will be true for a given RenderLayer.
// FIXME: These should be handled by overrides of RenderObject::additionalCompositingReasons.
- if (requiresCompositingForPlugin(renderer, needToRecomputeCompositingRequirements))
+ if (requiresCompositingForPlugin(renderer))
directReasons |= CompositingReasonPlugin;
else if (requiresCompositingForFrame(renderer))
directReasons |= CompositingReasonIFrame;
@@ -131,25 +131,12 @@ bool CompositingReasonFinder::requiresCompositingForTransform(RenderObject* rend
return renderer->hasTransform() && style->transform().has3DOperation();
}
-bool CompositingReasonFinder::requiresCompositingForPlugin(RenderObject* renderer, bool* needToRecomputeCompositingRequirements) const
+bool CompositingReasonFinder::requiresCompositingForPlugin(RenderObject* renderer) const
{
if (!(m_compositingTriggers & PluginTrigger))
return false;
- if (!renderer->isEmbeddedObject() || !toRenderEmbeddedObject(renderer)->allowsAcceleratedCompositing())
- return false;
-
- // FIXME: this seems bogus. If we don't know the layout position/size of the plugin yet, would't that be handled elsewhere?
- *needToRecomputeCompositingRequirements = true;
-
- RenderWidget* pluginRenderer = toRenderWidget(renderer);
- // If we can't reliably know the size of the plugin yet, don't change compositing state.
- if (pluginRenderer->needsLayout())
- return pluginRenderer->hasLayer() && pluginRenderer->layer()->hasCompositedLayerMapping();
-
- // Don't go into compositing mode if height or width are zero, or size is 1x1.
- IntRect contentBox = pixelSnappedIntRect(pluginRenderer->contentBoxRect());
- return contentBox.height() * contentBox.width() > 1;
+ return renderer->isEmbeddedObject() && toRenderEmbeddedObject(renderer)->requiresAcceleratedCompositing();
}
bool CompositingReasonFinder::requiresCompositingForFrame(RenderObject* renderer) const
« no previous file with comments | « Source/core/rendering/compositing/CompositingReasonFinder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698