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

Unified Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 183103007: Implement will-change-based GPU rasterization hint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move hint from WebLayer to WebContentLayer 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/style/RenderStyle.h ('k') | Source/platform/graphics/GraphicsLayer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/RenderStyle.cpp
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp
index f1230077c8fa4ee75a4b250e81a0f95d5ce1a66a..3927e5844d3bcbbd77e8ee06b2c0992e6044a519 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -651,7 +651,8 @@ StyleDifference RenderStyle::repaintOnlyDiff(const RenderStyle* other, unsigned&
|| rareNonInheritedData->m_perspective != other->rareNonInheritedData->m_perspective
|| rareNonInheritedData->m_perspectiveOriginX != other->rareNonInheritedData->m_perspectiveOriginX
|| rareNonInheritedData->m_perspectiveOriginY != other->rareNonInheritedData->m_perspectiveOriginY
- || hasWillChangeCompositingHint() != other->hasWillChangeCompositingHint())
+ || hasWillChangeCompositingHint() != other->hasWillChangeCompositingHint()
+ || hasWillChangeGpuRasterizationHint() != other->hasWillChangeGpuRasterizationHint())
return StyleDifferenceRecompositeLayer;
}
@@ -851,6 +852,25 @@ bool RenderStyle::hasWillChangeCompositingHint() const
return false;
}
+bool RenderStyle::hasWillChangeGpuRasterizationHint() const
+{
+ if (willChangeContents())
+ return true;
+
+ for (size_t i = 0; i < rareNonInheritedData->m_willChange->m_properties.size(); ++i) {
+ switch (rareNonInheritedData->m_willChange->m_properties[i]) {
+ case CSSPropertyWidth:
+ case CSSPropertyHeight:
+ case CSSPropertyBackgroundColor:
+ case CSSPropertyBackgroundPosition:
+ return true;
+ default:
+ break;
+ }
+ }
+ return false;
+}
+
inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation> >& transformOperations, RenderStyle::ApplyTransformOrigin applyOrigin)
{
// transform-origin brackets the transform with translate operations.
« no previous file with comments | « Source/core/rendering/style/RenderStyle.h ('k') | Source/platform/graphics/GraphicsLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698