michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** @file michael@0: * An enumeration used by RasterImage and Decoder to specify which 'strategy' to michael@0: * use for image decoding - synchronous or asynchronous. michael@0: */ michael@0: michael@0: #ifndef mozilla_imagelib_DecodeStrategy_h_ michael@0: #define mozilla_imagelib_DecodeStrategy_h_ michael@0: michael@0: namespace mozilla { michael@0: namespace image { michael@0: michael@0: enum DecodeStrategy { michael@0: // DECODE_SYNC requests a synchronous decode, which will continue decoding michael@0: // frames as long as it has more source data. It returns to the caller only michael@0: // once decoding is complete (or until it needs more source data before michael@0: // continuing). Because DECODE_SYNC can involve allocating new imgFrames, it michael@0: // can only be run on the main thread. michael@0: DECODE_SYNC, michael@0: michael@0: // DECODE_ASYNC requests an asynchronous decode, which will continue decoding michael@0: // until it either finishes a frame or runs out of source data. Because michael@0: // DECODE_ASYNC does not allocate new imgFrames, it can be safely run off the michael@0: // main thread. (And hence workers in the decode pool always use it.) michael@0: DECODE_ASYNC michael@0: }; michael@0: michael@0: } // namespace image michael@0: } // namespace mozilla michael@0: michael@0: #endif