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
11 #include "mozilla/gfx/Rect.h"
12 #include "FrameTimeout.h"
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.
22 // The frame should be composited onto the output buffer based on its alpha,
23 // using a simple OVER operation.
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
),
42 mBlendMethod(aBlendMethod
),
43 mDisposalMethod(aDisposalMethod
) {}
45 gfx::IntRect mBlendRect
;
46 FrameTimeout mTimeout
;
48 BlendMethod mBlendMethod
;
49 DisposalMethod mDisposalMethod
;
53 } // namespace mozilla
55 #endif // mozilla_image_AnimationParams_h