OLD | NEW |
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 Loading... |
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(kRealRootNodeId); | 456 auto& rootTransformNode = *transformTree().Node(kSecondaryRootNodeId); |
457 // TODO(jaydasika) : We shouldn't set ToScreen and FromScreen of root | 457 rootTransformNode.local.Scale(deviceScaleFactor, deviceScaleFactor); |
458 // transform node here. They should be set while updating transform tree in | |
459 // cc. | |
460 gfx::Transform toScreen; | |
461 toScreen.Scale(deviceScaleFactor, deviceScaleFactor); | |
462 transformTree().SetToScreen(rootTransformNode.id, toScreen); | |
463 gfx::Transform fromScreen; | |
464 if (!toScreen.GetInverse(&fromScreen)) | |
465 rootTransformNode.ancestors_are_invertible = false; | |
466 transformTree().SetFromScreen(rootTransformNode.id, fromScreen); | |
467 transformTree().set_needs_update(true); | |
468 } | 458 } |
469 | 459 |
470 int PropertyTreeManager::compositorIdForTransformNode( | 460 int PropertyTreeManager::compositorIdForTransformNode( |
471 const TransformPaintPropertyNode* transformNode) { | 461 const TransformPaintPropertyNode* transformNode) { |
472 if (!transformNode) | 462 if (!transformNode) |
473 return kSecondaryRootNodeId; | 463 return kSecondaryRootNodeId; |
474 | 464 |
475 auto it = m_transformNodeMap.find(transformNode); | 465 auto it = m_transformNodeMap.find(transformNode); |
476 if (it != m_transformNodeMap.end()) | 466 if (it != m_transformNodeMap.end()) |
477 return it->value; | 467 return it->value; |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 m_contentLayerClients.clear(); | 764 m_contentLayerClients.clear(); |
775 m_contentLayerClients.swap(newContentLayerClients); | 765 m_contentLayerClients.swap(newContentLayerClients); |
776 | 766 |
777 // Mark the property trees as having been rebuilt. | 767 // Mark the property trees as having been rebuilt. |
778 layerTree->property_trees()->sequence_number = kPropertyTreeSequenceNumber; | 768 layerTree->property_trees()->sequence_number = kPropertyTreeSequenceNumber; |
779 layerTree->property_trees()->needs_rebuild = false; | 769 layerTree->property_trees()->needs_rebuild = false; |
780 layerTree->property_trees()->ResetCachedData(); | 770 layerTree->property_trees()->ResetCachedData(); |
781 } | 771 } |
782 | 772 |
783 } // namespace blink | 773 } // namespace blink |
OLD | NEW |