SVGDrawingParameters.h (1940B)
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/SVGImageContext.h" 15 #include "nsSize.h" 16 17 namespace mozilla { 18 namespace image { 19 20 struct SVGDrawingParameters { 21 typedef mozilla::gfx::IntSize IntSize; 22 typedef mozilla::gfx::SamplingFilter SamplingFilter; 23 24 SVGDrawingParameters(gfxContext* aContext, const nsIntSize& aRasterSize, 25 const nsIntSize& aDrawSize, const ImageRegion& aRegion, 26 SamplingFilter aSamplingFilter, 27 const SVGImageContext& aSVGContext, float aAnimationTime, 28 uint32_t aFlags, float aOpacity) 29 : context(aContext), 30 size(aRasterSize), 31 drawSize(aDrawSize), 32 region(aRegion), 33 samplingFilter(aSamplingFilter), 34 svgContext(aSVGContext), 35 viewportSize(aRasterSize), 36 animationTime(aAnimationTime), 37 flags(aFlags), 38 opacity(aOpacity) { 39 if (auto sz = aSVGContext.GetViewportSize()) { 40 viewportSize = nsIntSize(sz->width, sz->height); // XXX losing unit 41 } 42 } 43 44 gfxContext* context; 45 IntSize size; // Size to rasterize a surface at. 46 IntSize drawSize; // Size to draw the given surface at. 47 ImageRegion region; 48 SamplingFilter samplingFilter; 49 const SVGImageContext& svgContext; 50 nsIntSize viewportSize; 51 float animationTime; 52 uint32_t flags; 53 gfxFloat opacity; 54 }; 55 56 } // namespace image 57 } // namespace mozilla 58 59 #endif // mozilla_image_SVGDrawingParameters_h