[CoordinatedGraphics] Clean up type aliases in CoordinatedGraphicsScene
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jun 2017 12:08:00 +0000 (12:08 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jun 2017 12:08:00 +0000 (12:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173764

Reviewed by Carlos Garcia Campos.

Drop the various type aliases created in the CoordinatedGraphicsScene
class. We can leave without these by leveraging `auto` where necessary.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
(WebKit::CoordinatedGraphicsScene::updateImageBacking):
(WebKit::CoordinatedGraphicsScene::clearImageBackingContents):
(WebKit::CoordinatedGraphicsScene::assignImageBackingToLayer):
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h

index 13a7c91..df1bbd9 100644 (file)
@@ -1,3 +1,20 @@
+2017-06-23  Zan Dobersek  <zdobersek@igalia.com>
+
+        [CoordinatedGraphics] Clean up type aliases in CoordinatedGraphicsScene
+        https://bugs.webkit.org/show_bug.cgi?id=173764
+
+        Reviewed by Carlos Garcia Campos.
+
+        Drop the various type aliases created in the CoordinatedGraphicsScene
+        class. We can leave without these by leveraging `auto` where necessary.
+
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+        (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
+        (WebKit::CoordinatedGraphicsScene::updateImageBacking):
+        (WebKit::CoordinatedGraphicsScene::clearImageBackingContents):
+        (WebKit::CoordinatedGraphicsScene::assignImageBackingToLayer):
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
+
 2017-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [WPE] Crash in wpe_view_backend_get_renderer_host_fd
index 4ab0e5a..2d806f1 100644 (file)
@@ -421,7 +421,7 @@ void CoordinatedGraphicsScene::updateTilesIfNeeded(TextureMapperLayer* layer, co
     for (auto& tile : state.tilesToUpdate) {
         const SurfaceUpdateInfo& surfaceUpdateInfo = tile.updateInfo;
 
-        SurfaceMap::iterator surfaceIt = m_surfaces.find(surfaceUpdateInfo.atlasID);
+        auto surfaceIt = m_surfaces.find(surfaceUpdateInfo.atlasID);
         ASSERT(surfaceIt != m_surfaces.end());
 
         backingStore->updateTile(tile.tileID, surfaceUpdateInfo.updateRect, tile.tileRect, surfaceIt->value.copyRef(), surfaceUpdateInfo.surfaceOffset);
@@ -477,7 +477,7 @@ void CoordinatedGraphicsScene::createImageBacking(CoordinatedImageBackingID imag
 void CoordinatedGraphicsScene::updateImageBacking(CoordinatedImageBackingID imageID, RefPtr<CoordinatedSurface>&& surface)
 {
     ASSERT(m_imageBackings.contains(imageID));
-    ImageBackingMap::iterator it = m_imageBackings.find(imageID);
+    auto it = m_imageBackings.find(imageID);
     RefPtr<CoordinatedBackingStore> backingStore = it->value;
 
     // CoordinatedImageBacking is realized to CoordinatedBackingStore with only one tile in UI Process.
@@ -494,7 +494,7 @@ void CoordinatedGraphicsScene::updateImageBacking(CoordinatedImageBackingID imag
 void CoordinatedGraphicsScene::clearImageBackingContents(CoordinatedImageBackingID imageID)
 {
     ASSERT(m_imageBackings.contains(imageID));
-    ImageBackingMap::iterator it = m_imageBackings.find(imageID);
+    auto it = m_imageBackings.find(imageID);
     RefPtr<CoordinatedBackingStore> backingStore = it->value;
     backingStore->removeAllTiles();
     m_backingStoresWithPendingBuffers.add(backingStore);
@@ -515,7 +515,7 @@ void CoordinatedGraphicsScene::assignImageBackingToLayer(TextureMapperLayer* lay
         return;
     }
 
-    ImageBackingMap::iterator it = m_imageBackings.find(imageID);
+    auto it = m_imageBackings.find(imageID);
     ASSERT(it != m_imageBackings.end());
     layer->setContentsLayer(it->value.get());
 }
index daf89a1..6653b10 100644 (file)
@@ -155,22 +155,17 @@ private:
 
     std::unique_ptr<WebCore::TextureMapper> m_textureMapper;
 
-    typedef HashMap<WebCore::CoordinatedImageBackingID, RefPtr<CoordinatedBackingStore>> ImageBackingMap;
-    ImageBackingMap m_imageBackings;
+    HashMap<WebCore::CoordinatedImageBackingID, RefPtr<CoordinatedBackingStore>> m_imageBackings;
     Vector<RefPtr<CoordinatedBackingStore>> m_releasedImageBackings;
 
-    typedef HashMap<WebCore::TextureMapperLayer*, RefPtr<CoordinatedBackingStore>> BackingStoreMap;
-    BackingStoreMap m_backingStores;
-
+    HashMap<WebCore::TextureMapperLayer*, RefPtr<CoordinatedBackingStore>> m_backingStores;
     HashSet<RefPtr<CoordinatedBackingStore>> m_backingStoresWithPendingBuffers;
 
 #if USE(COORDINATED_GRAPHICS_THREADED)
-    typedef HashMap<WebCore::TextureMapperLayer*, RefPtr<WebCore::TextureMapperPlatformLayerProxy>> PlatformLayerProxyMap;
-    PlatformLayerProxyMap m_platformLayerProxies;
+    HashMap<WebCore::TextureMapperLayer*, RefPtr<WebCore::TextureMapperPlatformLayerProxy>> m_platformLayerProxies;
 #endif
 
-    typedef HashMap<uint32_t /* atlasID */, RefPtr<WebCore::CoordinatedSurface>> SurfaceMap;
-    SurfaceMap m_surfaces;
+    HashMap<uint32_t /* atlasID */, RefPtr<WebCore::CoordinatedSurface>> m_surfaces;
 
     // Below two members are accessed by only the main thread. The painting thread must lock the main thread to access both members.
     CoordinatedGraphicsSceneClient* m_client;
@@ -178,10 +173,8 @@ private:
 
     std::unique_ptr<WebCore::TextureMapperLayer> m_rootLayer;
 
-    typedef HashMap<WebCore::CoordinatedLayerID, std::unique_ptr<WebCore::TextureMapperLayer>> LayerMap;
-    LayerMap m_layers;
-    typedef HashMap<WebCore::CoordinatedLayerID, WebCore::TextureMapperLayer*> LayerRawPtrMap;
-    LayerRawPtrMap m_fixedLayers;
+    HashMap<WebCore::CoordinatedLayerID, std::unique_ptr<WebCore::TextureMapperLayer>> m_layers;
+    HashMap<WebCore::CoordinatedLayerID, WebCore::TextureMapperLayer*> m_fixedLayers;
     WebCore::CoordinatedLayerID m_rootLayerID;
     WebCore::FloatPoint m_scrollPosition;
     WebCore::FloatPoint m_renderedContentsScrollPosition;