Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | /** @file |
michael@0 | 8 | * An enumeration used by RasterImage and Decoder to specify which 'strategy' to |
michael@0 | 9 | * use for image decoding - synchronous or asynchronous. |
michael@0 | 10 | */ |
michael@0 | 11 | |
michael@0 | 12 | #ifndef mozilla_imagelib_DecodeStrategy_h_ |
michael@0 | 13 | #define mozilla_imagelib_DecodeStrategy_h_ |
michael@0 | 14 | |
michael@0 | 15 | namespace mozilla { |
michael@0 | 16 | namespace image { |
michael@0 | 17 | |
michael@0 | 18 | enum DecodeStrategy { |
michael@0 | 19 | // DECODE_SYNC requests a synchronous decode, which will continue decoding |
michael@0 | 20 | // frames as long as it has more source data. It returns to the caller only |
michael@0 | 21 | // once decoding is complete (or until it needs more source data before |
michael@0 | 22 | // continuing). Because DECODE_SYNC can involve allocating new imgFrames, it |
michael@0 | 23 | // can only be run on the main thread. |
michael@0 | 24 | DECODE_SYNC, |
michael@0 | 25 | |
michael@0 | 26 | // DECODE_ASYNC requests an asynchronous decode, which will continue decoding |
michael@0 | 27 | // until it either finishes a frame or runs out of source data. Because |
michael@0 | 28 | // DECODE_ASYNC does not allocate new imgFrames, it can be safely run off the |
michael@0 | 29 | // main thread. (And hence workers in the decode pool always use it.) |
michael@0 | 30 | DECODE_ASYNC |
michael@0 | 31 | }; |
michael@0 | 32 | |
michael@0 | 33 | } // namespace image |
michael@0 | 34 | } // namespace mozilla |
michael@0 | 35 | |
michael@0 | 36 | #endif |