Diff
Modified: trunk/Source/WebCore/ChangeLog (161292 => 161293)
--- trunk/Source/WebCore/ChangeLog 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebCore/ChangeLog 2014-01-04 00:15:12 UTC (rev 161293)
@@ -1,3 +1,37 @@
+2014-01-03 Simon Fraser <[email protected]>
+
+ Give all PlatformCALayers a PlatformLayerID, not just remote ones
+ https://bugs.webkit.org/show_bug.cgi?id=126466
+
+ Reviewed by Tim Horton.
+
+ The ScrollingStateTree has references to both GraphicsLayers and PlatformLayers
+ which is confusing, and is necessary because the underlying PlatformLayer
+ inside a GraphicsLayer can change. In order to hide some of this complexity,
+ expose GraphicsLayer::primaryLayerID() which is a PlatformLayerID that clients
+ can hold onto to test for underlying layer swapping.
+
+ Also constify LayerType m_layerType on PlatformCALayer, which required
+ cleaning up the construction of PlatformCALayerMac in the case where a
+ PlatformCALayerMac is wrapping an existing CALayer (which happens for video).
+
+ * WebCore.exp.in:
+ * platform/graphics/GraphicsLayer.h:
+ (WebCore::GraphicsLayer::primaryLayerID):
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::primaryLayerID):
+ * platform/graphics/ca/GraphicsLayerCA.h:
+ * platform/graphics/ca/PlatformCALayer.cpp:
+ (WebCore::generateLayerID):
+ (WebCore::PlatformCALayer::PlatformCALayer):
+ * platform/graphics/ca/PlatformCALayer.h:
+ (WebCore::PlatformCALayer::layerID):
+ * platform/graphics/ca/mac/PlatformCALayerMac.h:
+ * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+ (PlatformCALayerMac::create):
+ (PlatformCALayerMac::PlatformCALayerMac):
+ (PlatformCALayerMac::commonInit):
+
2014-01-03 Andreas Kling <[email protected]>
Add lineageOfType renderer iterator and start using it.
Modified: trunk/Source/WebCore/WebCore.exp.in (161292 => 161293)
--- trunk/Source/WebCore/WebCore.exp.in 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebCore/WebCore.exp.in 2014-01-04 00:15:12 UTC (rev 161293)
@@ -575,12 +575,14 @@
__ZN7WebCore15GraphicsLayerCAC2EPNS_19GraphicsLayerClientE
__ZN7WebCore15GraphicsLayerCAD2Ev
__ZN7WebCore15GraphicsLayerCA19setCustomAppearanceENS_13GraphicsLayer16CustomAppearanceE
+__ZNK7WebCore15GraphicsLayerCA14primaryLayerIDEv
__ZN7WebCore15HitTestLocation12rectForPointERKNS_11LayoutPointEjjjj
__ZN7WebCore15HitTestLocationC1ERKNS_10FloatPointE
__ZN7WebCore15HitTestLocationD1Ev
__ZN7WebCore15JSDOMWindowBase8commonVMEv
__ZN7WebCore15PasteboardImageC1Ev
__ZN7WebCore15PasteboardImageD1Ev
+__ZN7WebCore15PlatformCALayerC2ENS0_9LayerTypeEPNS_21PlatformCALayerClientE
__ZN7WebCore15PlatformCALayerD2Ev
__ZN7WebCore15ProtectionSpaceC1ERKN3WTF6StringEiNS_25ProtectionSpaceServerTypeES4_NS_35ProtectionSpaceAuthenticationSchemeE
__ZN7WebCore15ProtectionSpaceC1Ev
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (161292 => 161293)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2014-01-04 00:15:12 UTC (rev 161293)
@@ -226,12 +226,13 @@
public:
static std::unique_ptr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient*);
- typedef uint64_t PlatformLayerID;
-
virtual ~GraphicsLayer();
virtual void initialize() { }
+ typedef uint64_t PlatformLayerID;
+ virtual PlatformLayerID primaryLayerID() const { return 0; }
+
GraphicsLayerClient* client() const { return m_client; }
// Layer name. Only used to identify layers in debug output
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (161292 => 161293)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2014-01-04 00:15:12 UTC (rev 161293)
@@ -397,6 +397,11 @@
noteLayerPropertyChanged(NameChanged);
}
+GraphicsLayer::PlatformLayerID GraphicsLayerCA::primaryLayerID() const
+{
+ return primaryLayer()->layerID();
+}
+
PlatformLayer* GraphicsLayerCA::platformLayer() const
{
return primaryLayer()->platformLayer();
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (161292 => 161293)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2014-01-04 00:15:12 UTC (rev 161293)
@@ -60,6 +60,8 @@
virtual void setName(const String&);
+ virtual PlatformLayerID primaryLayerID() const OVERRIDE;
+
virtual PlatformLayer* platformLayer() const;
virtual PlatformCALayer* platformCALayer() const { return primaryLayer(); }
Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp (161292 => 161293)
--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp 2014-01-04 00:15:12 UTC (rev 161293)
@@ -30,6 +30,19 @@
namespace WebCore {
+static GraphicsLayer::PlatformLayerID generateLayerID()
+{
+ static GraphicsLayer::PlatformLayerID layerID;
+ return ++layerID;
+}
+
+PlatformCALayer::PlatformCALayer(LayerType layerType, PlatformCALayerClient* owner)
+ : m_layerType(layerType)
+ , m_layerID(generateLayerID())
+ , m_owner(owner)
+{
+}
+
PlatformCALayer::~PlatformCALayer()
{
// Clear the owner, which also clears it in the delegate to prevent attempts
Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (161292 => 161293)
--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h 2014-01-04 00:15:12 UTC (rev 161293)
@@ -29,6 +29,7 @@
#if USE(ACCELERATED_COMPOSITING)
#include "GraphicsContext.h"
+#include "GraphicsLayer.h"
#include "PlatformCAAnimation.h"
#include "PlatformCALayerClient.h"
#include <QuartzCore/CABase.h>
@@ -80,6 +81,8 @@
virtual ~PlatformCALayer();
+ GraphicsLayer::PlatformLayerID layerID() const { return m_layerID; }
+
virtual bool isPlatformCALayerMac() const { return false; }
virtual bool isPlatformCALayerRemote() const { return false; }
@@ -210,12 +213,10 @@
#endif
protected:
- PlatformCALayer(LayerType layerType, PlatformCALayerClient* owner)
- : m_layerType(layerType)
- , m_owner(owner)
- { }
+ PlatformCALayer(LayerType, PlatformCALayerClient* owner);
- LayerType m_layerType;
+ const LayerType m_layerType;
+ const GraphicsLayer::PlatformLayerID m_layerID;
RetainPtr<PlatformLayer> m_layer;
PlatformCALayerClient* m_owner;
};
Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h (161292 => 161293)
--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h 2014-01-04 00:15:12 UTC (rev 161293)
@@ -147,7 +147,11 @@
virtual void enumerateRectsBeingDrawn(CGContextRef, void (^block)(CGRect)) OVERRIDE;
private:
- PlatformCALayerMac(LayerType, PlatformLayer*, PlatformCALayerClient* owner);
+ PlatformCALayerMac(LayerType, PlatformCALayerClient* owner);
+ PlatformCALayerMac(PlatformLayer*, PlatformCALayerClient* owner);
+
+ void commonInit();
+
virtual bool isPlatformCALayerMac() const OVERRIDE { return true; }
bool requiresCustomAppearanceUpdateOnBoundsChange() const;
Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (161292 => 161293)
--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm 2014-01-04 00:15:12 UTC (rev 161293)
@@ -55,12 +55,12 @@
PassRefPtr<PlatformCALayer> PlatformCALayerMac::create(LayerType layerType, PlatformCALayerClient* owner)
{
- return adoptRef(new PlatformCALayerMac(layerType, 0, owner));
+ return adoptRef(new PlatformCALayerMac(layerType, owner));
}
PassRefPtr<PlatformCALayer> PlatformCALayerMac::create(void* platformLayer, PlatformCALayerClient* owner)
{
- return adoptRef(new PlatformCALayerMac(LayerTypeCustom, static_cast<PlatformLayer*>(platformLayer), owner));
+ return adoptRef(new PlatformCALayerMac(static_cast<PlatformLayer*>(platformLayer), owner));
}
static NSString * const platformCALayerPointer = @"WKPlatformCALayer";
@@ -177,50 +177,57 @@
}
}
-PlatformCALayerMac::PlatformCALayerMac(LayerType layerType, PlatformLayer* layer, PlatformCALayerClient* owner)
- : PlatformCALayer(layer ? LayerTypeCustom : layerType, owner)
+PlatformCALayerMac::PlatformCALayerMac(LayerType layerType, PlatformCALayerClient* owner)
+ : PlatformCALayer(layerType, owner)
, m_customAppearance(GraphicsLayer::NoCustomAppearance)
{
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- if (layer) {
- if ([layer isKindOfClass:getAVPlayerLayerClass()])
- m_layerType = LayerTypeAVPlayerLayer;
- m_layer = layer;
- } else {
- Class layerClass = Nil;
- switch (layerType) {
- case LayerTypeLayer:
- case LayerTypeRootLayer:
- layerClass = [CALayer class];
- break;
- case LayerTypeWebLayer:
- layerClass = [WebLayer class];
- break;
- case LayerTypeSimpleLayer:
- case LayerTypeTiledBackingTileLayer:
- layerClass = [WebSimpleLayer class];
- break;
- case LayerTypeTransformLayer:
- layerClass = [CATransformLayer class];
- break;
- case LayerTypeWebTiledLayer:
- ASSERT_NOT_REACHED();
- break;
- case LayerTypeTiledBackingLayer:
- case LayerTypePageTiledBackingLayer:
- layerClass = [WebTiledBackingLayer class];
- break;
- case LayerTypeAVPlayerLayer:
- layerClass = getAVPlayerLayerClass();
- break;
- case LayerTypeCustom:
- break;
- }
+ Class layerClass = Nil;
+ switch (layerType) {
+ case LayerTypeLayer:
+ case LayerTypeRootLayer:
+ layerClass = [CALayer class];
+ break;
+ case LayerTypeWebLayer:
+ layerClass = [WebLayer class];
+ break;
+ case LayerTypeSimpleLayer:
+ case LayerTypeTiledBackingTileLayer:
+ layerClass = [WebSimpleLayer class];
+ break;
+ case LayerTypeTransformLayer:
+ layerClass = [CATransformLayer class];
+ break;
+ case LayerTypeWebTiledLayer:
+ ASSERT_NOT_REACHED();
+ break;
+ case LayerTypeTiledBackingLayer:
+ case LayerTypePageTiledBackingLayer:
+ layerClass = [WebTiledBackingLayer class];
+ break;
+ case LayerTypeAVPlayerLayer:
+ layerClass = getAVPlayerLayerClass();
+ break;
+ case LayerTypeCustom:
+ break;
+ }
- if (layerClass)
- m_layer = adoptNS([[layerClass alloc] init]);
- }
+ if (layerClass)
+ m_layer = adoptNS([[layerClass alloc] init]);
+ commonInit();
+}
+
+PlatformCALayerMac::PlatformCALayerMac(PlatformLayer* layer, PlatformCALayerClient* owner)
+ : PlatformCALayer([layer isKindOfClass:getAVPlayerLayerClass()] ? LayerTypeAVPlayerLayer : LayerTypeCustom, owner)
+ , m_customAppearance(GraphicsLayer::NoCustomAppearance)
+{
+ m_layer = layer;
+ commonInit();
+}
+
+void PlatformCALayerMac::commonInit()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
// Save a pointer to 'this' in the CALayer
[m_layer.get() setValue:[NSValue valueWithPointer:this] forKey:platformCALayerPointer];
Modified: trunk/Source/WebKit2/ChangeLog (161292 => 161293)
--- trunk/Source/WebKit2/ChangeLog 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebKit2/ChangeLog 2014-01-04 00:15:12 UTC (rev 161293)
@@ -1,3 +1,26 @@
+2014-01-03 Simon Fraser <[email protected]>
+
+ Give all PlatformCALayers a PlatformLayerID, not just remote ones
+ https://bugs.webkit.org/show_bug.cgi?id=126466
+
+ Reviewed by Tim Horton.
+
+ The ScrollingStateTree has references to both GraphicsLayers and PlatformLayers
+ which is confusing, and is necessary because the underlying PlatformLayer
+ inside a GraphicsLayer can change. In order to hide some of this complexity,
+ expose GraphicsLayer::primaryLayerID() which is a PlatformLayerID that clients
+ can hold onto to test for underlying layer swapping.
+
+ GraphicsLayerCARemote and PlatformCALayerRemote can now just use the
+ primaryLayerID() function exposed via the base class.
+
+ * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
+ * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
+ * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+ (PlatformCALayerRemote::PlatformCALayerRemote):
+ (PlatformCALayerRemote::recursiveBuildTransaction):
+ * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
+
2014-01-03 Dan Bernstein <[email protected]>
[Cocoa] Expose session state API
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp (161292 => 161293)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp 2014-01-04 00:15:12 UTC (rev 161293)
@@ -38,11 +38,6 @@
{
}
-GraphicsLayer::PlatformLayerID GraphicsLayerCARemote::primaryLayerID() const
-{
- return toPlatformCALayerRemote(platformCALayer())->layerID();
-}
-
#if ENABLE(CSS_FILTERS)
bool GraphicsLayerCARemote::filtersCanBeComposited(const FilterOperations& filters)
{
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h (161292 => 161293)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h 2014-01-04 00:15:12 UTC (rev 161293)
@@ -45,8 +45,6 @@
virtual ~GraphicsLayerCARemote();
- PlatformLayerID primaryLayerID() const;
-
#if ENABLE(CSS_FILTERS)
virtual bool filtersCanBeComposited(const WebCore::FilterOperations& filters) OVERRIDE;
#endif
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (161292 => 161293)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp 2014-01-04 00:15:12 UTC (rev 161293)
@@ -47,12 +47,6 @@
using namespace WebCore;
using namespace WebKit;
-static WebCore::GraphicsLayer::PlatformLayerID generateLayerID()
-{
- static WebCore::GraphicsLayer::PlatformLayerID layerID;
- return ++layerID;
-}
-
PassRefPtr<PlatformCALayerRemote> PlatformCALayerRemote::create(LayerType layerType, PlatformCALayerClient* owner, RemoteLayerTreeContext* context)
{
RefPtr<PlatformCALayerRemote> layer;
@@ -78,7 +72,6 @@
PlatformCALayerRemote::PlatformCALayerRemote(LayerType layerType, PlatformCALayerClient* owner, RemoteLayerTreeContext* context)
: PlatformCALayer(layerType, owner)
- , m_layerID(generateLayerID())
, m_superlayer(nullptr)
, m_maskLayer(nullptr)
, m_acceleratesDrawing(false)
@@ -112,7 +105,7 @@
if (m_properties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) {
m_properties.children.clear();
for (auto layer : m_children)
- m_properties.children.append(toPlatformCALayerRemote(layer.get())->layerID());
+ m_properties.children.append(layer->layerID());
}
if (m_layerType == LayerTypeCustom) {
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (161292 => 161293)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h 2014-01-04 00:04:36 UTC (rev 161292)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h 2014-01-04 00:15:12 UTC (rev 161293)
@@ -44,8 +44,6 @@
virtual ~PlatformCALayerRemote();
- WebCore::GraphicsLayer::PlatformLayerID layerID() { return m_layerID; }
-
virtual bool usesTiledBackingLayer() const OVERRIDE { return layerType() == LayerTypePageTiledBackingLayer || layerType() == LayerTypeTiledBackingLayer; }
virtual PlatformLayer* platformLayer() const OVERRIDE { return nullptr; }
@@ -161,7 +159,6 @@
bool requiresCustomAppearanceUpdateOnBoundsChange() const;
- const WebCore::GraphicsLayer::PlatformLayerID m_layerID;
RemoteLayerTreeTransaction::LayerProperties m_properties;
WebCore::PlatformCALayerList m_children;
PlatformCALayerRemote* m_superlayer;