Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/image/SVGDrawingParameters.h
Line
Count
Source (jump to first uncovered line)
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
  SVGDrawingParameters(gfxContext* aContext,
27
                       const nsIntSize& aRasterSize,
28
                       const nsIntSize& aDrawSize,
29
                       const ImageRegion& aRegion,
30
                       SamplingFilter aSamplingFilter,
31
                       const Maybe<SVGImageContext>& aSVGContext,
32
                       float aAnimationTime,
33
                       uint32_t aFlags,
34
                       float aOpacity)
35
    : context(aContext)
36
    , size(aRasterSize)
37
    , drawSize(aDrawSize)
38
    , region(aRegion)
39
    , samplingFilter(aSamplingFilter)
40
    , svgContext(aSVGContext)
41
    , viewportSize(aRasterSize)
42
    , animationTime(aAnimationTime)
43
    , flags(aFlags)
44
    , opacity(aOpacity)
45
0
  {
46
0
    if (aSVGContext) {
47
0
      auto sz = aSVGContext->GetViewportSize();
48
0
      if (sz) {
49
0
        viewportSize = nsIntSize(sz->width, sz->height); // XXX losing unit
50
0
      }
51
0
    }
52
0
  }
53
54
  gfxContext*                   context;
55
  IntSize                       size; // Size to rasterize a surface at.
56
  IntSize                       drawSize; // Size to draw the given surface at.
57
  ImageRegion                   region;
58
  SamplingFilter                samplingFilter;
59
  const Maybe<SVGImageContext>& svgContext;
60
  nsIntSize                     viewportSize;
61
  float                         animationTime;
62
  uint32_t                      flags;
63
  gfxFloat                      opacity;
64
};
65
66
} // namespace image
67
} // namespace mozilla
68
69
#endif // mozilla_image_SVGDrawingParameters_h
70