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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2637013002: CONTINUED Make FrameSelection to hold non-canonicalized positions (Closed)
Patch Set: 2017-02-08T18:56:19 Created 3 years, 10 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 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 Vector<PaintLayer*>& layersNeedingPaintInvalidation) { 839 Vector<PaintLayer*>& layersNeedingPaintInvalidation) {
840 if (!squashingLayer) 840 if (!squashingLayer)
841 return; 841 return;
842 842
843 LayoutPoint compositingContainerOffsetFromParentGraphicsLayer = 843 LayoutPoint compositingContainerOffsetFromParentGraphicsLayer =
844 -graphicsLayerParentLocation; 844 -graphicsLayerParentLocation;
845 if (compositingContainer) 845 if (compositingContainer)
846 compositingContainerOffsetFromParentGraphicsLayer += 846 compositingContainerOffsetFromParentGraphicsLayer +=
847 compositingContainer->subpixelAccumulation(); 847 compositingContainer->subpixelAccumulation();
848 848
849 #if DCHECK_IS_ON() 849 // TODO(trchen): We should enable this for below comment out |DCHECK()| once
850 const PaintLayer* commonTransformAncestor = nullptr; 850 // we have simple reproduce case and fix it. See http://crbug.com/646437 for
851 if (compositingContainer && compositingContainer->transform()) 851 // details.
852 commonTransformAncestor = compositingContainer; 852 // const PaintLayer* commonTransformAncestor = nullptr;
853 else if (compositingContainer) 853 // if (compositingContainer && compositingContainer->transform())
854 commonTransformAncestor = compositingContainer->transformAncestor(); 854 // commonTransformAncestor = compositingContainer;
855 #endif 855 // else if (compositingContainer)
856 // commonTransformAncestor = compositingContainer->transformAncestor();
857
856 // FIXME: Cache these offsets. 858 // FIXME: Cache these offsets.
857 LayoutPoint compositingContainerOffsetFromTransformedAncestor; 859 LayoutPoint compositingContainerOffsetFromTransformedAncestor;
858 if (compositingContainer && !compositingContainer->transform()) 860 if (compositingContainer && !compositingContainer->transform())
859 compositingContainerOffsetFromTransformedAncestor = 861 compositingContainerOffsetFromTransformedAncestor =
860 compositingContainer->computeOffsetFromTransformedAncestor(); 862 compositingContainer->computeOffsetFromTransformedAncestor();
861 863
862 LayoutRect totalSquashBounds; 864 LayoutRect totalSquashBounds;
863 for (size_t i = 0; i < layers.size(); ++i) { 865 for (size_t i = 0; i < layers.size(); ++i) {
864 LayoutRect squashedBounds = 866 LayoutRect squashedBounds =
865 layers[i].paintLayer->boundingBoxForCompositing(); 867 layers[i].paintLayer->boundingBoxForCompositing();
866 868
867 // Store the local bounds of the Layer subtree before applying the offset. 869 // Store the local bounds of the Layer subtree before applying the offset.
868 layers[i].compositedBounds = squashedBounds; 870 layers[i].compositedBounds = squashedBounds;
869 871
870 #if DCHECK_IS_ON() 872 // TODO(trchen): We should enable this |DCHECK()| once we have simple
871 DCHECK(layers[i].paintLayer->transformAncestor() == 873 // reproduce case and fix it. See http://crbug.com/646437 for details.
872 commonTransformAncestor); 874 // DCHECK(layers[i].paintLayer->transformAncestor() ==
873 #endif 875 // commonTransformAncestor);
874 LayoutPoint squashedLayerOffsetFromTransformedAncestor = 876 LayoutPoint squashedLayerOffsetFromTransformedAncestor =
875 layers[i].paintLayer->computeOffsetFromTransformedAncestor(); 877 layers[i].paintLayer->computeOffsetFromTransformedAncestor();
876 LayoutSize squashedLayerOffsetFromCompositingContainer = 878 LayoutSize squashedLayerOffsetFromCompositingContainer =
877 squashedLayerOffsetFromTransformedAncestor - 879 squashedLayerOffsetFromTransformedAncestor -
878 compositingContainerOffsetFromTransformedAncestor; 880 compositingContainerOffsetFromTransformedAncestor;
879 881
880 squashedBounds.move(squashedLayerOffsetFromCompositingContainer); 882 squashedBounds.move(squashedLayerOffsetFromCompositingContainer);
881 totalSquashBounds.unite(squashedBounds); 883 totalSquashBounds.unite(squashedBounds);
882 } 884 }
883 885
(...skipping 2585 matching lines...) Expand 10 before | Expand all | Expand 10 after
3469 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { 3471 } else if (graphicsLayer == m_decorationOutlineLayer.get()) {
3470 name = "Decoration Layer"; 3472 name = "Decoration Layer";
3471 } else { 3473 } else {
3472 ASSERT_NOT_REACHED(); 3474 ASSERT_NOT_REACHED();
3473 } 3475 }
3474 3476
3475 return name; 3477 return name;
3476 } 3478 }
3477 3479
3478 } // namespace blink 3480 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/page/FocusController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698