DecoderFlags.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_image_DecoderFlags_h
  6. #define mozilla_image_DecoderFlags_h
  7. #include "mozilla/TypedEnumBits.h"
  8. namespace mozilla {
  9. namespace image {
  10. /**
  11. * Flags that influence decoder behavior. Note that these flags *don't*
  12. * influence the logical content of the surfaces that the decoder generates, so
  13. * they're not in a factor in SurfaceCache lookups and the like. These flags
  14. * instead either influence which surfaces are generated at all or the tune the
  15. * decoder's behavior for a particular scenario.
  16. */
  17. enum class DecoderFlags : uint8_t
  18. {
  19. FIRST_FRAME_ONLY = 1 << 0,
  20. IS_REDECODE = 1 << 1,
  21. IMAGE_IS_TRANSIENT = 1 << 2,
  22. ASYNC_NOTIFY = 1 << 3
  23. };
  24. MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(DecoderFlags)
  25. /**
  26. * @return the default set of decode flags.
  27. */
  28. inline DecoderFlags
  29. DefaultDecoderFlags()
  30. {
  31. return DecoderFlags();
  32. }
  33. } // namespace image
  34. } // namespace mozilla
  35. #endif // mozilla_image_DecoderFlags_h