AnimationParams.h (1808B)
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 7 #ifndef mozilla_image_AnimationParams_h 8 #define mozilla_image_AnimationParams_h 9 10 #include <stdint.h> 11 #include "mozilla/gfx/Rect.h" 12 #include "FrameTimeout.h" 13 14 namespace mozilla { 15 namespace image { 16 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, 21 22 // The frame should be composited onto the output buffer based on its alpha, 23 // using a simple OVER operation. 24 OVER 25 }; 26 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. 33 }; 34 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) {} 44 45 gfx::IntRect mBlendRect; 46 FrameTimeout mTimeout; 47 uint32_t mFrameNum; 48 BlendMethod mBlendMethod; 49 DisposalMethod mDisposalMethod; 50 }; 51 52 } // namespace image 53 } // namespace mozilla 54 55 #endif // mozilla_image_AnimationParams_h