aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawOpAtlas.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-03-01 10:53:45 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-01 16:33:14 +0000
commit6250f293869d54ccef5e2af0a8e622232b5b4f73 (patch)
tree759b153a7e03c432da49d5e7c5500de2e922d0c3 /src/gpu/GrDrawOpAtlas.cpp
parent4bc7011802e411da74eb2d213d6328e42f7dce1c (diff)
Clean up GrDrawOpAtlas (take 2)
Relanding all the things TBR=jvanverth@google.com Change-Id: Ie4ecdaee1c192c841817a54d64a9b3f70d28b28f Reviewed-on: https://skia-review.googlesource.com/111360 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrDrawOpAtlas.cpp')
-rw-r--r--src/gpu/GrDrawOpAtlas.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gpu/GrDrawOpAtlas.cpp b/src/gpu/GrDrawOpAtlas.cpp
index 7539a7a05e..3fd3110dcc 100644
--- a/src/gpu/GrDrawOpAtlas.cpp
+++ b/src/gpu/GrDrawOpAtlas.cpp
@@ -303,7 +303,7 @@ bool GrDrawOpAtlas::addToAtlas(GrResourceProvider* resourceProvider,
// Try to find a plot that we can perform an inline upload to.
// We prioritize this upload in reverse order of pages to counterbalance the order above.
Plot* plot = nullptr;
- for (int pageIdx = (int)(fNumActivePages-1); pageIdx >= 0; --pageIdx) {
+ for (int pageIdx = ((int)fNumActivePages)-1; pageIdx >= 0; --pageIdx) {
Plot* currentPlot = fPages[pageIdx].fPlotList.tail();
if (currentPlot->lastUseToken() != target->tokenTracker()->nextDrawToken()) {
plot = currentPlot;
@@ -565,8 +565,8 @@ inline void GrDrawOpAtlas::deactivateLastPage() {
int numPlotsY = fTextureHeight/fPlotHeight;
fPages[lastPageIndex].fPlotList.reset();
- for (int y = numPlotsY - 1, r = 0; y >= 0; --y, ++r) {
- for (int x = numPlotsX - 1, c = 0; x >= 0; --x, ++c) {
+ for (int r = 0; r < numPlotsY; ++r) {
+ for (int c = 0; c < numPlotsX; ++c) {
uint32_t plotIndex = r * numPlotsX + c;
Plot* currPlot = fPages[lastPageIndex].fPlotArray[plotIndex].get();