Title: [106483] trunk/Source/WebCore
Revision
106483
Author
[email protected]
Date
2012-02-01 12:02:34 -0800 (Wed, 01 Feb 2012)

Log Message

Reviewed by Darin Adler.

Simplify the code that creates a new tile layer by getting a reference to the RetainPtr<WebTileLayer>&
slot in the hash map and assign directly into it.

* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::revalidateTiles):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106482 => 106483)


--- trunk/Source/WebCore/ChangeLog	2012-02-01 19:59:47 UTC (rev 106482)
+++ trunk/Source/WebCore/ChangeLog	2012-02-01 20:02:34 UTC (rev 106483)
@@ -1,5 +1,15 @@
 2012-02-01  Anders Carlsson  <[email protected]>
 
+        Reviewed by Darin Adler.
+
+        Simplify the code that creates a new tile layer by getting a reference to the RetainPtr<WebTileLayer>&
+        slot in the hash map and assign directly into it.
+
+        * platform/graphics/ca/mac/TileCache.mm:
+        (WebCore::TileCache::revalidateTiles):
+
+2012-02-01  Anders Carlsson  <[email protected]>
+
         Tile cache doesn't have an upper limit
         https://bugs.webkit.org/show_bug.cgi?id=77564
         <rdar://problem/10710744>

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm (106482 => 106483)


--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2012-02-01 19:59:47 UTC (rev 106482)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2012-02-01 20:02:34 UTC (rev 106483)
@@ -295,16 +295,15 @@
         for (int x = topLeft.x(); x <= bottomRight.x(); ++x) {
             TileIndex tileIndex(x, y);
 
-            pair<TileMap::iterator, bool> result = m_tiles.add(tileIndex, 0);
-            if (result.first->second) {
+            RetainPtr<WebTileLayer>& tileLayer = m_tiles.add(tileIndex, 0).first->second;
+            if (tileLayer) {
                 // We already have a layer for this tile.
                 continue;
             }
 
             didCreateNewTiles = true;
 
-            RetainPtr<WebTileLayer> tileLayer = createTileLayer();
-            result.first->second = tileLayer.get();
+            tileLayer = createTileLayer();
 
             [tileLayer.get() setNeedsDisplay];
             [tileLayer.get() setPosition:CGPointMake(x * m_tileSize.width(), y * m_tileSize.height())];
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to