Changeset 161192 in webkit
- Timestamp:
- Jan 1, 2014, 10:34:02 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 16 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/graphics/GraphicsLayer.h (modified) (1 diff)
-
WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (modified) (1 diff)
-
WebCore/platform/graphics/ca/PlatformCALayer.h (modified) (4 diffs)
-
WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h (modified) (2 diffs)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.h (modified) (1 diff)
-
WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (modified) (6 diffs)
-
WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (modified) (10 diffs)
-
WebKit2/UIProcess/mac/RemoteLayerTreeHost.h (modified) (2 diffs)
-
WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm (modified) (2 diffs)
-
WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp (modified) (1 diff)
-
WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h (modified) (1 diff)
-
WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (modified) (1 diff)
-
WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (modified) (4 diffs)
-
WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r161191 r161192 1 2014-01-01 Simon Fraser <simon.fraser@apple.com> 2 3 Add a typedef for PlatformLayerID on GraphicsLayer, and migrate RemoteLayerTreeTransaction to use it 4 https://bugs.webkit.org/show_bug.cgi?id=126346 5 6 Reviewed by Tim Horton. 7 8 Remote scrolling tree code is soon going to use RemoteLayerTreeTransaction::LayerID, 9 so it makes more sense to put this layerID type on GraphicsLayer as 10 GraphicsLayer::PlatformLayerID. 11 12 Also add some type cast macros for PlatformCALayer and subclasses, and use them 13 where appropriate. 14 15 * platform/graphics/GraphicsLayer.h: 16 * platform/graphics/ca/GraphicsLayerCA.cpp: 17 (WebCore::GraphicsLayerCA::setName): 18 * platform/graphics/ca/PlatformCALayer.h: 19 (WebCore::PlatformCALayer::isPlatformCALayerMac): 20 (WebCore::PlatformCALayer::isPlatformCALayerRemote): 21 (WebCore::PlatformCALayer::PlatformCALayer): 22 * platform/graphics/ca/mac/PlatformCALayerMac.h: 23 1 24 2013-12-31 Simon Fraser <simon.fraser@apple.com> 2 25 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r160672 r161192 227 227 static std::unique_ptr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient*); 228 228 229 typedef uint64_t PlatformLayerID; 230 229 231 virtual ~GraphicsLayer(); 230 232 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r160672 r161192 390 390 String caLayerDescription; 391 391 392 if (!m_layer->is Remote())392 if (!m_layer->isPlatformCALayerRemote()) 393 393 caLayerDescription = String::format("CALayer(%p) ", m_layer->platformLayer()); 394 394 -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r160672 r161192 81 81 virtual ~PlatformCALayer(); 82 82 83 virtual bool isPlatformCALayerMac() const { return false; } 84 virtual bool isPlatformCALayerRemote() const { return false; } 85 83 86 // This function passes the layer as a void* rather than a PlatformLayer because PlatformLayer 84 87 // is defined differently for Obj C and C++. This allows callers from both languages. … … 99 102 100 103 LayerType layerType() const { return m_layerType; } 101 virtual bool isRemote() const { return false; }102 104 103 105 virtual PlatformCALayer* superlayer() const = 0; … … 212 214 : m_layerType(layerType) 213 215 , m_owner(owner) 214 { 215 216 } 216 { } 217 217 218 218 LayerType m_layerType; … … 221 221 }; 222 222 223 } 223 #define PLATFORM_CALAYER_TYPE_CASTS(ToValueTypeName, predicate) \ 224 TYPE_CASTS_BASE(ToValueTypeName, WebCore::PlatformCALayer, object, object->predicate, object.predicate) 225 226 } // namespace WebCore 224 227 225 228 #endif // USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h
r160672 r161192 149 149 private: 150 150 PlatformCALayerMac(LayerType, PlatformLayer*, PlatformCALayerClient* owner); 151 virtual bool isPlatformCALayerMac() const OVERRIDE { return true; } 151 152 152 153 bool requiresCustomAppearanceUpdateOnBoundsChange() const; … … 157 158 }; 158 159 160 PLATFORM_CALAYER_TYPE_CASTS(PlatformCALayerMac, isPlatformCALayerMac()) 161 159 162 } // namespace WebCore 160 163 -
trunk/Source/WebKit2/ChangeLog
r161189 r161192 1 2014-01-01 Simon Fraser <simon.fraser@apple.com> 2 3 Add a typedef for PlatformLayerID on GraphicsLayer, and migrate RemoteLayerTreeTransaction to use it 4 https://bugs.webkit.org/show_bug.cgi?id=126346 5 6 Reviewed by Tim Horton. 7 8 Remote scrolling tree code is soon going to use RemoteLayerTreeTransaction::LayerID, 9 so it makes more sense to put this layerID type on GraphicsLayer as 10 GraphicsLayer::PlatformLayerID. 11 12 Also add some type cast macros for PlatformCALayer and subclasses, and use them 13 where appropriate. 14 15 * Shared/mac/RemoteLayerTreePropertyApplier.h: 16 * Shared/mac/RemoteLayerTreeTransaction.h: 17 (WebKit::RemoteLayerTreeTransaction::rootLayerID): 18 (WebKit::RemoteLayerTreeTransaction::changedLayers): 19 (WebKit::RemoteLayerTreeTransaction::destroyedLayers): 20 * Shared/mac/RemoteLayerTreeTransaction.mm: 21 (WebKit::RemoteLayerTreeTransaction::decode): 22 (WebKit::RemoteLayerTreeTransaction::setRootLayerID): 23 (WebKit::RemoteLayerTreeTransaction::setDestroyedLayerIDs): 24 (WebKit::RemoteLayerTreeTextStream::operator<<): 25 (WebKit::dumpChangedLayers): 26 (WebKit::RemoteLayerTreeTransaction::description): 27 * UIProcess/mac/RemoteLayerTreeHost.h: 28 * UIProcess/mac/RemoteLayerTreeHost.mm: 29 (WebKit::RemoteLayerTreeHost::commit): 30 (WebKit::RemoteLayerTreeHost::getLayer): 31 * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp: 32 (WebKit::GraphicsLayerCARemote::primaryLayerID): 33 * WebProcess/WebPage/mac/GraphicsLayerCARemote.h: 34 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: 35 (generateLayerID): 36 * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 37 (WebKit::PlatformCALayerRemote::layerID): 38 * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: 39 1 40 2014-01-01 Martin Robinson <mrobinson@igalia.com> 2 41 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.h
r158691 r161192 34 34 class RemoteLayerTreePropertyApplier { 35 35 public: 36 typedef HashMap< RemoteLayerTreeTransaction::LayerID, CALayer *> RelatedLayerMap;36 typedef HashMap<WebCore::GraphicsLayer::PlatformLayerID, CALayer *> RelatedLayerMap; 37 37 static void applyPropertiesToLayer(CALayer *, RemoteLayerTreeTransaction::LayerProperties, RelatedLayerMap); 38 38 static void disableActionsForLayer(CALayer *); -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
r161148 r161192 48 48 class RemoteLayerTreeTransaction { 49 49 public: 50 typedef uint64_t LayerID;51 52 50 enum LayerChange { 53 51 NoChange = 0, … … 87 85 static bool decode(IPC::ArgumentDecoder&, LayerCreationProperties&); 88 86 89 LayerID layerID;87 WebCore::GraphicsLayer::PlatformLayerID layerID; 90 88 WebCore::PlatformCALayer::LayerType type; 91 89 … … 109 107 110 108 String name; 111 Vector< LayerID> children;109 Vector<WebCore::GraphicsLayer::PlatformLayerID> children; 112 110 WebCore::FloatPoint3D position; 113 111 WebCore::FloatSize size; … … 124 122 bool masksToBounds; 125 123 bool opaque; 126 LayerID maskLayerID;124 WebCore::GraphicsLayer::PlatformLayerID maskLayerID; 127 125 WebCore::FloatRect contentsRect; 128 126 float contentsScale; … … 143 141 static bool decode(IPC::ArgumentDecoder&, RemoteLayerTreeTransaction&); 144 142 145 LayerID rootLayerID() const { return m_rootLayerID; }146 void setRootLayerID( LayerID rootLayerID);143 WebCore::GraphicsLayer::PlatformLayerID rootLayerID() const { return m_rootLayerID; } 144 void setRootLayerID(WebCore::GraphicsLayer::PlatformLayerID); 147 145 void layerPropertiesChanged(PlatformCALayerRemote*, LayerProperties&); 148 146 void setCreatedLayers(Vector<LayerCreationProperties>); 149 void setDestroyedLayerIDs(Vector< LayerID>);147 void setDestroyedLayerIDs(Vector<WebCore::GraphicsLayer::PlatformLayerID>); 150 148 151 149 #if !defined(NDEBUG) || !LOG_DISABLED … … 155 153 156 154 Vector<LayerCreationProperties> createdLayers() const { return m_createdLayers; } 157 HashMap< LayerID, LayerProperties> changedLayers() const { return m_changedLayerProperties; }158 Vector< LayerID> destroyedLayers() const { return m_destroyedLayerIDs; }155 HashMap<WebCore::GraphicsLayer::PlatformLayerID, LayerProperties> changedLayers() const { return m_changedLayerProperties; } 156 Vector<WebCore::GraphicsLayer::PlatformLayerID> destroyedLayers() const { return m_destroyedLayerIDs; } 159 157 160 158 private: 161 LayerID m_rootLayerID;162 HashMap< LayerID, LayerProperties> m_changedLayerProperties;159 WebCore::GraphicsLayer::PlatformLayerID m_rootLayerID; 160 HashMap<WebCore::GraphicsLayer::PlatformLayerID, LayerProperties> m_changedLayerProperties; 163 161 Vector<LayerCreationProperties> m_createdLayers; 164 Vector< LayerID> m_destroyedLayerIDs;162 Vector<WebCore::GraphicsLayer::PlatformLayerID> m_destroyedLayerIDs; 165 163 }; 166 164 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
r161148 r161192 360 360 if (!decoder.decode(result.m_destroyedLayerIDs)) 361 361 return false; 362 for (LayerID layerID : result.m_destroyedLayerIDs) { 362 363 for (auto layerID : result.m_destroyedLayerIDs) { 363 364 if (!layerID) 364 365 return false; … … 368 369 } 369 370 370 void RemoteLayerTreeTransaction::setRootLayerID( LayerID rootLayerID)371 void RemoteLayerTreeTransaction::setRootLayerID(GraphicsLayer::PlatformLayerID rootLayerID) 371 372 { 372 373 ASSERT_ARG(rootLayerID, rootLayerID); … … 385 386 } 386 387 387 void RemoteLayerTreeTransaction::setDestroyedLayerIDs(Vector< LayerID> destroyedLayerIDs)388 void RemoteLayerTreeTransaction::setDestroyedLayerIDs(Vector<GraphicsLayer::PlatformLayerID> destroyedLayerIDs) 388 389 { 389 390 m_destroyedLayerIDs = std::move(destroyedLayerIDs); … … 407 408 RemoteLayerTreeTextStream& operator<<(Color); 408 409 RemoteLayerTreeTextStream& operator<<(FloatRect); 409 RemoteLayerTreeTextStream& operator<<(const Vector< RemoteLayerTreeTransaction::LayerID>& layers);410 RemoteLayerTreeTextStream& operator<<(const Vector<WebCore::GraphicsLayer::PlatformLayerID>& layers); 410 411 RemoteLayerTreeTextStream& operator<<(const FilterOperations&); 411 412 … … 538 539 } 539 540 540 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const Vector< RemoteLayerTreeTransaction::LayerID>& layers)541 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const Vector<GraphicsLayer::PlatformLayerID>& layers) 541 542 { 542 543 RemoteLayerTreeTextStream& ts = *this; … … 568 569 } 569 570 570 static void dumpChangedLayers(RemoteLayerTreeTextStream& ts, const HashMap< RemoteLayerTreeTransaction::LayerID, RemoteLayerTreeTransaction::LayerProperties>& changedLayerProperties)571 static void dumpChangedLayers(RemoteLayerTreeTextStream& ts, const HashMap<GraphicsLayer::PlatformLayerID, RemoteLayerTreeTransaction::LayerProperties>& changedLayerProperties) 571 572 { 572 573 if (changedLayerProperties.isEmpty()) … … 578 579 579 580 // Dump the layer properties sorted by layer ID. 580 Vector< RemoteLayerTreeTransaction::LayerID> layerIDs;581 Vector<GraphicsLayer::PlatformLayerID> layerIDs; 581 582 copyKeysToVector(changedLayerProperties, layerIDs); 582 583 std::sort(layerIDs.begin(), layerIDs.end()); … … 594 595 595 596 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) 596 dumpProperty<Vector< RemoteLayerTreeTransaction::LayerID>>(ts, "children", layerProperties.children);597 dumpProperty<Vector<GraphicsLayer::PlatformLayerID>>(ts, "children", layerProperties.children); 597 598 598 599 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::PositionChanged) … … 639 640 640 641 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::MaskLayerChanged) 641 dumpProperty< RemoteLayerTreeTransaction::LayerID>(ts, "maskLayer", layerProperties.maskLayerID);642 dumpProperty<GraphicsLayer::PlatformLayerID>(ts, "maskLayer", layerProperties.maskLayerID); 642 643 643 644 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ContentsRectChanged) … … 742 743 743 744 if (!m_destroyedLayerIDs.isEmpty()) 744 dumpProperty<Vector< RemoteLayerTreeTransaction::LayerID>>(ts, "destroyed-layers", m_destroyedLayerIDs);745 dumpProperty<Vector<GraphicsLayer::PlatformLayerID>>(ts, "destroyed-layers", m_destroyedLayerIDs); 745 746 746 747 ts << ")\n"; -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h
r161148 r161192 51 51 void commit(const RemoteLayerTreeTransaction&); 52 52 53 CALayer *getLayer( RemoteLayerTreeTransaction::LayerID);53 CALayer *getLayer(WebCore::GraphicsLayer::PlatformLayerID) const; 54 54 CALayer *createLayer(RemoteLayerTreeTransaction::LayerCreationProperties); 55 55 … … 57 57 58 58 CALayer *m_rootLayer; 59 HashMap< RemoteLayerTreeTransaction::LayerID, RetainPtr<CALayer>> m_layers;59 HashMap<WebCore::GraphicsLayer::PlatformLayerID, RetainPtr<CALayer>> m_layers; 60 60 }; 61 61 -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm
r160464 r161192 69 69 70 70 for (auto changedLayer : transaction.changedLayers()) { 71 RemoteLayerTreeTransaction::LayerIDlayerID = changedLayer.key;71 auto layerID = changedLayer.key; 72 72 const auto& properties = changedLayer.value; 73 73 … … 91 91 } 92 92 93 CALayer *RemoteLayerTreeHost::getLayer( RemoteLayerTreeTransaction::LayerID layerID)93 CALayer *RemoteLayerTreeHost::getLayer(GraphicsLayer::PlatformLayerID layerID) const 94 94 { 95 95 return m_layers.get(layerID).get(); -
trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp
r158647 r161192 39 39 } 40 40 41 GraphicsLayer::PlatformLayerID GraphicsLayerCARemote::primaryLayerID() const 42 { 43 return toPlatformCALayerRemote(platformCALayer())->layerID(); 44 } 45 41 46 #if ENABLE(CSS_FILTERS) 42 47 bool GraphicsLayerCARemote::filtersCanBeComposited(const FilterOperations& filters) -
trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h
r159948 r161192 45 45 46 46 virtual ~GraphicsLayerCARemote(); 47 48 PlatformLayerID primaryLayerID() const; 47 49 48 50 #if ENABLE(CSS_FILTERS) -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
r161013 r161192 48 48 using namespace WebKit; 49 49 50 static RemoteLayerTreeTransaction::LayerID generateLayerID()51 { 52 static RemoteLayerTreeTransaction::LayerID layerID;50 static WebCore::GraphicsLayer::PlatformLayerID generateLayerID() 51 { 52 static WebCore::GraphicsLayer::PlatformLayerID layerID; 53 53 return ++layerID; 54 }55 56 static PlatformCALayerRemote* toPlatformCALayerRemote(PlatformCALayer* layer)57 {58 ASSERT_WITH_SECURITY_IMPLICATION(!layer || layer->isRemote());59 return static_cast<PlatformCALayerRemote*>(layer);60 54 } 61 55 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h
r160672 r161192 45 45 virtual ~PlatformCALayerRemote(); 46 46 47 RemoteLayerTreeTransaction::LayerID layerID() { return m_layerID; } 48 49 virtual bool isRemote() const OVERRIDE { return true; } 47 WebCore::GraphicsLayer::PlatformLayerID layerID() { return m_layerID; } 50 48 51 49 virtual bool usesTiledBackingLayer() const OVERRIDE { return layerType() == LayerTypePageTiledBackingLayer || layerType() == LayerTypeTiledBackingLayer; } … … 158 156 159 157 private: 158 virtual bool isPlatformCALayerRemote() const OVERRIDE { return false; } 160 159 void ensureBackingStore(); 161 160 void removeSublayer(PlatformCALayerRemote*); … … 163 162 bool requiresCustomAppearanceUpdateOnBoundsChange() const; 164 163 165 RemoteLayerTreeTransaction::LayerID m_layerID;164 const WebCore::GraphicsLayer::PlatformLayerID m_layerID; 166 165 RemoteLayerTreeTransaction::LayerProperties m_properties; 167 166 WebCore::PlatformCALayerList m_children; … … 173 172 }; 174 173 174 PLATFORM_CALAYER_TYPE_CASTS(PlatformCALayerRemote, isPlatformCALayerRemote()) 175 175 176 } // namespace WebKit 176 177 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h
r160052 r161192 75 75 76 76 Vector<RemoteLayerTreeTransaction::LayerCreationProperties> m_createdLayers; 77 Vector< RemoteLayerTreeTransaction::LayerID> m_destroyedLayers;77 Vector<WebCore::GraphicsLayer::PlatformLayerID> m_destroyedLayers; 78 78 79 79 bool m_isFlushingSuspended;
Note:
See TracChangeset
for help on using the changeset viewer.