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 Maybe
<SVGImageContext
>& aSVGContext
,
29 float aAnimationTime
, uint32_t aFlags
, float aOpacity
)
34 samplingFilter(aSamplingFilter
),
35 svgContext(aSVGContext
),
36 viewportSize(aRasterSize
),
37 animationTime(aAnimationTime
),
41 auto sz
= aSVGContext
->GetViewportSize();
43 viewportSize
= nsIntSize(sz
->width
, sz
->height
); // XXX losing unit
49 IntSize size
; // Size to rasterize a surface at.
50 IntSize drawSize
; // Size to draw the given surface at.
52 SamplingFilter samplingFilter
;
53 const Maybe
<SVGImageContext
>& svgContext
;
54 nsIntSize viewportSize
;
61 } // namespace mozilla
63 #endif // mozilla_image_SVGDrawingParameters_h