OLD | NEW |
---|---|
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 #include "platform/LengthFunctions.h" | 58 #include "platform/LengthFunctions.h" |
59 #include "platform/RuntimeEnabledFeatures.h" | 59 #include "platform/RuntimeEnabledFeatures.h" |
60 #include "platform/fonts/FontCache.h" | 60 #include "platform/fonts/FontCache.h" |
61 #include "platform/geometry/TransformState.h" | 61 #include "platform/geometry/TransformState.h" |
62 #include "platform/graphics/BitmapImage.h" | 62 #include "platform/graphics/BitmapImage.h" |
63 #include "platform/graphics/GraphicsContext.h" | 63 #include "platform/graphics/GraphicsContext.h" |
64 #include "platform/graphics/paint/ClipDisplayItem.h" | 64 #include "platform/graphics/paint/ClipDisplayItem.h" |
65 #include "platform/graphics/paint/CullRect.h" | 65 #include "platform/graphics/paint/CullRect.h" |
66 #include "platform/graphics/paint/PaintController.h" | 66 #include "platform/graphics/paint/PaintController.h" |
67 #include "platform/graphics/paint/TransformDisplayItem.h" | 67 #include "platform/graphics/paint/TransformDisplayItem.h" |
68 #include "public/platform/WebCompositorMutableProperties.h" | |
68 #include "wtf/CurrentTime.h" | 69 #include "wtf/CurrentTime.h" |
69 #include "wtf/text/StringBuilder.h" | 70 #include "wtf/text/StringBuilder.h" |
70 | 71 |
71 namespace blink { | 72 namespace blink { |
72 | 73 |
73 using namespace HTMLNames; | 74 using namespace HTMLNames; |
74 | 75 |
75 static IntRect clipBox(LayoutBox* layoutObject); | 76 static IntRect clipBox(LayoutBox* layoutObject); |
76 | 77 |
77 static IntRect contentsRect(const LayoutObject* layoutObject) | 78 static IntRect contentsRect(const LayoutObject* layoutObject) |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
550 if (layoutObject->isLayoutPart()) { | 551 if (layoutObject->isLayoutPart()) { |
551 if (PaintLayerCompositor::parentFrameContentLayers(toLayoutPart(layoutOb ject))) | 552 if (PaintLayerCompositor::parentFrameContentLayers(toLayoutPart(layoutOb ject))) |
552 layerConfigChanged = true; | 553 layerConfigChanged = true; |
553 } | 554 } |
554 | 555 |
555 // Changes to either the internal hierarchy or the mask layer have an impact | 556 // Changes to either the internal hierarchy or the mask layer have an impact |
556 // on painting phases, so we need to update when either are updated. | 557 // on painting phases, so we need to update when either are updated. |
557 if (layerConfigChanged || maskLayerChanged) | 558 if (layerConfigChanged || maskLayerChanged) |
558 updatePaintingPhases(); | 559 updatePaintingPhases(); |
559 | 560 |
561 updateElementIdAndMutableProperties(); | |
562 | |
560 return layerConfigChanged; | 563 return layerConfigChanged; |
561 } | 564 } |
562 | 565 |
563 static IntRect clipBox(LayoutBox* layoutObject) | 566 static IntRect clipBox(LayoutBox* layoutObject) |
564 { | 567 { |
565 LayoutRect result = LayoutRect(LayoutRect::infiniteIntRect()); | 568 LayoutRect result = LayoutRect(LayoutRect::infiniteIntRect()); |
566 if (layoutObject->hasOverflowClip()) | 569 if (layoutObject->hasOverflowClip()) |
567 result = layoutObject->overflowClipRect(LayoutPoint()); | 570 result = layoutObject->overflowClipRect(LayoutPoint()); |
568 | 571 |
569 if (layoutObject->hasClip()) | 572 if (layoutObject->hasClip()) |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
737 m_owningLayer.scrollableArea()->positionOverflowControls(); | 740 m_owningLayer.scrollableArea()->positionOverflowControls(); |
738 | 741 |
739 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { | 742 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { |
740 updateLayerBlendMode(layoutObject()->styleRef()); | 743 updateLayerBlendMode(layoutObject()->styleRef()); |
741 updateIsRootForIsolatedGroup(); | 744 updateIsRootForIsolatedGroup(); |
742 } | 745 } |
743 | 746 |
744 updateContentsRect(); | 747 updateContentsRect(); |
745 updateBackgroundColor(); | 748 updateBackgroundColor(); |
746 updateDrawsContent(); | 749 updateDrawsContent(); |
750 updateElementIdAndMutableProperties(); | |
747 updateContentsOpaque(); | 751 updateContentsOpaque(); |
748 updateAfterPartResize(); | 752 updateAfterPartResize(); |
749 updateRenderingContext(); | 753 updateRenderingContext(); |
750 updateShouldFlattenTransform(); | 754 updateShouldFlattenTransform(); |
751 updateChildrenTransform(); | 755 updateChildrenTransform(); |
752 updateScrollParent(scrollParent()); | 756 updateScrollParent(scrollParent()); |
753 registerScrollingLayers(); | 757 registerScrollingLayers(); |
754 | 758 |
755 updateCompositingReasons(); | 759 updateCompositingReasons(); |
756 } | 760 } |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1499 // selection layer (if they exist) as not flattening. Having them flatten | 1503 // selection layer (if they exist) as not flattening. Having them flatten |
1500 // causes unclipped render surfaces which cause bugs. | 1504 // causes unclipped render surfaces which cause bugs. |
1501 // http://crbug.com/521768 | 1505 // http://crbug.com/521768 |
1502 if (hasScrollingLayer()) { | 1506 if (hasScrollingLayer()) { |
1503 m_scrollingContentsLayer->setShouldFlattenTransform(false); | 1507 m_scrollingContentsLayer->setShouldFlattenTransform(false); |
1504 if (m_scrollingBlockSelectionLayer) | 1508 if (m_scrollingBlockSelectionLayer) |
1505 m_scrollingBlockSelectionLayer->setShouldFlattenTransform(false); | 1509 m_scrollingBlockSelectionLayer->setShouldFlattenTransform(false); |
1506 } | 1510 } |
1507 } | 1511 } |
1508 | 1512 |
1513 void CompositedLayerMapping::updateElementIdAndMutableProperties() | |
1514 { | |
1515 if (!RuntimeEnabledFeatures::compositorWorkerEnabled()) | |
1516 return; | |
1517 | |
1518 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "CompositedLaye rMapping::updateElementId()"); | |
1519 | |
1520 uint64_t elementId = 0; | |
1521 uint32_t mainMutableProperties = WebCompositorMutablePropertyNone; | |
1522 uint32_t scrollMutableProperties = WebCompositorMutablePropertyNone; | |
1523 | |
1524 if (m_owningLayer.layoutObject()->style()->hasCompositorProxy()) { | |
1525 if (Node* owningNode = m_owningLayer.layoutObject()->generatingNode()) { | |
1526 elementId = DOMNodeIds::idForNode(owningNode); | |
1527 mainMutableProperties = WebCompositorMutablePropertyOpacity | WebCom positorMutablePropertyTransform; | |
1528 scrollMutableProperties = WebCompositorMutablePropertyScrollLeft | W ebCompositorMutablePropertyScrollTop; | |
1529 } | |
1530 } | |
1531 | |
1532 m_graphicsLayer->setElementId(elementId); | |
chrishtr
2015/11/24 16:22:50
Can an element which is indirectly composited end
Ian Vollick
2015/11/25 18:28:45
Nope, a CompositorProxy is a direct compositing re
| |
1533 m_graphicsLayer->setMutableProperties(mainMutableProperties); | |
1534 | |
1535 if (m_scrollingContentsLayer.get()) { | |
1536 m_scrollingContentsLayer->setElementId(elementId); | |
1537 m_scrollingContentsLayer->setMutableProperties(scrollMutableProperties); | |
1538 } | |
1539 } | |
1540 | |
1509 bool CompositedLayerMapping::updateForegroundLayer(bool needsForegroundLayer) | 1541 bool CompositedLayerMapping::updateForegroundLayer(bool needsForegroundLayer) |
1510 { | 1542 { |
1511 bool layerChanged = false; | 1543 bool layerChanged = false; |
1512 if (needsForegroundLayer) { | 1544 if (needsForegroundLayer) { |
1513 if (!m_foregroundLayer) { | 1545 if (!m_foregroundLayer) { |
1514 m_foregroundLayer = createGraphicsLayer(CompositingReasonLayerForFor eground); | 1546 m_foregroundLayer = createGraphicsLayer(CompositingReasonLayerForFor eground); |
1515 m_foregroundLayer->setPaintingPhase(GraphicsLayerPaintForeground); | 1547 m_foregroundLayer->setPaintingPhase(GraphicsLayerPaintForeground); |
1516 layerChanged = true; | 1548 layerChanged = true; |
1517 } | 1549 } |
1518 } else if (m_foregroundLayer) { | 1550 } else if (m_foregroundLayer) { |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2521 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2553 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
2522 name = "Scrolling Block Selection Layer"; | 2554 name = "Scrolling Block Selection Layer"; |
2523 } else { | 2555 } else { |
2524 ASSERT_NOT_REACHED(); | 2556 ASSERT_NOT_REACHED(); |
2525 } | 2557 } |
2526 | 2558 |
2527 return name; | 2559 return name; |
2528 } | 2560 } |
2529 | 2561 |
2530 } // namespace blink | 2562 } // namespace blink |
OLD | NEW |