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

Unified Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp

Issue 2318933006: [SPV2] Add the device scale factor to the root transform node (Closed)
Patch Set: Refactor into helper on PropertyTreeManager Created 4 years, 3 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 | « third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
index 8e811bf0f93badfb6929d77332b80e14d94905fa..5a94eac8308d9986e88965a9f25243733b548e52 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -218,6 +218,9 @@ public:
m_effectStack.append(BlinkEffectAndCcIdPair{nullptr, kSecondaryRootNodeId});
}
+ // TODO(pdr): This will need to be unified with how viewport scale works.
+ void setDeviceScaleFactor(float);
+
int compositorIdForTransformNode(const TransformPaintPropertyNode*);
int compositorIdForClipNode(const ClipPaintPropertyNode*);
int switchToEffectNode(const EffectPaintPropertyNode& nextEffect);
@@ -255,6 +258,12 @@ private:
#endif
};
+void PropertyTreeManager::setDeviceScaleFactor(float deviceScaleFactor)
+{
+ auto& rootTransformNode = *transformTree().Node(kSecondaryRootNodeId);
+ rootTransformNode.local.Scale(deviceScaleFactor, deviceScaleFactor);
+}
+
int PropertyTreeManager::compositorIdForTransformNode(const TransformPaintPropertyNode* transformNode)
{
if (!transformNode)
@@ -434,6 +443,7 @@ void PaintArtifactCompositor::update(const PaintArtifact& paintArtifact)
m_extraDataForTesting = wrapUnique(new ExtraDataForTesting);
setMinimalPropertyTrees(host->GetLayerTree()->property_trees(), m_rootLayer->id());
+
m_rootLayer->RemoveAllChildren();
m_rootLayer->set_property_tree_sequence_number(kPropertyTreeSequenceNumber);
m_rootLayer->SetTransformTreeIndex(kSecondaryRootNodeId);
@@ -442,6 +452,8 @@ void PaintArtifactCompositor::update(const PaintArtifact& paintArtifact)
m_rootLayer->SetScrollTreeIndex(kRealRootNodeId);
PropertyTreeManager propertyTreeManager(*host->GetLayerTree()->property_trees(), m_rootLayer.get());
+ propertyTreeManager.setDeviceScaleFactor(host->GetLayerTree()->device_scale_factor());
+
m_contentLayerClients.clear();
m_contentLayerClients.reserveCapacity(paintArtifact.paintChunks().size());
for (const PaintChunk& paintChunk : paintArtifact.paintChunks()) {
« no previous file with comments | « third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698