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

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

Issue 2408243002: cc : Move screen space scale factor to root transform node (Closed)
Patch Set: test Created 4 years, 2 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 unified diff | Download patch
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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 }; 447 };
448 Vector<BlinkEffectAndCcIdPair> m_effectStack; 448 Vector<BlinkEffectAndCcIdPair> m_effectStack;
449 449
450 #if DCHECK_IS_ON() 450 #if DCHECK_IS_ON()
451 HashSet<const EffectPaintPropertyNode*> m_effectNodesConverted; 451 HashSet<const EffectPaintPropertyNode*> m_effectNodesConverted;
452 bool m_isFirstEffectEver; 452 bool m_isFirstEffectEver;
453 #endif 453 #endif
454 }; 454 };
455 455
456 void PropertyTreeManager::setDeviceScaleFactor(float deviceScaleFactor) { 456 void PropertyTreeManager::setDeviceScaleFactor(float deviceScaleFactor) {
457 auto& rootTransformNode = *transformTree().Node(kSecondaryRootNodeId); 457 auto& rootTransformNode = *transformTree().Node(kRealRootNodeId);
458 rootTransformNode.local.Scale(deviceScaleFactor, deviceScaleFactor); 458 rootTransformNode.needs_surface_contents_scale = true;
459 rootTransformNode.surface_contents_scale =
460 gfx::Vector2dF(deviceScaleFactor, deviceScaleFactor);
461 // TODO(jaydasika) : We shouldn't set ToScreen and FromScreen of root
weiliangc 2016/10/13 21:16:18 Why does this not work in cc right now?
jaydasika 2016/10/13 21:46:48 It doesn't work. We only update transforms from no
462 // transform node here. They should be set while updating transform tree in
463 // cc.
464 gfx::Transform toScreen;
465 toScreen.Scale(deviceScaleFactor, deviceScaleFactor);
466 transformTree().SetToScreen(rootTransformNode.id, toScreen);
467 gfx::Transform fromScreen;
468 if (!toScreen.GetInverse(&fromScreen))
469 rootTransformNode.ancestors_are_invertible = false;
470 transformTree().SetFromScreen(rootTransformNode.id, fromScreen);
471 transformTree().set_needs_update(true);
459 } 472 }
460 473
461 int PropertyTreeManager::compositorIdForTransformNode( 474 int PropertyTreeManager::compositorIdForTransformNode(
462 const TransformPaintPropertyNode* transformNode) { 475 const TransformPaintPropertyNode* transformNode) {
463 if (!transformNode) 476 if (!transformNode)
464 return kSecondaryRootNodeId; 477 return kSecondaryRootNodeId;
465 478
466 auto it = m_transformNodeMap.find(transformNode); 479 auto it = m_transformNodeMap.find(transformNode);
467 if (it != m_transformNodeMap.end()) 480 if (it != m_transformNodeMap.end())
468 return it->value; 481 return it->value;
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 } 775 }
763 m_contentLayerClients.clear(); 776 m_contentLayerClients.clear();
764 m_contentLayerClients.swap(newContentLayerClients); 777 m_contentLayerClients.swap(newContentLayerClients);
765 778
766 // Mark the property trees as having been rebuilt. 779 // Mark the property trees as having been rebuilt.
767 layerTree->property_trees()->sequence_number = kPropertyTreeSequenceNumber; 780 layerTree->property_trees()->sequence_number = kPropertyTreeSequenceNumber;
768 layerTree->property_trees()->needs_rebuild = false; 781 layerTree->property_trees()->needs_rebuild = false;
769 } 782 }
770 783
771 } // namespace blink 784 } // namespace blink
OLDNEW
« cc/trees/layer_tree_host_common_unittest.cc ('K') | « cc/trees/property_tree_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698