Bug 1835529 [wpt PR 40276] - Update wpt metadata, a=testonly
[gecko.git] / image / SVGDrawingParameters.h
blobfa9816213940bf8f7bcf8b5149c7fc06827ad278
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/. */
6 #ifndef mozilla_image_SVGDrawingParameters_h
7 #define mozilla_image_SVGDrawingParameters_h
9 #include "gfxContext.h"
10 #include "gfxTypes.h"
11 #include "ImageRegion.h"
12 #include "mozilla/gfx/Point.h"
13 #include "mozilla/gfx/Types.h"
14 #include "mozilla/Maybe.h"
15 #include "mozilla/SVGImageContext.h"
16 #include "nsSize.h"
18 namespace mozilla {
19 namespace image {
21 struct SVGDrawingParameters {
22 typedef mozilla::gfx::IntSize IntSize;
23 typedef mozilla::gfx::SamplingFilter SamplingFilter;
25 SVGDrawingParameters(gfxContext* aContext, const nsIntSize& aRasterSize,
26 const nsIntSize& aDrawSize, const ImageRegion& aRegion,
27 SamplingFilter aSamplingFilter,
28 const SVGImageContext& aSVGContext, float aAnimationTime,
29 uint32_t aFlags, float aOpacity)
30 : context(aContext),
31 size(aRasterSize),
32 drawSize(aDrawSize),
33 region(aRegion),
34 samplingFilter(aSamplingFilter),
35 svgContext(aSVGContext),
36 viewportSize(aRasterSize),
37 animationTime(aAnimationTime),
38 flags(aFlags),
39 opacity(aOpacity) {
40 if (auto sz = aSVGContext.GetViewportSize()) {
41 viewportSize = nsIntSize(sz->width, sz->height); // XXX losing unit
45 gfxContext* context;
46 IntSize size; // Size to rasterize a surface at.
47 IntSize drawSize; // Size to draw the given surface at.
48 ImageRegion region;
49 SamplingFilter samplingFilter;
50 const SVGImageContext& svgContext;
51 nsIntSize viewportSize;
52 float animationTime;
53 uint32_t flags;
54 gfxFloat opacity;
57 } // namespace image
58 } // namespace mozilla
60 #endif // mozilla_image_SVGDrawingParameters_h