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"
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"
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
)
34 samplingFilter(aSamplingFilter
),
35 svgContext(aSVGContext
),
36 viewportSize(aRasterSize
),
37 animationTime(aAnimationTime
),
40 if (auto sz
= aSVGContext
.GetViewportSize()) {
41 viewportSize
= nsIntSize(sz
->width
, sz
->height
); // XXX losing unit
46 IntSize size
; // Size to rasterize a surface at.
47 IntSize drawSize
; // Size to draw the given surface at.
49 SamplingFilter samplingFilter
;
50 const SVGImageContext
& svgContext
;
51 nsIntSize viewportSize
;
58 } // namespace mozilla
60 #endif // mozilla_image_SVGDrawingParameters_h