Backed out changeset cfe0bbc666b8 (bug 1784757) in order to wait some more for a...
[gecko.git] / image / AnimationParams.h
blob1e20eea04a95dfdd6f8349654818f74e1ce47afe
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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/. */
7 #ifndef mozilla_image_AnimationParams_h
8 #define mozilla_image_AnimationParams_h
10 #include <stdint.h>
11 #include "mozilla/gfx/Rect.h"
12 #include "FrameTimeout.h"
14 namespace mozilla {
15 namespace image {
17 enum class BlendMethod : int8_t {
18 // All color components of the frame, including alpha, overwrite the current
19 // contents of the frame's output buffer region.
20 SOURCE,
22 // The frame should be composited onto the output buffer based on its alpha,
23 // using a simple OVER operation.
24 OVER
27 enum class DisposalMethod : int8_t {
28 CLEAR_ALL = -1, // Clear the whole image, revealing what's underneath.
29 NOT_SPECIFIED, // Leave the frame and let the new frame draw on top.
30 KEEP, // Leave the frame and let the new frame draw on top.
31 CLEAR, // Clear the frame's area, revealing what's underneath.
32 RESTORE_PREVIOUS // Restore the previous (composited) frame.
35 struct AnimationParams {
36 AnimationParams(const gfx::IntRect& aBlendRect, const FrameTimeout& aTimeout,
37 uint32_t aFrameNum, BlendMethod aBlendMethod,
38 DisposalMethod aDisposalMethod)
39 : mBlendRect(aBlendRect),
40 mTimeout(aTimeout),
41 mFrameNum(aFrameNum),
42 mBlendMethod(aBlendMethod),
43 mDisposalMethod(aDisposalMethod) {}
45 gfx::IntRect mBlendRect;
46 FrameTimeout mTimeout;
47 uint32_t mFrameNum;
48 BlendMethod mBlendMethod;
49 DisposalMethod mDisposalMethod;
52 } // namespace image
53 } // namespace mozilla
55 #endif // mozilla_image_AnimationParams_h