Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/layers/DirectionUtils.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef GFX_DIRECTIONUTILS_H
8
#define GFX_DIRECTIONUTILS_H
9
10
#include "LayersTypes.h"  // for ScrollDirection
11
#include "Units.h"        // for Coord, Point, and Rect types
12
13
namespace mozilla {
14
namespace layers {
15
16
template <typename PointOrRect>
17
0
CoordOf<PointOrRect> GetAxisStart(ScrollDirection aDir, const PointOrRect& aValue) {
18
0
  if (aDir == ScrollDirection::eHorizontal) {
19
0
    return aValue.X();
20
0
  } else {
21
0
    return aValue.Y();
22
0
  }
23
0
}
Unexecuted instantiation: mozilla::CoordOfImpl<mozilla::gfx::PointTyped<mozilla::ParentLayerPixel, float> >::Type mozilla::layers::GetAxisStart<mozilla::gfx::PointTyped<mozilla::ParentLayerPixel, float> >(mozilla::layers::ScrollDirection, mozilla::gfx::PointTyped<mozilla::ParentLayerPixel, float> const&)
Unexecuted instantiation: mozilla::CoordOfImpl<mozilla::gfx::PointTyped<mozilla::CSSPixel, float> >::Type mozilla::layers::GetAxisStart<mozilla::gfx::PointTyped<mozilla::CSSPixel, float> >(mozilla::layers::ScrollDirection, mozilla::gfx::PointTyped<mozilla::CSSPixel, float> const&)
Unexecuted instantiation: mozilla::CoordOfImpl<mozilla::gfx::RectTyped<mozilla::CSSPixel, float> >::Type mozilla::layers::GetAxisStart<mozilla::gfx::RectTyped<mozilla::CSSPixel, float> >(mozilla::layers::ScrollDirection, mozilla::gfx::RectTyped<mozilla::CSSPixel, float> const&)
24
25
template <typename Rect>
26
CoordOf<Rect> GetAxisEnd(ScrollDirection aDir, const Rect& aValue) {
27
  if (aDir == ScrollDirection::eHorizontal) {
28
    return aValue.XMost();
29
  } else {
30
    return aValue.YMost();
31
  }
32
}
33
34
template <typename Rect>
35
0
CoordOf<Rect> GetAxisLength(ScrollDirection aDir, const Rect& aValue) {
36
0
  if (aDir == ScrollDirection::eHorizontal) {
37
0
    return aValue.Width();
38
0
  } else {
39
0
    return aValue.Height();
40
0
  }
41
0
}
Unexecuted instantiation: mozilla::CoordOfImpl<mozilla::gfx::RectTyped<mozilla::ParentLayerPixel, float> >::Type mozilla::layers::GetAxisLength<mozilla::gfx::RectTyped<mozilla::ParentLayerPixel, float> >(mozilla::layers::ScrollDirection, mozilla::gfx::RectTyped<mozilla::ParentLayerPixel, float> const&)
Unexecuted instantiation: mozilla::CoordOfImpl<mozilla::gfx::RectTyped<mozilla::CSSPixel, float> >::Type mozilla::layers::GetAxisLength<mozilla::gfx::RectTyped<mozilla::CSSPixel, float> >(mozilla::layers::ScrollDirection, mozilla::gfx::RectTyped<mozilla::CSSPixel, float> const&)
42
43
template <typename FromUnits, typename ToUnits>
44
float GetAxisScale(ScrollDirection aDir, const gfx::ScaleFactors2D<FromUnits, ToUnits>& aValue) {
45
  if (aDir == ScrollDirection::eHorizontal) {
46
    return aValue.xScale;
47
  } else {
48
    return aValue.yScale;
49
  }
50
}
51
52
0
inline ScrollDirection GetPerpendicularDirection(ScrollDirection aDir) {
53
0
  return aDir == ScrollDirection::eHorizontal
54
0
       ? ScrollDirection::eVertical
55
0
       : ScrollDirection::eHorizontal;
56
0
}
57
58
} // namespace layers
59
} // namespace mozilla
60
61
#endif /* GFX_DIRECTIONUTILS_H */