Changeset 133182 in webkit


Ignore:
Timestamp:
Nov 1, 2012 8:55:53 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Coordinated Graphics: Clean up headers of Coordinated Graphics.
https://bugs.webkit.org/show_bug.cgi?id=100907

Patch by Huang Dongsung <luxtella@company100.net> on 2012-11-01
Reviewed by Noam Rosenthal.

This patch performs:

  1. Remove unused methods.
  2. Change public methods to private if needed.
  3. Put virtual, OVERRIDE and explicit keywords if needed.
  • UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h:

(LayerTreeCoordinatorProxy):

  • UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:

(LayerTreeRenderer):

  • WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
  • WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:

(CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::fixedToViewport):
(WebCore::CoordinatedGraphicsLayer::setMaskTarget):

  • WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:

(LayerTreeCoordinator):

Location:
trunk/Source/WebKit2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r133177 r133182  
     12012-11-01  Huang Dongsung  <luxtella@company100.net>
     2
     3        Coordinated Graphics: Clean up headers of Coordinated Graphics.
     4        https://bugs.webkit.org/show_bug.cgi?id=100907
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        This patch performs:
     9        1. Remove unused methods.
     10        2. Change public methods to private if needed.
     11        3. Put virtual, OVERRIDE and explicit keywords if needed.
     12
     13        * UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h:
     14        (LayerTreeCoordinatorProxy):
     15        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
     16        (LayerTreeRenderer):
     17        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
     18        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
     19        (CoordinatedGraphicsLayer):
     20        (WebCore::CoordinatedGraphicsLayer::fixedToViewport):
     21        (WebCore::CoordinatedGraphicsLayer::setMaskTarget):
     22        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
     23        (LayerTreeCoordinator):
     24
    1252012-11-01  Christophe Dumez  <christophe.dumez@intel.com>
    226
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h

    r132972 r133182  
    4747
    4848class LayerTreeCoordinatorProxy {
     49    WTF_MAKE_NONCOPYABLE(LayerTreeCoordinatorProxy);
     50    WTF_MAKE_FAST_ALLOCATED;
    4951public:
    50     LayerTreeCoordinatorProxy(DrawingAreaProxy*);
    51     virtual ~LayerTreeCoordinatorProxy();
     52    explicit LayerTreeCoordinatorProxy(DrawingAreaProxy*);
     53    ~LayerTreeCoordinatorProxy();
    5254    void setCompositingLayerState(WebLayerID, const WebLayerInfo&);
    5355    void setCompositingLayerChildren(WebLayerID, const Vector<WebLayerID>&);
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h

    r132742 r133182  
    6161        }
    6262    };
    63     LayerTreeRenderer(LayerTreeCoordinatorProxy*);
     63    explicit LayerTreeRenderer(LayerTreeCoordinatorProxy*);
    6464    virtual ~LayerTreeRenderer();
    6565    void purgeGLResources();
     
    7676    void detach();
    7777    void appendUpdate(const Function<void()>&);
    78     void updateViewport();
    7978    void setActive(bool);
    8079
     
    9695    void setAnimationsLocked(bool);
    9796
    98 
    9997#if ENABLE(REQUEST_ANIMATION_FRAME)
    10098    void requestAnimationFrame();
     
    114112    virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const { return false; }
    115113    void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect&) { }
     114    void updateViewport();
    116115    void dispatchOnMainThread(const Function<void()>&);
    117116    void adjustPositionForFixedLayers();
     117
     118    void assignImageToLayer(WebCore::GraphicsLayer*, int64_t imageID);
     119    void ensureRootLayer();
     120    void ensureLayer(WebLayerID);
     121    void commitTileOperations();
     122    void renderNextFrame();
     123    void purgeBackingStores();
    118124
    119125    typedef HashMap<WebLayerID, WebCore::GraphicsLayer*> LayerMap;
     
    134140    SurfaceBackingStoreMap m_surfaceBackingStores;
    135141#endif
    136 
    137     void scheduleWebViewUpdate();
    138     void synchronizeViewport();
    139     void assignImageToLayer(WebCore::GraphicsLayer*, int64_t imageID);
    140     void ensureRootLayer();
    141     void ensureLayer(WebLayerID);
    142     void commitTileOperations();
    143     void syncAnimations();
    144     void renderNextFrame();
    145     void purgeBackingStores();
    146142
    147143    LayerTreeCoordinatorProxy* m_layerTreeCoordinatorProxy;
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp

    r132907 r133182  
    4646    static HashMap<WebLayerID, CoordinatedGraphicsLayer*> globalMap;
    4747    return globalMap;
    48 }
    49 
    50 CoordinatedGraphicsLayer* CoordinatedGraphicsLayer::layerByID(WebKit::WebLayerID id)
    51 {
    52     HashMap<WebLayerID, CoordinatedGraphicsLayer*>& table = layerByIDMap();
    53     HashMap<WebLayerID, CoordinatedGraphicsLayer*>::iterator it = table.find(id);
    54     if (it == table.end())
    55         return 0;
    56     return it->value;
    5748}
    5849
     
    137128    }
    138129    willBeDestroyed();
    139 }
    140 
    141 void CoordinatedGraphicsLayer::willBeDestroyed()
    142 {
    143     GraphicsLayer::willBeDestroyed();
    144130}
    145131
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h

    r132907 r133182  
    7979namespace WebCore {
    8080
    81 class CoordinatedGraphicsLayer : public WebCore::GraphicsLayer
     81class CoordinatedGraphicsLayer : public GraphicsLayer
    8282    , public TiledBackingStoreClient
    8383    , public WebKit::CoordinatedTileClient {
     
    8787
    8888    // Reimplementations from GraphicsLayer.h.
    89     bool setChildren(const Vector<GraphicsLayer*>&);
    90     void addChild(GraphicsLayer*);
    91     void addChildAtIndex(GraphicsLayer*, int);
    92     void addChildAbove(GraphicsLayer*, GraphicsLayer*);
    93     void addChildBelow(GraphicsLayer*, GraphicsLayer*);
    94     bool replaceChild(GraphicsLayer*, GraphicsLayer*);
    95     void removeFromParent();
    96     void setPosition(const FloatPoint&);
    97     void setAnchorPoint(const FloatPoint3D&);
    98     void setSize(const FloatSize&);
    99     void setTransform(const TransformationMatrix&);
    100     void setChildrenTransform(const TransformationMatrix&);
    101     void setPreserves3D(bool);
    102     void setMasksToBounds(bool);
    103     void setDrawsContent(bool);
    104     void setContentsVisible(bool);
    105     void setContentsOpaque(bool);
    106     void setBackfaceVisibility(bool);
    107     void setOpacity(float);
    108     void setContentsRect(const IntRect&);
    109     void setContentsToImage(Image*);
    110     void setContentsToCanvas(PlatformLayer*);
    111     void setMaskLayer(GraphicsLayer*);
    112     void setReplicatedByLayer(GraphicsLayer*);
    113     void setNeedsDisplay();
    114     void setNeedsDisplayInRect(const FloatRect&);
    115     void setContentsNeedsDisplay();
    116     void setContentsScale(float);
    117     void setVisibleContentRectTrajectoryVector(const FloatPoint&);
    118     virtual void flushCompositingState(const FloatRect&);
    119     virtual void flushCompositingStateForThisLayerOnly();
    120 #if ENABLE(CSS_FILTERS)
    121     bool setFilters(const FilterOperations&);
    122 #endif
     89    virtual bool setChildren(const Vector<GraphicsLayer*>&) OVERRIDE;
     90    virtual void addChild(GraphicsLayer*) OVERRIDE;
     91    virtual void addChildAtIndex(GraphicsLayer*, int) OVERRIDE;
     92    virtual void addChildAbove(GraphicsLayer*, GraphicsLayer*) OVERRIDE;
     93    virtual void addChildBelow(GraphicsLayer*, GraphicsLayer*) OVERRIDE;
     94    virtual bool replaceChild(GraphicsLayer*, GraphicsLayer*) OVERRIDE;
     95    virtual void removeFromParent() OVERRIDE;
     96    virtual void setPosition(const FloatPoint&) OVERRIDE;
     97    virtual void setAnchorPoint(const FloatPoint3D&) OVERRIDE;
     98    virtual void setSize(const FloatSize&) OVERRIDE;
     99    virtual void setTransform(const TransformationMatrix&) OVERRIDE;
     100    virtual void setChildrenTransform(const TransformationMatrix&) OVERRIDE;
     101    virtual void setPreserves3D(bool) OVERRIDE;
     102    virtual void setMasksToBounds(bool) OVERRIDE;
     103    virtual void setDrawsContent(bool) OVERRIDE;
     104    virtual void setContentsVisible(bool) OVERRIDE;
     105    virtual void setContentsOpaque(bool) OVERRIDE;
     106    virtual void setBackfaceVisibility(bool) OVERRIDE;
     107    virtual void setOpacity(float) OVERRIDE;
     108    virtual void setContentsRect(const IntRect&) OVERRIDE;
     109    virtual void setContentsToImage(Image*) OVERRIDE;
     110    virtual void setContentsToCanvas(PlatformLayer*) OVERRIDE;
     111    virtual void setMaskLayer(GraphicsLayer*) OVERRIDE;
     112    virtual void setReplicatedByLayer(GraphicsLayer*) OVERRIDE;
     113    virtual void setNeedsDisplay() OVERRIDE;
     114    virtual void setNeedsDisplayInRect(const FloatRect&) OVERRIDE;
     115    virtual void setContentsNeedsDisplay() OVERRIDE;
     116    virtual void setContentsScale(float) OVERRIDE;
     117    virtual void setVisibleContentRectTrajectoryVector(const FloatPoint&) OVERRIDE;
     118    virtual void flushCompositingState(const FloatRect&) OVERRIDE;
     119    virtual void flushCompositingStateForThisLayerOnly() OVERRIDE;
     120#if ENABLE(CSS_FILTERS)
     121    virtual bool setFilters(const FilterOperations&) OVERRIDE;
     122#endif
     123    virtual bool addAnimation(const KeyframeValueList&, const IntSize&, const Animation*, const String&, double) OVERRIDE;
     124    virtual void pauseAnimation(const String&, double) OVERRIDE;
     125    virtual void removeAnimation(const String&) OVERRIDE;
    123126
    124127    void setRootLayer(bool);
    125128
    126129    WebKit::WebLayerID id() const;
    127     static CoordinatedGraphicsLayer* layerByID(WebKit::WebLayerID);
    128     void didSynchronize();
    129     Image* image() { return m_image.get(); }
    130 
     130
     131    void setFixedToViewport(bool isFixed) { m_fixedToViewport = isFixed; }
     132
     133    IntRect coverRect() const { return m_mainBackingStore ? m_mainBackingStore->mapToContents(m_mainBackingStore->coverRect()) : IntRect(); }
     134
     135    static void initFactory();
     136
     137    // TiledBackingStoreClient
     138    virtual void tiledBackingStorePaintBegin() OVERRIDE;
     139    virtual void tiledBackingStorePaint(GraphicsContext*, const IntRect&) OVERRIDE;
     140    virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea) OVERRIDE;
     141    virtual bool tiledBackingStoreUpdatesAllowed() const OVERRIDE;
     142    virtual IntRect tiledBackingStoreContentsRect() OVERRIDE;
     143    virtual IntRect tiledBackingStoreVisibleRect() OVERRIDE;
     144    virtual Color tiledBackingStoreBackgroundColor() const OVERRIDE;
     145
     146    // CoordinatedTileClient
     147    virtual void createTile(int tileID, const WebKit::SurfaceUpdateInfo&, const IntRect&) OVERRIDE;
     148    virtual void updateTile(int tileID, const WebKit::SurfaceUpdateInfo&, const IntRect&) OVERRIDE;
     149    virtual void removeTile(int tileID) OVERRIDE;
     150    virtual PassOwnPtr<GraphicsContext> beginContentUpdate(const IntSize&, WebKit::ShareableSurface::Handle&, IntPoint&) OVERRIDE;
     151
     152    void setCoordinatedGraphicsLayerClient(WebKit::CoordinatedGraphicsLayerClient*);
     153
     154    void adjustVisibleRect();
     155    void purgeBackingStores();
     156    bool hasPendingVisibleChanges();
     157
     158private:
    131159    bool fixedToViewport() const { return m_fixedToViewport; }
    132     void setFixedToViewport(bool isFixed) { m_fixedToViewport = isFixed; }
    133 
    134     GraphicsLayer* maskTarget() const { return m_maskTarget; }
    135160    void setMaskTarget(GraphicsLayer* layer) { m_maskTarget = layer; }
    136     IntRect coverRect() const { return m_mainBackingStore ? m_mainBackingStore->mapToContents(m_mainBackingStore->coverRect()) : IntRect(); }
    137 
    138     static void initFactory();
    139 
    140     // TiledBackingStoreClient
    141     virtual void tiledBackingStorePaintBegin();
    142     virtual void tiledBackingStorePaint(GraphicsContext*, const IntRect&);
    143     virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea);
    144     virtual bool tiledBackingStoreUpdatesAllowed() const;
    145     virtual IntRect tiledBackingStoreContentsRect();
    146     virtual IntRect tiledBackingStoreVisibleRect();
    147     virtual Color tiledBackingStoreBackgroundColor() const;
    148 
    149     // CoordinatedTileClient
    150     virtual void createTile(int tileID, const WebKit::SurfaceUpdateInfo&, const WebCore::IntRect&);
    151     virtual void updateTile(int tileID, const WebKit::SurfaceUpdateInfo&, const WebCore::IntRect&);
    152     virtual void removeTile(int tileID);
    153     virtual PassOwnPtr<WebCore::GraphicsContext> beginContentUpdate(const WebCore::IntSize&, WebKit::ShareableSurface::Handle&, WebCore::IntPoint&);
    154 
    155     void setCoordinatedGraphicsLayerClient(WebKit::CoordinatedGraphicsLayerClient*);
     161
     162    void notifyChange();
     163    void didChangeLayerState();
     164    void didChangeAnimations();
     165    void didChangeGeometry();
     166    void didChangeChildren();
     167#if ENABLE(CSS_FILTERS)
     168    void didChangeFilters();
     169#endif
     170
     171    void syncLayerState();
     172    void syncAnimations();
    156173    void syncChildren();
    157     void syncLayerState();
    158174#if ENABLE(CSS_FILTERS)
    159175    void syncFilters();
     
    161177    void syncCanvas();
    162178    void ensureImageBackingStore();
    163 
    164     void adjustVisibleRect();
    165     bool isReadyForTileBufferSwap() const;
     179    void computeTransformedVisibleRect();
    166180    void updateContentBuffers();
    167     void purgeBackingStores();
    168     bool hasPendingVisibleChanges();
    169 
    170     virtual bool addAnimation(const KeyframeValueList&, const IntSize&, const Animation*, const String&, double);
    171     virtual void pauseAnimation(const String&, double);
    172     virtual void removeAnimation(const String&);
    173 
    174 private:
    175     virtual void willBeDestroyed();
     181
     182    void createBackingStore();
     183
     184    bool selfOrAncestorHaveNonAffineTransforms();
     185    bool shouldUseTiledBackingStore();
     186    void adjustContentsScale();
     187
     188    void setShouldUpdateVisibleRect();
     189    float effectiveContentsScale();
     190
     191    void animationStartedTimerFired(Timer<CoordinatedGraphicsLayer>*);
     192
    176193    WebKit::WebLayerID m_id;
    177194    WebKit::WebLayerInfo m_layerInfo;
     
    189206    bool m_canvasNeedsDisplay : 1;
    190207
    191     void notifyChange();
    192     void didChangeAnimations();
    193     void didChangeGeometry();
    194     void didChangeLayerState();
    195     void didChangeChildren();
    196 #if ENABLE(CSS_FILTERS)
    197     void didChangeFilters();
    198 #endif
    199 
    200208    float m_effectiveOpacity;
    201209    TransformationMatrix m_effectiveTransform;
    202210
    203     void createBackingStore();
    204 
    205     bool selfOrAncestorHaveNonAffineTransforms();
    206     bool shouldUseTiledBackingStore();
    207     void adjustContentsScale();
    208     void computeTransformedVisibleRect();
    209     void syncLayerParameters();
    210     void syncAnimations();
    211     void setShouldUpdateVisibleRect();
    212     float effectiveContentsScale();
    213 
    214     void animationStartedTimerFired(WebCore::Timer<CoordinatedGraphicsLayer>*);
    215 
    216211    WebKit::CoordinatedGraphicsLayerClient* m_CoordinatedGraphicsLayerClient;
    217     OwnPtr<WebCore::TiledBackingStore> m_mainBackingStore;
    218     OwnPtr<WebCore::TiledBackingStore> m_previousBackingStore;
     212    OwnPtr<TiledBackingStore> m_mainBackingStore;
     213    OwnPtr<TiledBackingStore> m_previousBackingStore;
    219214    float m_contentsScale;
    220215    PlatformLayer* m_canvasPlatformLayer;
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h

    r132801 r133182  
    4444    static PassRefPtr<LayerTreeCoordinator> create(WebPage*);
    4545    virtual ~LayerTreeCoordinator();
    46 
    47     static bool supportsAcceleratedCompositing();
    4846
    4947    virtual const LayerTreeContext& layerTreeContext() { return m_layerTreeContext; }
Note: See TracChangeset for help on using the changeset viewer.