aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-09-24 08:59:37 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-24 08:59:37 -0700
commiteee606c7bf6b343429dcdbf56b6b71bd83575060 (patch)
tree79a2fb34f9606d9fe3b5859b5c2879bbc530da54 /src
parent30d2cc6ff47cb7f981d83e9a536971beec920f61 (diff)
Swap iteration order in TileGrid::insert().
Was looking at performance here (it's the record hotspot) and noticed we iterate through the grid out of order. This is a tiny little thing, but it's probably orthogonal to any other performance improvements we'll make in here. BUG=skia: R=robertphillips@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/598933004
Diffstat (limited to 'src')
-rw-r--r--src/core/SkTileGrid.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/SkTileGrid.cpp b/src/core/SkTileGrid.cpp
index 84dc949b36..2eea6dbf36 100644
--- a/src/core/SkTileGrid.cpp
+++ b/src/core/SkTileGrid.cpp
@@ -52,8 +52,8 @@ void SkTileGrid::insert(void* data, const SkRect& fbounds, bool) {
fYTiles - 1));
Entry entry = { fCount++, data };
- for (int x = minX; x <= maxX; x++) {
- for (int y = minY; y <= maxY; y++) {
+ for (int y = minY; y <= maxY; y++) {
+ for (int x = minX; x <= maxX; x++) {
fTiles[y * fXTiles + x].push(entry);
}
}