mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
a988f766e4
- Bug 1157984 - Part 1: Extend gfx::2d classes to support both float and double precision,r=jrmuizel (d8d0cadcb0) - Bug 1157984 - Part 2: Implement double precision clipping functions in Matrix4x4,r=vlad (f31c243a9d) - Bug 1157984 - Part 3: Correct bounding box transformations to support projections and correct clipping when transforming behind the camera,r=vlad (c9c678905b) - Bug 1157984 - Part 4: Remove gfxRect::TransformBounds,r=vlad (71d076d48b) - Bug 1157984 - Part 5: Test,r=vlad (1c9c711745) - Bug 1159985 - In APZ gtests, allow panning in both directions. r=kats (b4a42c580a) - Bug 1166871 - Add a test. r=botond (b08332347f) - Bug 1159985 - Gtest. r=kats (ad41b809ff) - Bug 1169695 - Make the test timestamp privately held by the MockContentControllerDelayed. r=botond (4f898a778c) - Bug 1169695 - Advance the stored time when sampling the transform for a future frame. r=botond (77d029383e) - Bug 1169695 - Store task run-at times in the task queue. r=botond (4bc228d713) - Bug 1171312 - Add generic tree search algorithms for layers-related data structures. r=botond (675806f3e1) - Bug 1200063 - Make APZCTreeManager the place where GetFrameTime() can be overridden. r=kats (32ba198192) - Bug 1200063 - Share a paint throttler between APZCs in the same layers id. r=kats (a2147d25e6) - Bug 1200063 - Add a generic implementation of nsITimerCallback that's usable with a lambda or other function object. r=kats (6d7ef71d44) - Bug 1200063 - Make sure TaskThrottler sends its pending repaint request eventually, even if it never receives a notification from the previous request. r=kats (6eceede1e2) - Bug 1200063 - Rename MakeAPZCInstance to NewAPZCInstance for consistency. r=kats (6927e90644) - Bug 1144374 - Fix APZ code to deal with layers getting moved to another LayerManager. r=botond (eb682a58cd) - Bug 1193930 - Allow the user to start a pinch while an overscroll animation is still in progress. r=kats (44c2e57123) - Bug 1169690 - Gtests. r=kats (3c206d1cb2) - Bug 1201098 - Consume fling and overscroll velocity per-axis. r=botond (1e05677586) - Bug 1158424 - Clean up uses of HasNoParentWithSameLayersId() in overscroll handoff chain building. r=kats (0ed1ddee59) - Bug 1201277 - Replace functors with lambdas in APZCTreeManager. r=botond (ec5476a598) - Bug 1180030 - Request a fling snap when an overscroll animation completes. r=kats (e789a2ebb3) - Bug 1159985 - If only one component of a fling is in overscroll, continue the fling in the other component. r=kats (81998d723f) - Bug 1031443 - Allow panning in the pinching state even if zooming is disabled;r=botond (4c90350cc6) - Fix APZ not starting and updating wheel animations within an APZC lock. (bug 1152011 part 1, r=botond) (ae0d4d0aa8) - Bug 1145089 - Update documentation for nsEventStatus_eConsumeNoDefault. r=botond (7ca605ad96) - bug 1170988 - Fix skia to build for iOS. r=gw280 (fb375def29) - bug 1171642 - Disable some skia arm assembly for iOS. r=gw280 (004245c173) - fix build on gcc 11 (1c511ac81b) - missing bit of Bug 1188462 - Rename gfx/skia/trunk directory to gfx/skia/skia. (ca8f138b28) - Bug 1180030 - Do not request a fling snap if the fling will overscroll on its first sample. r=kats (55f89d55b5) - Bug 1167721 - Ensure we trigger a repaint when dropping velocity to zero in CancelAnimation. r=botond (d04fbb2a50) - Bug 1158340 - Refactor RedistributeDisplayPortExcess. r=kats (27725c3ee4) - Bug 1189565 - Only factor in the async zoom change. r=kats (57e357a038) - Bug 1192466 - Prune header includes for SkiaGLGlue.h - r=bgirard (37d31a1238) - Bug 1004489 - propagate Cairo font AA settings to Skia font. r=gw280 (9adc439b19) - Bug 1171528 - Remove overflowed nscoord_MAX warnings from nsRect. r=dholbert (08599b00e9) - Bug 1202430 - remove NS_GFX and related macros; r=jrmuizel (cb0b79951e) - Bug 1181317 - Switch drawing order of filter feBlend inputs. r=mstange (4914444219) - Bug 1180379. Split out GMAX4500 and block those devices from D2D. r=Bas (c8d1a755ea) - Bug 1073117 - Theme issues with GTK 3.14 - fix gtk button and entry size, r=karlt (0df9ac5c7f) - Bug 1187237 - Correct range slider drawing on GTK3. r=karlt (0d671487da) - Bug 1171696 - Require room for scrollbar sliders and draw troughs only when there is room for a slider or buttons on GTK. r=karlt (71710baeaa) - Bug 1202317. Optimize away identity ColorMatrix nodes. r=mstange (6c57a71e0c) - Bug 1202317. Support PodEqual over fixed-length arrays. r=Waldo (060f20b429) - Bug 1203078 - whitelist gdk-pixbuf image formats. r=dan (5eb43e4235) - Bug 1202317. Optimize feComposite type="arithmetic" with all-zero k values to transparent black. r=mstange (47b2d40678) - Bug 1189443 - Don't round down the margin amounts when inflating the displayport. r=dvander (4afcf087ab) - Bug 1205741 - add xpm and svg to supported gdk-pixbuf formats. r=acomminos,dveditz (4c356c961a) - Bug 1166741 - Workaround for GTK3 bug where file choosers' delegate refcount is not incremented. r=karlt (9d59be7b05) - Bug 1166741 followup: Guard GTK file-picker member-var decl/init statements with same #ifdef that its usages are guarded with, to avoid -Wunused-private-field warning. r=karlt (25bbf34486) - fix build on 10.5/10.6 (9acd104c9f) - namespaces (358de9591c) - Bug 1178842 - Fix unified build for nsDisplayList.cpp when a new file is added to layout/base. r=mstange (aa8ff77615)
229 lines
7.9 KiB
C++
229 lines
7.9 KiB
C++
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef MOZILLA_GFX_POINT_H_
|
|
#define MOZILLA_GFX_POINT_H_
|
|
|
|
#include "mozilla/Attributes.h"
|
|
#include "Types.h"
|
|
#include "Coord.h"
|
|
#include "BaseCoord.h"
|
|
#include "BasePoint.h"
|
|
#include "BasePoint3D.h"
|
|
#include "BasePoint4D.h"
|
|
#include "BaseSize.h"
|
|
#include "mozilla/TypeTraits.h"
|
|
|
|
#include <cmath>
|
|
|
|
namespace mozilla {
|
|
|
|
template <typename> struct IsPixel;
|
|
|
|
namespace gfx {
|
|
|
|
// This should only be used by the typedefs below.
|
|
struct UnknownUnits {};
|
|
|
|
} // namespace gfx
|
|
|
|
template<> struct IsPixel<gfx::UnknownUnits> : TrueType {};
|
|
|
|
namespace gfx {
|
|
|
|
template<class units>
|
|
struct IntPointTyped :
|
|
public BasePoint< int32_t, IntPointTyped<units>, IntCoordTyped<units> >,
|
|
public units {
|
|
static_assert(IsPixel<units>::value,
|
|
"'units' must be a coordinate system tag");
|
|
|
|
typedef IntCoordTyped<units> Coord;
|
|
typedef BasePoint< int32_t, IntPointTyped<units>, IntCoordTyped<units> > Super;
|
|
|
|
MOZ_CONSTEXPR IntPointTyped() : Super() {}
|
|
MOZ_CONSTEXPR IntPointTyped(int32_t aX, int32_t aY) : Super(Coord(aX), Coord(aY)) {}
|
|
// The mixed-type constructors (int, Coord) and (Coord, int) are needed to
|
|
// avoid ambiguities because Coord is implicitly convertible to int.
|
|
MOZ_CONSTEXPR IntPointTyped(int32_t aX, Coord aY) : Super(Coord(aX), aY) {}
|
|
MOZ_CONSTEXPR IntPointTyped(Coord aX, int32_t aY) : Super(aX, Coord(aY)) {}
|
|
MOZ_CONSTEXPR IntPointTyped(Coord aX, Coord aY) : Super(aX, aY) {}
|
|
|
|
// XXX When all of the code is ported, the following functions to convert to and from
|
|
// unknown types should be removed.
|
|
|
|
static IntPointTyped<units> FromUnknownPoint(const IntPointTyped<UnknownUnits>& aPoint) {
|
|
return IntPointTyped<units>(aPoint.x, aPoint.y);
|
|
}
|
|
|
|
IntPointTyped<UnknownUnits> ToUnknownPoint() const {
|
|
return IntPointTyped<UnknownUnits>(this->x, this->y);
|
|
}
|
|
};
|
|
typedef IntPointTyped<UnknownUnits> IntPoint;
|
|
|
|
template<class units, class F = Float>
|
|
struct PointTyped :
|
|
public BasePoint< F, PointTyped<units, F>, CoordTyped<units, F> >,
|
|
public units {
|
|
static_assert(IsPixel<units>::value,
|
|
"'units' must be a coordinate system tag");
|
|
|
|
typedef CoordTyped<units, F> Coord;
|
|
typedef BasePoint< F, PointTyped<units, F>, CoordTyped<units, F> > Super;
|
|
|
|
MOZ_CONSTEXPR PointTyped() : Super() {}
|
|
MOZ_CONSTEXPR PointTyped(F aX, F aY) : Super(Coord(aX), Coord(aY)) {}
|
|
// The mixed-type constructors (Float, Coord) and (Coord, Float) are needed to
|
|
// avoid ambiguities because Coord is implicitly convertible to Float.
|
|
MOZ_CONSTEXPR PointTyped(F aX, Coord aY) : Super(Coord(aX), aY) {}
|
|
MOZ_CONSTEXPR PointTyped(Coord aX, F aY) : Super(aX, Coord(aY)) {}
|
|
MOZ_CONSTEXPR PointTyped(Coord aX, Coord aY) : Super(aX.value, aY.value) {}
|
|
MOZ_CONSTEXPR MOZ_IMPLICIT PointTyped(const IntPointTyped<units>& point) : Super(F(point.x), F(point.y)) {}
|
|
|
|
// XXX When all of the code is ported, the following functions to convert to and from
|
|
// unknown types should be removed.
|
|
|
|
static PointTyped<units, F> FromUnknownPoint(const PointTyped<UnknownUnits, F>& aPoint) {
|
|
return PointTyped<units, F>(aPoint.x, aPoint.y);
|
|
}
|
|
|
|
PointTyped<UnknownUnits, F> ToUnknownPoint() const {
|
|
return PointTyped<UnknownUnits, F>(this->x, this->y);
|
|
}
|
|
};
|
|
typedef PointTyped<UnknownUnits> Point;
|
|
typedef PointTyped<UnknownUnits, double> PointDouble;
|
|
|
|
template<class units>
|
|
IntPointTyped<units> RoundedToInt(const PointTyped<units>& aPoint) {
|
|
return IntPointTyped<units>(int32_t(floorf(aPoint.x + 0.5f)),
|
|
int32_t(floorf(aPoint.y + 0.5f)));
|
|
}
|
|
|
|
template<class units>
|
|
IntPointTyped<units> TruncatedToInt(const PointTyped<units>& aPoint) {
|
|
return IntPointTyped<units>(int32_t(aPoint.x),
|
|
int32_t(aPoint.y));
|
|
}
|
|
|
|
template<class units, class F = Float>
|
|
struct Point3DTyped :
|
|
public BasePoint3D< F, Point3DTyped<units, F> > {
|
|
static_assert(IsPixel<units>::value,
|
|
"'units' must be a coordinate system tag");
|
|
|
|
typedef BasePoint3D< F, Point3DTyped<units, F> > Super;
|
|
|
|
Point3DTyped() : Super() {}
|
|
Point3DTyped(F aX, F aY, F aZ) : Super(aX, aY, aZ) {}
|
|
|
|
// XXX When all of the code is ported, the following functions to convert to and from
|
|
// unknown types should be removed.
|
|
|
|
static Point3DTyped<units, F> FromUnknownPoint(const Point3DTyped<UnknownUnits, F>& aPoint) {
|
|
return Point3DTyped<units, F>(aPoint.x, aPoint.y, aPoint.z);
|
|
}
|
|
|
|
Point3DTyped<UnknownUnits, F> ToUnknownPoint() const {
|
|
return Point3DTyped<UnknownUnits, F>(this->x, this->y, this->z);
|
|
}
|
|
};
|
|
typedef Point3DTyped<UnknownUnits> Point3D;
|
|
typedef Point3DTyped<UnknownUnits, double> PointDouble3D;
|
|
|
|
template<class units, class F = Float>
|
|
struct Point4DTyped :
|
|
public BasePoint4D< F, Point4DTyped<units, F> > {
|
|
static_assert(IsPixel<units>::value,
|
|
"'units' must be a coordinate system tag");
|
|
|
|
typedef BasePoint4D< F, Point4DTyped<units, F> > Super;
|
|
|
|
Point4DTyped() : Super() {}
|
|
Point4DTyped(F aX, F aY, F aZ, F aW) : Super(aX, aY, aZ, aW) {}
|
|
|
|
// XXX When all of the code is ported, the following functions to convert to and from
|
|
// unknown types should be removed.
|
|
|
|
static Point4DTyped<units, F> FromUnknownPoint(const Point4DTyped<UnknownUnits, F>& aPoint) {
|
|
return Point4DTyped<units, F>(aPoint.x, aPoint.y, aPoint.z, aPoint.w);
|
|
}
|
|
|
|
Point4DTyped<UnknownUnits, F> ToUnknownPoint() const {
|
|
return Point4DTyped<UnknownUnits, F>(this->x, this->y, this->z, this->w);
|
|
}
|
|
|
|
PointTyped<units, F> As2DPoint() {
|
|
return PointTyped<units, F>(this->x / this->w, this->y / this->w);
|
|
}
|
|
};
|
|
typedef Point4DTyped<UnknownUnits> Point4D;
|
|
typedef Point4DTyped<UnknownUnits, double> PointDouble4D;
|
|
|
|
template<class units>
|
|
struct IntSizeTyped :
|
|
public BaseSize< int32_t, IntSizeTyped<units> >,
|
|
public units {
|
|
static_assert(IsPixel<units>::value,
|
|
"'units' must be a coordinate system tag");
|
|
|
|
typedef BaseSize< int32_t, IntSizeTyped<units> > Super;
|
|
|
|
MOZ_CONSTEXPR IntSizeTyped() : Super() {}
|
|
MOZ_CONSTEXPR IntSizeTyped(int32_t aWidth, int32_t aHeight) : Super(aWidth, aHeight) {}
|
|
|
|
// XXX When all of the code is ported, the following functions to convert to and from
|
|
// unknown types should be removed.
|
|
|
|
static IntSizeTyped<units> FromUnknownSize(const IntSizeTyped<UnknownUnits>& aSize) {
|
|
return IntSizeTyped<units>(aSize.width, aSize.height);
|
|
}
|
|
|
|
IntSizeTyped<UnknownUnits> ToUnknownSize() const {
|
|
return IntSizeTyped<UnknownUnits>(this->width, this->height);
|
|
}
|
|
};
|
|
typedef IntSizeTyped<UnknownUnits> IntSize;
|
|
|
|
template<class units, class F = Float>
|
|
struct SizeTyped :
|
|
public BaseSize< F, SizeTyped<units> >,
|
|
public units {
|
|
static_assert(IsPixel<units>::value,
|
|
"'units' must be a coordinate system tag");
|
|
|
|
typedef BaseSize< F, SizeTyped<units, F> > Super;
|
|
|
|
MOZ_CONSTEXPR SizeTyped() : Super() {}
|
|
MOZ_CONSTEXPR SizeTyped(F aWidth, F aHeight) : Super(aWidth, aHeight) {}
|
|
explicit SizeTyped(const IntSizeTyped<units>& size) :
|
|
Super(F(size.width), F(size.height)) {}
|
|
|
|
// XXX When all of the code is ported, the following functions to convert to and from
|
|
// unknown types should be removed.
|
|
|
|
static SizeTyped<units, F> FromUnknownSize(const SizeTyped<UnknownUnits, F>& aSize) {
|
|
return SizeTyped<units, F>(aSize.width, aSize.height);
|
|
}
|
|
|
|
SizeTyped<UnknownUnits, F> ToUnknownSize() const {
|
|
return SizeTyped<UnknownUnits, F>(this->width, this->height);
|
|
}
|
|
};
|
|
typedef SizeTyped<UnknownUnits> Size;
|
|
typedef SizeTyped<UnknownUnits, double> SizeDouble;
|
|
|
|
template<class units>
|
|
IntSizeTyped<units> RoundedToInt(const SizeTyped<units>& aSize) {
|
|
return IntSizeTyped<units>(int32_t(floorf(aSize.width + 0.5f)),
|
|
int32_t(floorf(aSize.height + 0.5f)));
|
|
}
|
|
|
|
} // namespace gfx
|
|
} // namespace mozilla
|
|
|
|
#endif /* MOZILLA_GFX_POINT_H_ */
|