Line data Source code
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/. */
5 :
6 : #ifndef mozilla_image_SVGDrawingParameters_h
7 : #define mozilla_image_SVGDrawingParameters_h
8 :
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 "nsSize.h"
16 : #include "SVGImageContext.h"
17 :
18 : namespace mozilla {
19 : namespace image {
20 :
21 : struct SVGDrawingParameters
22 : {
23 : typedef mozilla::gfx::IntSize IntSize;
24 : typedef mozilla::gfx::SamplingFilter SamplingFilter;
25 :
26 73 : SVGDrawingParameters(gfxContext* aContext,
27 : const nsIntSize& aSize,
28 : const ImageRegion& aRegion,
29 : SamplingFilter aSamplingFilter,
30 : const Maybe<SVGImageContext>& aSVGContext,
31 : float aAnimationTime,
32 : uint32_t aFlags,
33 : float aOpacity)
34 73 : : context(aContext)
35 146 : , size(aSize.width, aSize.height)
36 : , region(aRegion)
37 : , samplingFilter(aSamplingFilter)
38 : , svgContext(aSVGContext)
39 : , viewportSize(aSize)
40 : , animationTime(aAnimationTime)
41 : , flags(aFlags)
42 219 : , opacity(aOpacity)
43 : {
44 73 : if (aSVGContext) {
45 146 : auto sz = aSVGContext->GetViewportSize();
46 73 : if (sz) {
47 20 : viewportSize = nsIntSize(sz->width, sz->height); // XXX losing unit
48 : }
49 : }
50 73 : }
51 :
52 : gfxContext* context;
53 : IntSize size;
54 : ImageRegion region;
55 : SamplingFilter samplingFilter;
56 : const Maybe<SVGImageContext>& svgContext;
57 : nsIntSize viewportSize;
58 : float animationTime;
59 : uint32_t flags;
60 : gfxFloat opacity;
61 : };
62 :
63 : } // namespace image
64 : } // namespace mozilla
65 :
66 : #endif // mozilla_image_SVGDrawingParameters_h
67 :
|