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

Side by Side Diff: third_party/gif/SkGifImageReader.h

Issue 2447863002: Report repetition count in SkCodec (Closed)
Patch Set: Return a bool, with multiple out parameters Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK ***** 2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * 4 *
5 * The contents of this file are subject to the Mozilla Public License Version 5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with 6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at 7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/ 8 * http://www.mozilla.org/MPL/
9 * 9 *
10 * Software distributed under the License is distributed on an "AS IS" basis, 10 * Software distributed under the License is distributed on an "AS IS" basis,
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 class SkGifImageReader final : public SkNoncopyable { 277 class SkGifImageReader final : public SkNoncopyable {
278 public: 278 public:
279 // This takes ownership of stream. 279 // This takes ownership of stream.
280 SkGifImageReader(SkStream* stream) 280 SkGifImageReader(SkStream* stream)
281 : m_client(nullptr) 281 : m_client(nullptr)
282 , m_state(SkGIFType) 282 , m_state(SkGIFType)
283 , m_bytesToConsume(6) // Number of bytes for GIF type, either "GIF87a" o r "GIF89a". 283 , m_bytesToConsume(6) // Number of bytes for GIF type, either "GIF87a" o r "GIF89a".
284 , m_version(0) 284 , m_version(0)
285 , m_screenWidth(0) 285 , m_screenWidth(0)
286 , m_screenHeight(0) 286 , m_screenHeight(0)
287 , m_loopCount(cLoopCountNotSeen) 287 , m_loopCount(0)
288 , m_streamBuffer(stream) 288 , m_streamBuffer(stream)
289 , m_parseCompleted(false) 289 , m_parseCompleted(false)
290 , m_firstFrameHasAlpha(false) 290 , m_firstFrameHasAlpha(false)
291 , m_firstFrameSupportsIndex8(false) 291 , m_firstFrameSupportsIndex8(false)
292 { 292 {
293 } 293 }
294 294
295 static constexpr int cLoopCountNotSeen = -2;
296
297 ~SkGifImageReader() 295 ~SkGifImageReader()
298 { 296 {
299 } 297 }
300 298
301 void setClient(SkGifCodec* client) { m_client = client; } 299 void setClient(SkGifCodec* client) { m_client = client; }
302 300
303 unsigned screenWidth() const { return m_screenWidth; } 301 unsigned screenWidth() const { return m_screenWidth; }
304 unsigned screenHeight() const { return m_screenHeight; } 302 unsigned screenHeight() const { return m_screenHeight; }
305 303
306 // Option to pass to parse(). All enums are negative, because a non-negative value is used to 304 // Option to pass to parse(). All enums are negative, because a non-negative value is used to
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 SkStreamBuffer m_streamBuffer; 388 SkStreamBuffer m_streamBuffer;
391 bool m_parseCompleted; 389 bool m_parseCompleted;
392 390
393 // These values can be computed before we create a SkGIFFrameContext, so we 391 // These values can be computed before we create a SkGIFFrameContext, so we
394 // store them here instead of on m_frames[0]. 392 // store them here instead of on m_frames[0].
395 bool m_firstFrameHasAlpha; 393 bool m_firstFrameHasAlpha;
396 bool m_firstFrameSupportsIndex8; 394 bool m_firstFrameSupportsIndex8;
397 }; 395 };
398 396
399 #endif 397 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698