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

Unified Diff: src/codec/SkGifInterlaceIter.cpp

Issue 1315583003: Interlaced gifs without the iterator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 5 years, 4 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 | « src/codec/SkGifInterlaceIter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkGifInterlaceIter.cpp
diff --git a/src/codec/SkGifInterlaceIter.cpp b/src/codec/SkGifInterlaceIter.cpp
deleted file mode 100644
index 3a87f6950d69fc176736ce804b9d3f9b056418a5..0000000000000000000000000000000000000000
--- a/src/codec/SkGifInterlaceIter.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2015 The Android Open Source Project
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkGifInterlaceIter.h"
-
-static const uint8_t kStartingInterlaceYValues[] = { 0, 4, 2, 1 };
-static const uint8_t kDeltaInterlaceYValues[] = { 8, 8, 4, 2 };
-
-SkGifInterlaceIter::SkGifInterlaceIter(int height) : fHeight(height) {
- fStartYPtr = kStartingInterlaceYValues;
- fDeltaYPtr = kDeltaInterlaceYValues;
-
- fCurrY = *fStartYPtr++;
- fDeltaY = *fDeltaYPtr++;
-}
-
-void SkGifInterlaceIter::prepareY() {
- int32_t y = fCurrY + fDeltaY;
-
- // Iterate through fStartYPtr until a valid row is found.
- // This ensures that we do not move past the height of the small images.
- while (y >= fHeight) {
- if (kStartingInterlaceYValues +
- SK_ARRAY_COUNT(kStartingInterlaceYValues) == fStartYPtr) {
- // Now we have iterated over the entire image. Forbid any
- // subsequent calls to nextY().
- SkDEBUGCODE(fStartYPtr = nullptr;)
- SkDEBUGCODE(fDeltaYPtr = nullptr;)
- y = 0;
- } else {
- y = *fStartYPtr++;
- fDeltaY = *fDeltaYPtr++;
- }
- }
- fCurrY = y;
-}
-
-int32_t SkGifInterlaceIter::nextY() {
- SkASSERT(fStartYPtr);
- SkASSERT(fDeltaYPtr);
- int32_t y = fCurrY;
- prepareY();
- return y;
-}
« no previous file with comments | « src/codec/SkGifInterlaceIter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698