Diff
Modified: trunk/Source/WebCore/ChangeLog (175360 => 175361)
--- trunk/Source/WebCore/ChangeLog 2014-10-30 01:06:09 UTC (rev 175360)
+++ trunk/Source/WebCore/ChangeLog 2014-10-30 01:18:32 UTC (rev 175361)
@@ -1,3 +1,25 @@
+2014-10-29 Hunseop Jeong <[email protected]>
+
+ [CoordinatedGraphics] Use modern for-loops
+ https://bugs.webkit.org/show_bug.cgi?id=138168
+
+ Reviewed by Andreas Kling.
+
+ No new tests as there is no change in functionality.
+
+ * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp: Use a modern for loop.
+ (WebCore::CompositingCoordinator::renderNextFrame):
+ (WebCore::CompositingCoordinator::paintToSurface):
+ * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: Use a modern for loop.
+ (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
+ (WebCore::CoordinatedGraphicsLayer::flushCompositingState):
+ (WebCore::CoordinatedGraphicsLayer::syncChildren):
+ (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
+ (WebCore::CoordinatedGraphicsLayer::findFirstDescendantWithContentsRecursively):
+ (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
+ * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: Use a modern for loop.
+ (WebCore::CoordinatedImageBacking::updateVisibilityIfNeeded):
+
2014-10-29 Chris Dumez <[email protected]>
Final-ize more of TextFieldInputType's virtual functions
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp (175360 => 175361)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp 2014-10-30 01:06:09 UTC (rev 175360)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp 2014-10-30 01:18:32 UTC (rev 175361)
@@ -356,8 +356,8 @@
void CompositingCoordinator::renderNextFrame()
{
- for (unsigned i = 0; i < m_updateAtlases.size(); ++i)
- m_updateAtlases[i]->didSwapBuffers();
+ for (auto& atlas : m_updateAtlases)
+ atlas->didSwapBuffers();
}
void CompositingCoordinator::purgeBackingStores()
@@ -373,8 +373,8 @@
bool CompositingCoordinator::paintToSurface(const IntSize& size, CoordinatedSurface::Flags flags, uint32_t& atlasID, IntPoint& offset, CoordinatedSurface::Client* client)
{
- for (unsigned i = 0; i < m_updateAtlases.size(); ++i) {
- UpdateAtlas* atlas = m_updateAtlases[i].get();
+ for (auto& updateAtlas : m_updateAtlases) {
+ UpdateAtlas* atlas = updateAtlas.get();
if (atlas->supportsAlpha() == (flags & CoordinatedSurface::SupportsAlpha)) {
// This will be false if there is no available buffer space.
if (atlas->paintOnAvailableBuffer(size, atlasID, offset, client))
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (175360 => 175361)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp 2014-10-30 01:06:09 UTC (rev 175360)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp 2014-10-30 01:18:32 UTC (rev 175361)
@@ -91,8 +91,8 @@
void CoordinatedGraphicsLayer::setShouldUpdateVisibleRect()
{
m_shouldUpdateVisibleRect = true;
- for (size_t i = 0; i < children().size(); ++i)
- toCoordinatedGraphicsLayer(children()[i])->setShouldUpdateVisibleRect();
+ for (auto& child : children())
+ toCoordinatedGraphicsLayer(child)->setShouldUpdateVisibleRect();
if (replicaLayer())
toCoordinatedGraphicsLayer(replicaLayer())->setShouldUpdateVisibleRect();
}
@@ -598,8 +598,8 @@
flushCompositingStateForThisLayerOnly();
- for (size_t i = 0; i < children().size(); ++i)
- children()[i]->flushCompositingState(rect);
+ for (auto& child : children())
+ child->flushCompositingState(rect);
}
CoordinatedGraphicsLayer* toCoordinatedGraphicsLayer(GraphicsLayer* layer)
@@ -614,8 +614,8 @@
m_shouldSyncChildren = false;
m_layerState.childrenChanged = true;
m_layerState.children.clear();
- for (size_t i = 0; i < children().size(); ++i)
- m_layerState.children.append(toCoordinatedLayerID(children()[i]));
+ for (auto& child : children())
+ m_layerState.children.append(toCoordinatedLayerID(child));
}
void CoordinatedGraphicsLayer::syncFilters()
@@ -802,8 +802,8 @@
if (maskLayer())
toCoordinatedGraphicsLayer(maskLayer())->syncPendingStateChangesIncludingSubLayers();
- for (size_t i = 0; i < children().size(); ++i)
- toCoordinatedGraphicsLayer(children()[i])->syncPendingStateChangesIncludingSubLayers();
+ for (auto& child : children())
+ toCoordinatedGraphicsLayer(child)->syncPendingStateChangesIncludingSubLayers();
}
void CoordinatedGraphicsLayer::resetLayerState()
@@ -842,8 +842,8 @@
if (shouldHaveBackingStore())
return this;
- for (size_t i = 0; i < children().size(); ++i) {
- CoordinatedGraphicsLayer* layer = toCoordinatedGraphicsLayer(children()[i])->findFirstDescendantWithContentsRecursively();
+ for (auto& child : children()) {
+ CoordinatedGraphicsLayer* layer = toCoordinatedGraphicsLayer(child)->findFirstDescendantWithContentsRecursively();
if (layer)
return layer;
}
@@ -1003,8 +1003,8 @@
updateContentBuffers();
- for (size_t i = 0; i < children().size(); ++i)
- toCoordinatedGraphicsLayer(children()[i])->updateContentBuffersIncludingSubLayers();
+ for (auto& child : children())
+ toCoordinatedGraphicsLayer(child)->updateContentBuffersIncludingSubLayers();
}
void CoordinatedGraphicsLayer::updateContentBuffers()
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp (175360 => 175361)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp 2014-10-30 01:06:09 UTC (rev 175360)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp 2014-10-30 01:18:32 UTC (rev 175361)
@@ -151,8 +151,8 @@
bool previousIsVisible = m_isVisible;
m_isVisible = false;
- for (size_t i = 0; i < m_hosts.size(); ++i) {
- if (m_hosts[i]->imageBackingVisible()) {
+ for (auto& host : m_hosts) {
+ if (host->imageBackingVisible()) {
m_isVisible = true;
break;
}
Modified: trunk/Source/WebKit2/ChangeLog (175360 => 175361)
--- trunk/Source/WebKit2/ChangeLog 2014-10-30 01:06:09 UTC (rev 175360)
+++ trunk/Source/WebKit2/ChangeLog 2014-10-30 01:18:32 UTC (rev 175361)
@@ -1,3 +1,31 @@
+2014-10-29 Hunseop Jeong <[email protected]>
+
+ [CoordinatedGraphics] Use modern for-loops
+ https://bugs.webkit.org/show_bug.cgi?id=138168
+
+ Reviewed by Andreas Kling.
+
+ No new tests as there is no change in functionality.
+
+ * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp: Use a modern for loop.
+ (WebCore::CoordinatedBackingStore::texture):
+ (WebCore::CoordinatedBackingStore::paintTilesToTextureMapper):
+ * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp: Use a modern for loop.
+ (WebKit::CoordinatedDrawingAreaProxy::incorporateUpdate):
+ * UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: Use a modern for loop.
+ (WebCore::CoordinatedGraphicsScene::setLayerChildrenIfNeeded):
+ (WebCore::CoordinatedGraphicsScene::createLayers): changed the name of argument to be equal with deleteLayer().
+ (WebCore::CoordinatedGraphicsScene::deleteLayers):
+ (WebCore::CoordinatedGraphicsScene::createTilesIfNeeded):
+ (WebCore::CoordinatedGraphicsScene::removeTilesIfNeeded):
+ (WebCore::CoordinatedGraphicsScene::updateTilesIfNeeded):
+ (WebCore::CoordinatedGraphicsScene::syncUpdateAtlases):
+ (WebCore::CoordinatedGraphicsScene::syncImageBackings):
+ (WebCore::CoordinatedGraphicsScene::commitSceneState):
+ * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: Use a modern for loop.
+ (WebKit::shouldPaintBoundsRect):
+ (WebKit::CoordinatedDrawingArea::display):
+
2014-10-29 Gyuyoung Kim <[email protected]>
Unreviewed, EFL build fix since r175349.
Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp (175360 => 175361)
--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp 2014-10-30 01:06:09 UTC (rev 175360)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp 2014-10-30 01:18:32 UTC (rev 175361)
@@ -91,9 +91,8 @@
PassRefPtr<BitmapTexture> CoordinatedBackingStore::texture() const
{
- CoordinatedBackingStoreTileMap::const_iterator end = m_tiles.end();
- for (CoordinatedBackingStoreTileMap::const_iterator it = m_tiles.begin(); it != end; ++it) {
- RefPtr<BitmapTexture> texture = it->value.texture();
+ for (auto& tile : m_tiles.values()) {
+ RefPtr<BitmapTexture> texture = tile.texture();
if (texture)
return texture;
}
@@ -108,8 +107,8 @@
void CoordinatedBackingStore::paintTilesToTextureMapper(Vector<TextureMapperTile*>& tiles, TextureMapper* textureMapper, const TransformationMatrix& transform, float opacity, const FloatRect& rect)
{
- for (size_t i = 0; i < tiles.size(); ++i)
- tiles[i]->paint(textureMapper, transform, opacity, calculateExposedTileEdges(rect, tiles[i]->rect()));
+ for (auto& tile : tiles)
+ tile->paint(textureMapper, transform, opacity, calculateExposedTileEdges(rect, tile->rect()));
}
TransformationMatrix CoordinatedBackingStore::adjustedTransformForRect(const FloatRect& targetRect)
Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp (175360 => 175361)
--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp 2014-10-30 01:06:09 UTC (rev 175360)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp 2014-10-30 01:18:32 UTC (rev 175361)
@@ -253,8 +253,8 @@
if (shouldScroll && !m_webPageProxy.canScrollView())
m_webPageProxy.setViewNeedsDisplay(IntRect(IntPoint(), m_webPageProxy.viewSize()));
else {
- for (size_t i = 0; i < updateInfo.updateRects.size(); ++i)
- m_webPageProxy.setViewNeedsDisplay(updateInfo.updateRects[i]);
+ for (auto& updateRect : updateInfo.updateRects)
+ m_webPageProxy.setViewNeedsDisplay(updateRect);
}
if (shouldScroll)
Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.cpp (175360 => 175361)
--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 2014-10-30 01:06:09 UTC (rev 175360)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 2014-10-30 01:18:32 UTC (rev 175361)
@@ -215,10 +215,9 @@
Vector<TextureMapperLayer*> children;
- for (size_t i = 0; i < state.children.size(); ++i) {
- CoordinatedLayerID childID = state.children[i];
- TextureMapperLayer* child = layerByID(childID);
- children.append(child);
+ for (auto& child : state.children) {
+ TextureMapperLayer* childLayer = layerByID(child);
+ children.append(childLayer);
}
layer->setChildren(children);
}
@@ -322,10 +321,10 @@
return (id != InvalidCoordinatedLayerID) ? layerByID(id) : 0;
}
-void CoordinatedGraphicsScene::createLayers(const Vector<CoordinatedLayerID>& ids)
+void CoordinatedGraphicsScene::createLayers(const Vector<CoordinatedLayerID>& layerIDs)
{
- for (size_t index = 0; index < ids.size(); ++index)
- createLayer(ids[index]);
+ for (auto& layerID : layerIDs)
+ createLayer(layerID);
}
void CoordinatedGraphicsScene::createLayer(CoordinatedLayerID id)
@@ -338,8 +337,8 @@
void CoordinatedGraphicsScene::deleteLayers(const Vector<CoordinatedLayerID>& layerIDs)
{
- for (size_t index = 0; index < layerIDs.size(); ++index)
- deleteLayer(layerIDs[index]);
+ for (auto& layerID : layerIDs)
+ deleteLayer(layerID);
}
void CoordinatedGraphicsScene::deleteLayer(CoordinatedLayerID layerID)
@@ -412,8 +411,8 @@
RefPtr<CoordinatedBackingStore> backingStore = m_backingStores.get(layer);
ASSERT(backingStore);
- for (size_t i = 0; i < state.tilesToCreate.size(); ++i)
- backingStore->createTile(state.tilesToCreate[i].tileID, state.tilesToCreate[i].scale);
+ for (auto& tile : state.tilesToCreate)
+ backingStore->createTile(tile.tileID, tile.scale);
}
void CoordinatedGraphicsScene::removeTilesIfNeeded(TextureMapperLayer* layer, const CoordinatedGraphicsLayerState& state)
@@ -425,8 +424,8 @@
if (!backingStore)
return;
- for (size_t i = 0; i < state.tilesToRemove.size(); ++i)
- backingStore->removeTile(state.tilesToRemove[i]);
+ for (auto& tile : state.tilesToRemove)
+ backingStore->removeTile(tile);
m_backingStoresWithPendingBuffers.add(backingStore);
}
@@ -439,25 +438,24 @@
RefPtr<CoordinatedBackingStore> backingStore = m_backingStores.get(layer);
ASSERT(backingStore);
- for (size_t i = 0; i < state.tilesToUpdate.size(); ++i) {
- const TileUpdateInfo& tileInfo = state.tilesToUpdate[i];
- const SurfaceUpdateInfo& surfaceUpdateInfo = tileInfo.updateInfo;
+ for (auto& tile : state.tilesToUpdate) {
+ const SurfaceUpdateInfo& surfaceUpdateInfo = tile.updateInfo;
SurfaceMap::iterator surfaceIt = m_surfaces.find(surfaceUpdateInfo.atlasID);
ASSERT(surfaceIt != m_surfaces.end());
- backingStore->updateTile(tileInfo.tileID, surfaceUpdateInfo.updateRect, tileInfo.tileRect, surfaceIt->value, surfaceUpdateInfo.surfaceOffset);
+ backingStore->updateTile(tile.tileID, surfaceUpdateInfo.updateRect, tile.tileRect, surfaceIt->value, surfaceUpdateInfo.surfaceOffset);
m_backingStoresWithPendingBuffers.add(backingStore);
}
}
void CoordinatedGraphicsScene::syncUpdateAtlases(const CoordinatedGraphicsState& state)
{
- for (size_t i = 0; i < state.updateAtlasesToCreate.size(); ++i)
- createUpdateAtlas(state.updateAtlasesToCreate[i].first, state.updateAtlasesToCreate[i].second);
+ for (auto& atlas : state.updateAtlasesToCreate)
+ createUpdateAtlas(atlas.first, atlas.second);
- for (size_t i = 0; i < state.updateAtlasesToRemove.size(); ++i)
- removeUpdateAtlas(state.updateAtlasesToRemove[i]);
+ for (auto& atlas : state.updateAtlasesToRemove)
+ removeUpdateAtlas(atlas);
}
void CoordinatedGraphicsScene::createUpdateAtlas(uint32_t atlasID, PassRefPtr<CoordinatedSurface> surface)
@@ -474,17 +472,17 @@
void CoordinatedGraphicsScene::syncImageBackings(const CoordinatedGraphicsState& state)
{
- for (size_t i = 0; i < state.imagesToRemove.size(); ++i)
- removeImageBacking(state.imagesToRemove[i]);
+ for (auto& image : state.imagesToRemove)
+ removeImageBacking(image);
- for (size_t i = 0; i < state.imagesToCreate.size(); ++i)
- createImageBacking(state.imagesToCreate[i]);
+ for (auto& image : state.imagesToCreate)
+ createImageBacking(image);
- for (size_t i = 0; i < state.imagesToUpdate.size(); ++i)
- updateImageBacking(state.imagesToUpdate[i].first, state.imagesToUpdate[i].second);
+ for (auto& image : state.imagesToUpdate)
+ updateImageBacking(image.first, image.second);
- for (size_t i = 0; i < state.imagesToClear.size(); ++i)
- clearImageBackingContents(state.imagesToClear[i]);
+ for (auto& image : state.imagesToClear)
+ clearImageBackingContents(image);
}
void CoordinatedGraphicsScene::createImageBacking(CoordinatedImageBackingID imageID)
@@ -571,8 +569,8 @@
syncImageBackings(state);
syncUpdateAtlases(state);
- for (size_t i = 0; i < state.layersToUpdate.size(); ++i)
- setLayerState(state.layersToUpdate[i].first, state.layersToUpdate[i].second);
+ for (auto& layer : state.layersToUpdate)
+ setLayerState(layer.first, layer.second);
commitPendingBackingStoreOperations();
removeReleasedImageBackingsIfNeeded();
Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp (175360 => 175361)
--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp 2014-10-30 01:06:09 UTC (rev 175360)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp 2014-10-30 01:18:32 UTC (rev 175361)
@@ -532,8 +532,8 @@
// is too large, then we will do individual rect painting instead.
unsigned boundsArea = bounds.width() * bounds.height();
unsigned rectsArea = 0;
- for (size_t i = 0; i < rects.size(); ++i)
- rectsArea += rects[i].width() * rects[i].height();
+ for (auto& rect : rects)
+ rectsArea += rect.width() * rect.height();
double wastedSpace = 1 - (static_cast<double>(rectsArea) / boundsArea);
@@ -590,9 +590,9 @@
graphicsContext->translate(-bounds.x(), -bounds.y());
- for (size_t i = 0; i < rects.size(); ++i) {
- m_webPage.drawRect(*graphicsContext, rects[i]);
- updateInfo.updateRects.append(rects[i]);
+ for (auto& rect : rects) {
+ m_webPage.drawRect(*graphicsContext, rect);
+ updateInfo.updateRects.append(rect);
}
// Layout can trigger more calls to setNeedsDisplay and we don't want to process them