aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawOpAtlas.cpp
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2017-09-25 16:53:49 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-25 21:14:09 +0000
commit712fe73cafb824f0d30a57ab0301afce52d1dc49 (patch)
treeac2ba0abefe586a94d5c4fa89760a1d23473ce1b /src/gpu/GrDrawOpAtlas.cpp
parentf40ae1a4b5365620463bd63b5140bd3fc78894a1 (diff)
Add animated cowboy sample from WebKit tests, and fix.
Bug: chromium:712455 Change-Id: Ic9bb9b862abe01f112cc41d28589733460b15bc1 Reviewed-on: https://skia-review.googlesource.com/50181 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrDrawOpAtlas.cpp')
-rw-r--r--src/gpu/GrDrawOpAtlas.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index 22def06212..d4e9e7d2fc 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -218,10 +218,13 @@ bool GrDrawOpAtlas::addToAtlas(AtlasID* id, GrDrawOp::Target* target, int width,
}
plotIter.next();
}
+ }
- // If the above fails, then see if the least recently refed plot has already been
- // flushed to the gpu
- plot = fPages[pageIdx].fPlotList.tail();
+ // If the above fails, then see if the least recently used plot per page has already been
+ // flushed to the gpu.
+ // As before we prioritize this upload to the first pages, not the most recently used.
+ for (unsigned int pageIdx = 0; pageIdx < fNumPages; ++pageIdx) {
+ Plot* plot = fPages[pageIdx].fPlotList.tail();
SkASSERT(plot);
if (target->hasDrawBeenFlushed(plot->lastUseToken())) {
this->processEviction(plot->id());