Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Unified Diff: src/core/SkTileGrid.cpp

Issue 625573003: TileGrid: earliest need not be a pointer anymore (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTileGrid.cpp
diff --git a/src/core/SkTileGrid.cpp b/src/core/SkTileGrid.cpp
index 8cdebcb0b682e2569b235b2655f718fb2b79f395..964b1e35ade311318577faa7e03c0a0da819c87a 100644
--- a/src/core/SkTileGrid.cpp
+++ b/src/core/SkTileGrid.cpp
@@ -122,26 +122,24 @@ void SkTileGrid::search(const SkRect& query, SkTDArray<unsigned>* results) const
// Merge tiles into results until they're fully consumed.
results->reset();
while (true) {
- // The tiles themselves are already ordered, so the earliest is at the front of some tile.
- // It may be at the front of several, even all, tiles.
- const unsigned* earliest = NULL;
+ // The tiles themselves are already ordered, so the earliest op is at the front of some
+ // tile. It may be at the front of several, even all, tiles.
robertphillips 2014/10/02 15:17:25 SK_MaxU32 ?
mtklein 2014/10/02 15:40:59 Done.
+ unsigned earliest = ~0u;
for (int i = 0; i < starts.count(); i++) {
if (starts[i] < ends[i]) {
- if (NULL == earliest || *starts[i]< *earliest) {
- earliest = starts[i];
- }
+ earliest = SkTMin(earliest, *starts[i]);
}
}
- // If we didn't find an earliest entry, there isn't anything left to merge.
- if (NULL == earliest) {
+ // If we didn't find an earliest op, there isn't anything left to merge.
robertphillips 2014/10/02 15:17:25 and here ?
mtklein 2014/10/02 15:40:59 Done.
+ if (~0u == earliest) {
return;
}
- // We did find an earliest entry. Output it, and step forward every tile that contains it.
- results->push(*earliest);
+ // We did find an earliest op. Output it, and step forward every tile that contains it.
+ results->push(earliest);
for (int i = 0; i < starts.count(); i++) {
- if (starts[i] < ends[i] && *starts[i] == *earliest) {
+ if (starts[i] < ends[i] && *starts[i] == earliest) {
starts[i]++;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698