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

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

Issue 2473453002: cc : Reland move screen space scale factor to root transform node (Closed)
Patch Set: comments Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « cc/trees/property_tree_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/graphics/compositing/PaintArtifactCompositor.h" 5 #include "platform/graphics/compositing/PaintArtifactCompositor.h"
6 6
7 #include "cc/layers/content_layer_client.h" 7 #include "cc/layers/content_layer_client.h"
8 #include "cc/layers/layer.h" 8 #include "cc/layers/layer.h"
9 #include "cc/layers/picture_layer.h" 9 #include "cc/layers/picture_layer.h"
10 #include "cc/playback/display_item_list.h" 10 #include "cc/playback/display_item_list.h"
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 }; 446 };
447 Vector<BlinkEffectAndCcIdPair> m_effectStack; 447 Vector<BlinkEffectAndCcIdPair> m_effectStack;
448 448
449 #if DCHECK_IS_ON() 449 #if DCHECK_IS_ON()
450 HashSet<const EffectPaintPropertyNode*> m_effectNodesConverted; 450 HashSet<const EffectPaintPropertyNode*> m_effectNodesConverted;
451 bool m_isFirstEffectEver; 451 bool m_isFirstEffectEver;
452 #endif 452 #endif
453 }; 453 };
454 454
455 void PropertyTreeManager::setDeviceScaleFactor(float deviceScaleFactor) { 455 void PropertyTreeManager::setDeviceScaleFactor(float deviceScaleFactor) {
456 auto& rootTransformNode = *transformTree().Node(kSecondaryRootNodeId); 456 // TODO(jaydasika): We shouldn't set ToScreeen and FromScreen of root
457 rootTransformNode.local.Scale(deviceScaleFactor, deviceScaleFactor); 457 // transform node here. They should be set while updating transform tree in
458 // cc.
459 gfx::Transform toScreen;
460 toScreen.Scale(deviceScaleFactor, deviceScaleFactor);
461 transformTree().SetToScreen(kRealRootNodeId, toScreen);
462 gfx::Transform fromScreen;
463 bool invertible = toScreen.GetInverse(&fromScreen);
464 DCHECK(invertible);
465 transformTree().SetFromScreen(kRealRootNodeId, fromScreen);
466 transformTree().set_needs_update(true);
458 } 467 }
459 468
460 int PropertyTreeManager::compositorIdForTransformNode( 469 int PropertyTreeManager::compositorIdForTransformNode(
461 const TransformPaintPropertyNode* transformNode) { 470 const TransformPaintPropertyNode* transformNode) {
462 if (!transformNode) 471 if (!transformNode)
463 return kSecondaryRootNodeId; 472 return kSecondaryRootNodeId;
464 473
465 auto it = m_transformNodeMap.find(transformNode); 474 auto it = m_transformNodeMap.find(transformNode);
466 if (it != m_transformNodeMap.end()) 475 if (it != m_transformNodeMap.end())
467 return it->value; 476 return it->value;
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 m_contentLayerClients.clear(); 773 m_contentLayerClients.clear();
765 m_contentLayerClients.swap(newContentLayerClients); 774 m_contentLayerClients.swap(newContentLayerClients);
766 775
767 // Mark the property trees as having been rebuilt. 776 // Mark the property trees as having been rebuilt.
768 layerTree->property_trees()->sequence_number = kPropertyTreeSequenceNumber; 777 layerTree->property_trees()->sequence_number = kPropertyTreeSequenceNumber;
769 layerTree->property_trees()->needs_rebuild = false; 778 layerTree->property_trees()->needs_rebuild = false;
770 layerTree->property_trees()->ResetCachedData(); 779 layerTree->property_trees()->ResetCachedData();
771 } 780 }
772 781
773 } // namespace blink 782 } // namespace blink
OLDNEW
« no previous file with comments | « cc/trees/property_tree_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698