AnimationParams.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #ifndef mozilla_image_AnimationParams_h
  7. #define mozilla_image_AnimationParams_h
  8. #include <stdint.h>
  9. #include "mozilla/gfx/Rect.h"
  10. #include "FrameTimeout.h"
  11. namespace mozilla {
  12. namespace image {
  13. enum class BlendMethod : int8_t {
  14. // All color components of the frame, including alpha, overwrite the current
  15. // contents of the frame's output buffer region.
  16. SOURCE,
  17. // The frame should be composited onto the output buffer based on its alpha,
  18. // using a simple OVER operation.
  19. OVER
  20. };
  21. enum class DisposalMethod : int8_t {
  22. CLEAR_ALL = -1, // Clear the whole image, revealing what's underneath.
  23. NOT_SPECIFIED, // Leave the frame and let the new frame draw on top.
  24. KEEP, // Leave the frame and let the new frame draw on top.
  25. CLEAR, // Clear the frame's area, revealing what's underneath.
  26. RESTORE_PREVIOUS // Restore the previous (composited) frame.
  27. };
  28. struct AnimationParams
  29. {
  30. gfx::IntRect mBlendRect;
  31. FrameTimeout mTimeout;
  32. uint32_t mFrameNum;
  33. BlendMethod mBlendMethod;
  34. DisposalMethod mDisposalMethod;
  35. };
  36. } // namespace image
  37. } // namespace mozilla
  38. #endif // mozilla_image_AnimationParams_h