Use 'override' in GraphicsLayerCA
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Apr 2014 17:36:16 +0000 (17:36 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Apr 2014 17:36:16 +0000 (17:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=131882

Reviewed by Tim Horton.

Source/WebCore:

Add 'override' to all overridden functions. Found a few that need
not have been virtual. Removed "allowTiledLayer" stuff that was
never called.

* WebCore.exp.in:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::requiresTiledLayer):
(WebCore::GraphicsLayerCA::setAllowTiledLayer): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::platformCALayer):
(WebCore::GraphicsLayerCA::hasContentsLayer): Deleted.
(WebCore::GraphicsLayerCA::allowTiledLayer): Deleted.
(WebCore::GraphicsLayerCA::isGraphicsLayerCA): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerLayoutSublayersOfLayer): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerRespondsToLayoutChanges): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerContentsOrientation): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerShowDebugBorders): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerIncrementRepaintCount): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerContentsOpaque): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerDrawsContent): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerLayerDidDisplay): Deleted.

Source/WebKit2:

Add an 'override'.

* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167535 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h

index 51f0934..a50e753 100644 (file)
@@ -1,3 +1,33 @@
+2014-04-18  Simon Fraser  <simon.fraser@apple.com>
+
+        Use 'override' in GraphicsLayerCA
+        https://bugs.webkit.org/show_bug.cgi?id=131882
+
+        Reviewed by Tim Horton.
+
+        Add 'override' to all overridden functions. Found a few that need
+        not have been virtual. Removed "allowTiledLayer" stuff that was
+        never called.
+
+        * WebCore.exp.in:
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::GraphicsLayerCA):
+        (WebCore::GraphicsLayerCA::requiresTiledLayer):
+        (WebCore::GraphicsLayerCA::setAllowTiledLayer): Deleted.
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        (WebCore::GraphicsLayerCA::platformCALayer):
+        (WebCore::GraphicsLayerCA::hasContentsLayer): Deleted.
+        (WebCore::GraphicsLayerCA::allowTiledLayer): Deleted.
+        (WebCore::GraphicsLayerCA::isGraphicsLayerCA): Deleted.
+        (WebCore::GraphicsLayerCA::platformCALayerLayoutSublayersOfLayer): Deleted.
+        (WebCore::GraphicsLayerCA::platformCALayerRespondsToLayoutChanges): Deleted.
+        (WebCore::GraphicsLayerCA::platformCALayerContentsOrientation): Deleted.
+        (WebCore::GraphicsLayerCA::platformCALayerShowDebugBorders): Deleted.
+        (WebCore::GraphicsLayerCA::platformCALayerIncrementRepaintCount): Deleted.
+        (WebCore::GraphicsLayerCA::platformCALayerContentsOpaque): Deleted.
+        (WebCore::GraphicsLayerCA::platformCALayerDrawsContent): Deleted.
+        (WebCore::GraphicsLayerCA::platformCALayerLayerDidDisplay): Deleted.
+
 2014-04-18  Timothy Hatcher  <timothy@apple.com>
 
         Web Inspector: Move InspectorProfilerAgent to JavaScriptCore
index 5a82a35..f800254 100644 (file)
@@ -553,7 +553,6 @@ __ZN7WebCore15GraphicsLayerCA16setMasksToBoundsEb
 __ZN7WebCore15GraphicsLayerCA17setContentsOpaqueEb
 __ZN7WebCore15GraphicsLayerCA17setCustomBehaviorENS_13GraphicsLayer14CustomBehaviorE
 __ZN7WebCore15GraphicsLayerCA17suspendAnimationsEd
-__ZN7WebCore15GraphicsLayerCA18setAllowTiledLayerEb
 __ZN7WebCore15GraphicsLayerCA18setBackgroundColorERKNS_5ColorE
 __ZN7WebCore15GraphicsLayerCA18setContentsToImageEPNS_5ImageE
 __ZN7WebCore15GraphicsLayerCA18setContentsToMediaEP7CALayer
index 4e5db8c..2f06d4b 100644 (file)
@@ -363,7 +363,6 @@ PassRefPtr<PlatformCAAnimation> GraphicsLayerCA::createPlatformCAAnimation(Platf
 GraphicsLayerCA::GraphicsLayerCA(GraphicsLayerClient* client)
     : GraphicsLayer(client)
     , m_contentsLayerPurpose(NoContentsLayer)
-    , m_allowTiledLayer(true)
     , m_isPageTiledBackingLayer(false)
     , m_rootRelativeScaleFactor(1)
     , m_uncommittedChanges(0)
@@ -658,17 +657,6 @@ void GraphicsLayerCA::setAcceleratesDrawing(bool acceleratesDrawing)
     noteLayerPropertyChanged(AcceleratesDrawingChanged);
 }
 
-void GraphicsLayerCA::setAllowTiledLayer(bool allowTiledLayer)
-{
-    if (allowTiledLayer == m_allowTiledLayer)
-        return;
-
-    m_allowTiledLayer = allowTiledLayer;
-    
-    // Handling this as a BoundsChanged will cause use to switch in or out of tiled layer as needed
-    noteLayerPropertyChanged(GeometryChanged);
-}
-
 void GraphicsLayerCA::setBackgroundColor(const Color& color)
 {
     if (m_backgroundColor == color)
@@ -3133,7 +3121,7 @@ void GraphicsLayerCA::setCustomBehavior(CustomBehavior customBehavior)
 
 bool GraphicsLayerCA::requiresTiledLayer(float pageScaleFactor) const
 {
-    if (!m_drawsContent || !m_allowTiledLayer || m_isPageTiledBackingLayer)
+    if (!m_drawsContent || m_isPageTiledBackingLayer)
         return false;
 
     // FIXME: catch zero-size height or width here (or earlier)?
index 3e3fe40..ef27d65 100644 (file)
@@ -60,50 +60,50 @@ public:
 
     virtual void initialize() override;
 
-    virtual void setName(const String&);
+    virtual void setName(const String&) override;
 
     virtual PlatformLayerID primaryLayerID() const override;
 
-    virtual PlatformLayer* platformLayer() const;
-    virtual PlatformCALayer* platformCALayer() const { return primaryLayer(); }
+    virtual PlatformLayer* platformLayer() const override;
+    PlatformCALayer* platformCALayer() const { return primaryLayer(); }
 
-    virtual bool setChildren(const Vector<GraphicsLayer*>&);
-    virtual void addChild(GraphicsLayer*);
-    virtual void addChildAtIndex(GraphicsLayer*, int index);
-    virtual void addChildAbove(GraphicsLayer* layer, GraphicsLayer* sibling);
-    virtual void addChildBelow(GraphicsLayer* layer, GraphicsLayer* sibling);
-    virtual bool replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild);
+    virtual bool setChildren(const Vector<GraphicsLayer*>&) override;
+    virtual void addChild(GraphicsLayer*) override;
+    virtual void addChildAtIndex(GraphicsLayer*, int index) override;
+    virtual void addChildAbove(GraphicsLayer*, GraphicsLayer* sibling) override;
+    virtual void addChildBelow(GraphicsLayer*, GraphicsLayer* sibling) override;
+    virtual bool replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild) override;
 
-    virtual void removeFromParent();
+    virtual void removeFromParent() override;
 
-    virtual void setMaskLayer(GraphicsLayer*);
-    virtual void setReplicatedLayer(GraphicsLayer*);
+    virtual void setMaskLayer(GraphicsLayer*) override;
+    virtual void setReplicatedLayer(GraphicsLayer*) override;
 
-    virtual void setPosition(const FloatPoint&);
-    virtual void setAnchorPoint(const FloatPoint3D&);
-    virtual void setSize(const FloatSize&);
-    virtual void setBoundsOrigin(const FloatPoint&);
+    virtual void setPosition(const FloatPoint&) override;
+    virtual void setAnchorPoint(const FloatPoint3D&) override;
+    virtual void setSize(const FloatSize&) override;
+    virtual void setBoundsOrigin(const FloatPoint&) override;
 
-    virtual void setTransform(const TransformationMatrix&);
+    virtual void setTransform(const TransformationMatrix&) override;
 
-    virtual void setChildrenTransform(const TransformationMatrix&);
+    virtual void setChildrenTransform(const TransformationMatrix&) override;
 
-    virtual void setPreserves3D(bool);
-    virtual void setMasksToBounds(bool);
-    virtual void setDrawsContent(bool);
-    virtual void setContentsVisible(bool);
-    virtual void setAcceleratesDrawing(bool);
+    virtual void setPreserves3D(bool) override;
+    virtual void setMasksToBounds(bool) override;
+    virtual void setDrawsContent(bool) override;
+    virtual void setContentsVisible(bool) override;
+    virtual void setAcceleratesDrawing(bool) override;
 
-    virtual void setBackgroundColor(const Color&);
+    virtual void setBackgroundColor(const Color&) override;
 
-    virtual void setContentsOpaque(bool);
-    virtual void setBackfaceVisibility(bool);
+    virtual void setContentsOpaque(bool) override;
+    virtual void setBackfaceVisibility(bool) override;
 
     // return true if we started an animation
-    virtual void setOpacity(float);
+    virtual void setOpacity(float) override;
 
 #if ENABLE(CSS_FILTERS)
-    virtual bool setFilters(const FilterOperations&);
+    virtual bool setFilters(const FilterOperations&) override;
     virtual bool filtersCanBeComposited(const FilterOperations&);
 #endif
 
@@ -111,46 +111,46 @@ public:
     virtual void setBlendMode(BlendMode) override;
 #endif
 
-    virtual void setNeedsDisplay();
-    virtual void setNeedsDisplayInRect(const FloatRect&, ShouldClipToLayer = ClipToLayer);
-    virtual void setContentsNeedsDisplay();
+    virtual void setNeedsDisplay() override;
+    virtual void setNeedsDisplayInRect(const FloatRect&, ShouldClipToLayer = ClipToLayer) override;
+    virtual void setContentsNeedsDisplay() override;
     
     virtual void setContentsRect(const FloatRect&) override;
     virtual void setContentsClippingRect(const FloatRect&) override;
     
-    virtual void suspendAnimations(double time);
-    virtual void resumeAnimations();
+    virtual void suspendAnimations(double time) override;
+    virtual void resumeAnimations() override;
 
-    virtual bool addAnimation(const KeyframeValueList&, const FloatSize& boxSize, const Animation*, const String& animationName, double timeOffset);
-    virtual void pauseAnimation(const String& animationName, double timeOffset);
-    virtual void removeAnimation(const String& animationName);
+    virtual bool addAnimation(const KeyframeValueList&, const FloatSize& boxSize, const Animation*, const String& animationName, double timeOffset) override;
+    virtual void pauseAnimation(const String& animationName, double timeOffset) override;
+    virtual void removeAnimation(const String& animationName) override;
 
-    virtual void setContentsToImage(Image*);
-    virtual void setContentsToMedia(PlatformLayer*);
+    virtual void setContentsToImage(Image*) override;
+    virtual void setContentsToMedia(PlatformLayer*) override;
 #if PLATFORM(IOS)
     virtual PlatformLayer* contentsLayerForMedia() const override;
 #endif
-    virtual void setContentsToCanvas(PlatformLayer*);
-    virtual void setContentsToSolidColor(const Color&);
+    virtual void setContentsToCanvas(PlatformLayer*) override;
+    virtual void setContentsToSolidColor(const Color&) override;
 
     virtual bool usesContentsLayer() const override { return m_contentsLayerPurpose != NoContentsLayer; }
     
     virtual void setShowDebugBorder(bool) override;
     virtual void setShowRepaintCounter(bool) override;
 
-    virtual void setDebugBackgroundColor(const Color&);
-    virtual void setDebugBorder(const Color&, float borderWidth);
+    virtual void setDebugBackgroundColor(const Color&) override;
+    virtual void setDebugBorder(const Color&, float borderWidth) override;
 
-    virtual void setCustomAppearance(CustomAppearance);
-    virtual void setCustomBehavior(CustomBehavior);
+    virtual void setCustomAppearance(CustomAppearance) override;
+    virtual void setCustomBehavior(CustomBehavior) override;
 
-    virtual void layerDidDisplay(PlatformLayer*);
+    virtual void layerDidDisplay(PlatformLayer*) override;
 
-    virtual void setMaintainsPixelAlignment(bool);
+    virtual void setMaintainsPixelAlignment(bool) override;
 #if PLATFORM(IOS)
     virtual FloatSize pixelAlignmentOffset() const override { return m_pixelAlignmentOffset; }
 #endif
-    virtual void deviceOrPageScaleFactorChanged();
+    virtual void deviceOrPageScaleFactorChanged() override;
 
     struct CommitState {
         bool ancestorHasTransformAnimation;
@@ -162,40 +162,37 @@ public:
     };
     void recursiveCommitChanges(const CommitState&, const TransformState&, const TransformationMatrix& rootRelativeTransformForScaling, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false);
 
-    virtual void flushCompositingState(const FloatRect&);
-    virtual void flushCompositingStateForThisLayerOnly();
+    virtual void flushCompositingState(const FloatRect&) override;
+    virtual void flushCompositingStateForThisLayerOnly() override;
 
     virtual bool visibleRectChangeRequiresFlush(const FloatRect& visibleRect) const override;
 
     virtual TiledBacking* tiledBacking() const override;
 
-    bool allowTiledLayer() const { return m_allowTiledLayer; }
-    virtual void setAllowTiledLayer(bool b);
-
 protected:
-    virtual void setOpacityInternal(float);
+    virtual void setOpacityInternal(float) override;
     
     bool animationCanBeAccelerated(const KeyframeValueList&, const Animation*) const;
 
 private:
-    virtual bool isGraphicsLayerCA() const { return true; }
+    virtual bool isGraphicsLayerCA() const override { return true; }
 
-    virtual void willBeDestroyed();
+    virtual void willBeDestroyed() override;
 
     // PlatformCALayerClient overrides
-    virtual void platformCALayerLayoutSublayersOfLayer(PlatformCALayer*) { }
-    virtual bool platformCALayerRespondsToLayoutChanges() const { return false; }
-
-    virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime);
-    virtual CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return contentsOrientation(); }
-    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& clip);
-    virtual bool platformCALayerShowDebugBorders() const { return isShowingDebugBorder(); }
-    virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const;
-    virtual int platformCALayerIncrementRepaintCount(PlatformCALayer*) { return incrementRepaintCount(); }
-
-    virtual bool platformCALayerContentsOpaque() const { return contentsOpaque(); }
-    virtual bool platformCALayerDrawsContent() const { return drawsContent(); }
-    virtual void platformCALayerLayerDidDisplay(PlatformLayer* layer) { return layerDidDisplay(layer); }
+    virtual void platformCALayerLayoutSublayersOfLayer(PlatformCALayer*) override { }
+    virtual bool platformCALayerRespondsToLayoutChanges() const override { return false; }
+
+    virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) override;
+    virtual CompositingCoordinatesOrientation platformCALayerContentsOrientation() const override { return contentsOrientation(); }
+    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& clip) override;
+    virtual bool platformCALayerShowDebugBorders() const override { return isShowingDebugBorder(); }
+    virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const override;
+    virtual int platformCALayerIncrementRepaintCount(PlatformCALayer*) override { return incrementRepaintCount(); }
+
+    virtual bool platformCALayerContentsOpaque() const override { return contentsOpaque(); }
+    virtual bool platformCALayerDrawsContent() const override { return drawsContent(); }
+    virtual void platformCALayerLayerDidDisplay(PlatformLayer* layer) override { return layerDidDisplay(layer); }
     virtual void platformCALayerSetNeedsToRevalidateTiles() override;
     virtual float platformCALayerDeviceScaleFactor() const override;
     virtual float platformCALayerContentsScaleMultiplierForNewTiles(PlatformCALayer*) const override;
@@ -204,7 +201,7 @@ private:
 
     virtual bool isCommittingChanges() const override { return m_isCommittingChanges; }
 
-    virtual double backingStoreMemoryEstimate() const;
+    virtual double backingStoreMemoryEstimate() const override;
 
     virtual bool shouldRepaintOnSizeChange() const override;
 
@@ -282,10 +279,10 @@ private:
     bool mediaLayerMustBeUpdatedOnMainThread() const;
 #endif
 
-    virtual void setReplicatedByLayer(GraphicsLayer*);
+    virtual void setReplicatedByLayer(GraphicsLayer*) override;
 
-    virtual void getDebugBorderInfo(Color&, float& width) const;
-    virtual void dumpAdditionalProperties(TextStream&, int indent, LayerTreeAsTextBehavior) const;
+    virtual void getDebugBorderInfo(Color&, float& width) const override;
+    virtual void dumpAdditionalProperties(TextStream&, int indent, LayerTreeAsTextBehavior) const override;
 
     void computePixelAlignment(float pixelAlignmentScale, const FloatPoint& positionRelativeToBase,
         FloatPoint& position, FloatSize&, FloatPoint3D& anchorPoint, FloatSize& alignmentOffset) const;
@@ -302,7 +299,7 @@ private:
 
     bool recursiveVisibleRectChangeRequiresFlush(const TransformState&) const;
 
-    virtual bool canThrottleLayerFlush() const;
+    virtual bool canThrottleLayerFlush() const override;
 
     // Used to track the path down the tree for replica layers.
     struct ReplicaState {
@@ -495,7 +492,6 @@ private:
     };
     
     ContentsLayerPurpose m_contentsLayerPurpose;
-    bool m_allowTiledLayer : 1;
     bool m_isPageTiledBackingLayer : 1;
     
     float m_rootRelativeScaleFactor;
index afa5f9c..b1d6d0d 100644 (file)
@@ -1,3 +1,14 @@
+2014-04-18  Simon Fraser  <simon.fraser@apple.com>
+
+        Use 'override' in GraphicsLayerCA
+        https://bugs.webkit.org/show_bug.cgi?id=131882
+
+        Reviewed by Tim Horton.
+        
+        Add an 'override'.
+
+        * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
+
 2014-04-19  Darin Adler  <darin@apple.com>
 
         Assertion in WebPage::runModal accesses object after it may have been destroyed
index b351b2e..79fe03f 100644 (file)
@@ -48,7 +48,7 @@ public:
 #endif
 
 private:
-    virtual bool isGraphicsLayerCARemote() const { return true; }
+    virtual bool isGraphicsLayerCARemote() const override { return true; }
 
     virtual PassRefPtr<WebCore::PlatformCALayer> createPlatformCALayer(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient* owner) override;
     virtual PassRefPtr<WebCore::PlatformCALayer> createPlatformCALayer(PlatformLayer*, WebCore::PlatformCALayerClient* owner) override;