Simplify subset computation in SkGifImageReader
authorLeon Scroggins III <scroggo@google.com>
Fri, 7 Apr 2017 14:20:53 +0000 (10:20 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 7 Apr 2017 15:04:33 +0000 (15:04 +0000)
If xOffset or yOffset was not zero, these computations would not
be evaluated anyway, so no need to add zero for these comparisons.

(Split off from CL 9810)

Change-Id: I8481eb257d96766696945cef4eafaff4281fb7d9
Reviewed-on: https://skia-review.googlesource.com/11782
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>

third_party/gif/SkGifImageReader.cpp

index f617ccd..f8a454a 100644 (file)
@@ -760,8 +760,8 @@ bool SkGifImageReader::parse(SkGifImageReader::SkGIFParseQuery query)
                     m_firstFrameSupportsIndex8 = true;
                 } else {
                     const bool frameIsSubset = xOffset > 0 || yOffset > 0
-                            || xOffset + width < m_screenWidth
-                            || yOffset + height < m_screenHeight;
+                            || width < m_screenWidth
+                            || height < m_screenHeight;
                     m_firstFrameHasAlpha = frameIsSubset;
                     m_firstFrameSupportsIndex8 = !frameIsSubset;
                 }