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

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

Issue 1547893003: WIP - compositor worker mega patch. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "core/paint/PaintLayerStackingNodeIterator.h" 53 #include "core/paint/PaintLayerStackingNodeIterator.h"
54 #include "core/paint/PaintTiming.h" 54 #include "core/paint/PaintTiming.h"
55 #include "core/paint/ScrollableAreaPainter.h" 55 #include "core/paint/ScrollableAreaPainter.h"
56 #include "core/paint/TransformRecorder.h" 56 #include "core/paint/TransformRecorder.h"
57 #include "core/plugins/PluginView.h" 57 #include "core/plugins/PluginView.h"
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/CompositorMutableProperties.h"
63 #include "platform/graphics/GraphicsContext.h" 64 #include "platform/graphics/GraphicsContext.h"
64 #include "platform/graphics/paint/ClipDisplayItem.h" 65 #include "platform/graphics/paint/ClipDisplayItem.h"
65 #include "platform/graphics/paint/CullRect.h" 66 #include "platform/graphics/paint/CullRect.h"
66 #include "platform/graphics/paint/PaintController.h" 67 #include "platform/graphics/paint/PaintController.h"
67 #include "platform/graphics/paint/TransformDisplayItem.h" 68 #include "platform/graphics/paint/TransformDisplayItem.h"
68 #include "public/platform/WebCompositorMutableProperties.h"
69 #include "wtf/CurrentTime.h" 69 #include "wtf/CurrentTime.h"
70 #include "wtf/text/StringBuilder.h" 70 #include "wtf/text/StringBuilder.h"
71 71
72 namespace blink { 72 namespace blink {
73 73
74 using namespace HTMLNames; 74 using namespace HTMLNames;
75 75
76 static IntRect clipBox(LayoutBox* layoutObject); 76 static IntRect clipBox(LayoutBox* layoutObject);
77 77
78 static IntRect contentsRect(const LayoutObject* layoutObject) 78 static IntRect contentsRect(const LayoutObject* layoutObject)
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 PassOwnPtr<GraphicsLayer> CompositedLayerMapping::createGraphicsLayer(Compositin gReasons reasons) 212 PassOwnPtr<GraphicsLayer> CompositedLayerMapping::createGraphicsLayer(Compositin gReasons reasons)
213 { 213 {
214 GraphicsLayerFactory* graphicsLayerFactory = nullptr; 214 GraphicsLayerFactory* graphicsLayerFactory = nullptr;
215 if (Page* page = layoutObject()->frame()->page()) 215 if (Page* page = layoutObject()->frame()->page())
216 graphicsLayerFactory = page->chromeClient().graphicsLayerFactory(); 216 graphicsLayerFactory = page->chromeClient().graphicsLayerFactory();
217 217
218 OwnPtr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(graphicsLayerFac tory, this); 218 OwnPtr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(graphicsLayerFac tory, this);
219 219
220 graphicsLayer->setCompositingReasons(reasons); 220 graphicsLayer->setCompositingReasons(reasons);
221 if (Node* owningNode = m_owningLayer.layoutObject()->generatingNode())
222 graphicsLayer->setOwnerNodeId(DOMNodeIds::idForNode(owningNode));
223
224 return graphicsLayer.release(); 221 return graphicsLayer.release();
225 } 222 }
226 223
227 void CompositedLayerMapping::createPrimaryGraphicsLayer() 224 void CompositedLayerMapping::createPrimaryGraphicsLayer()
228 { 225 {
229 m_graphicsLayer = createGraphicsLayer(m_owningLayer.compositingReasons()); 226 m_graphicsLayer = createGraphicsLayer(m_owningLayer.compositingReasons());
230 227
231 updateOpacity(layoutObject()->styleRef()); 228 updateOpacity(layoutObject()->styleRef());
232 updateTransform(layoutObject()->styleRef()); 229 updateTransform(layoutObject()->styleRef());
233 updateFilters(layoutObject()->styleRef()); 230 updateFilters(layoutObject()->styleRef());
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 } 1518 }
1522 1519
1523 void CompositedLayerMapping::updateElementIdAndCompositorMutableProperties() 1520 void CompositedLayerMapping::updateElementIdAndCompositorMutableProperties()
1524 { 1521 {
1525 if (!RuntimeEnabledFeatures::compositorWorkerEnabled()) 1522 if (!RuntimeEnabledFeatures::compositorWorkerEnabled())
1526 return; 1523 return;
1527 1524
1528 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "CompositedLaye rMapping::updateElementId()"); 1525 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "CompositedLaye rMapping::updateElementId()");
1529 1526
1530 uint64_t elementId = 0; 1527 uint64_t elementId = 0;
1531 uint32_t mainMutableProperties = WebCompositorMutablePropertyNone; 1528 uint32_t mainMutableProperties = CompositorMutablePropertyNone;
1532 uint32_t scrollMutableProperties = WebCompositorMutablePropertyNone; 1529 uint32_t scrollMutableProperties = CompositorMutablePropertyNone;
1533 1530
1534 if (m_owningLayer.layoutObject()->style()->hasCompositorProxy()) { 1531 if (m_owningLayer.layoutObject()->style()->hasCompositorProxy()) {
1535 if (Node* owningNode = m_owningLayer.layoutObject()->generatingNode()) { 1532 if (Node* owningNode = m_owningLayer.layoutObject()->generatingNode()) {
1536 if (owningNode->isElementNode()) { 1533 if (owningNode->isElementNode()) {
1537 Element* owningElement = toElement(owningNode); 1534 Element* owningElement = toElement(owningNode);
1538 uint32_t compositorMutableProperties = owningElement->compositor MutableProperties(); 1535 uint32_t compositorMutableProperties = owningElement->compositor MutableProperties();
1539 elementId = DOMNodeIds::idForNode(owningNode); 1536 elementId = DOMNodeIds::idForNode(owningNode);
1540 mainMutableProperties = (WebCompositorMutablePropertyOpacity | W ebCompositorMutablePropertyTransform) & compositorMutableProperties; 1537 mainMutableProperties = (CompositorMutablePropertyOpacity | Comp ositorMutablePropertyTransform) & compositorMutableProperties;
1541 scrollMutableProperties = (WebCompositorMutablePropertyScrollLef t | WebCompositorMutablePropertyScrollTop) & compositorMutableProperties; 1538 scrollMutableProperties = (CompositorMutablePropertyScrollLeft | CompositorMutablePropertyScrollTop) & compositorMutableProperties;
1542 } 1539 }
1543 } 1540 }
1544 } 1541 }
1545 1542
1546 m_graphicsLayer->setElementId(elementId); 1543 m_graphicsLayer->setElementId(elementId);
1547 m_graphicsLayer->setCompositorMutableProperties(mainMutableProperties); 1544 m_graphicsLayer->setCompositorMutableProperties(mainMutableProperties);
1548 1545
1549 if (m_scrollingContentsLayer.get()) { 1546 if (m_scrollingContentsLayer.get()) {
1550 m_scrollingContentsLayer->setElementId(elementId); 1547 m_scrollingContentsLayer->setElementId(elementId);
1551 m_scrollingContentsLayer->setCompositorMutableProperties(scrollMutablePr operties); 1548 m_scrollingContentsLayer->setCompositorMutableProperties(scrollMutablePr operties);
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
2582 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2579 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2583 name = "Scrolling Block Selection Layer"; 2580 name = "Scrolling Block Selection Layer";
2584 } else { 2581 } else {
2585 ASSERT_NOT_REACHED(); 2582 ASSERT_NOT_REACHED();
2586 } 2583 }
2587 2584
2588 return name; 2585 return name;
2589 } 2586 }
2590 2587
2591 } // namespace blink 2588 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698