Changeset 133182 in webkit
- Timestamp:
- Nov 1, 2012, 8:55:53 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r133177 r133182 1 2012-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 1 25 2012-11-01 Christophe Dumez <christophe.dumez@intel.com> 2 26 -
trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h
r132972 r133182 47 47 48 48 class LayerTreeCoordinatorProxy { 49 WTF_MAKE_NONCOPYABLE(LayerTreeCoordinatorProxy); 50 WTF_MAKE_FAST_ALLOCATED; 49 51 public: 50 LayerTreeCoordinatorProxy(DrawingAreaProxy*);51 virtual~LayerTreeCoordinatorProxy();52 explicit LayerTreeCoordinatorProxy(DrawingAreaProxy*); 53 ~LayerTreeCoordinatorProxy(); 52 54 void setCompositingLayerState(WebLayerID, const WebLayerInfo&); 53 55 void setCompositingLayerChildren(WebLayerID, const Vector<WebLayerID>&); -
trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h
r132742 r133182 61 61 } 62 62 }; 63 LayerTreeRenderer(LayerTreeCoordinatorProxy*);63 explicit LayerTreeRenderer(LayerTreeCoordinatorProxy*); 64 64 virtual ~LayerTreeRenderer(); 65 65 void purgeGLResources(); … … 76 76 void detach(); 77 77 void appendUpdate(const Function<void()>&); 78 void updateViewport();79 78 void setActive(bool); 80 79 … … 96 95 void setAnimationsLocked(bool); 97 96 98 99 97 #if ENABLE(REQUEST_ANIMATION_FRAME) 100 98 void requestAnimationFrame(); … … 114 112 virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const { return false; } 115 113 void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect&) { } 114 void updateViewport(); 116 115 void dispatchOnMainThread(const Function<void()>&); 117 116 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(); 118 124 119 125 typedef HashMap<WebLayerID, WebCore::GraphicsLayer*> LayerMap; … … 134 140 SurfaceBackingStoreMap m_surfaceBackingStores; 135 141 #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();146 142 147 143 LayerTreeCoordinatorProxy* m_layerTreeCoordinatorProxy; -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp
r132907 r133182 46 46 static HashMap<WebLayerID, CoordinatedGraphicsLayer*> globalMap; 47 47 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;57 48 } 58 49 … … 137 128 } 138 129 willBeDestroyed(); 139 }140 141 void CoordinatedGraphicsLayer::willBeDestroyed()142 {143 GraphicsLayer::willBeDestroyed();144 130 } 145 131 -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h
r132907 r133182 79 79 namespace WebCore { 80 80 81 class CoordinatedGraphicsLayer : public WebCore::GraphicsLayer81 class CoordinatedGraphicsLayer : public GraphicsLayer 82 82 , public TiledBackingStoreClient 83 83 , public WebKit::CoordinatedTileClient { … … 87 87 88 88 // 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; 123 126 124 127 void setRootLayer(bool); 125 128 126 129 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 158 private: 131 159 bool fixedToViewport() const { return m_fixedToViewport; } 132 void setFixedToViewport(bool isFixed) { m_fixedToViewport = isFixed; }133 134 GraphicsLayer* maskTarget() const { return m_maskTarget; }135 160 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(); 156 173 void syncChildren(); 157 void syncLayerState();158 174 #if ENABLE(CSS_FILTERS) 159 175 void syncFilters(); … … 161 177 void syncCanvas(); 162 178 void ensureImageBackingStore(); 163 164 void adjustVisibleRect(); 165 bool isReadyForTileBufferSwap() const; 179 void computeTransformedVisibleRect(); 166 180 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 176 193 WebKit::WebLayerID m_id; 177 194 WebKit::WebLayerInfo m_layerInfo; … … 189 206 bool m_canvasNeedsDisplay : 1; 190 207 191 void notifyChange();192 void didChangeAnimations();193 void didChangeGeometry();194 void didChangeLayerState();195 void didChangeChildren();196 #if ENABLE(CSS_FILTERS)197 void didChangeFilters();198 #endif199 200 208 float m_effectiveOpacity; 201 209 TransformationMatrix m_effectiveTransform; 202 210 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 216 211 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; 219 214 float m_contentsScale; 220 215 PlatformLayer* m_canvasPlatformLayer; -
trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h
r132801 r133182 44 44 static PassRefPtr<LayerTreeCoordinator> create(WebPage*); 45 45 virtual ~LayerTreeCoordinator(); 46 47 static bool supportsAcceleratedCompositing();48 46 49 47 virtual const LayerTreeContext& layerTreeContext() { return m_layerTreeContext; }
Note:
See TracChangeset
for help on using the changeset viewer.