mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
30ff84134a
- Bug 1225486 - don't include mozilla/ToString.h in {BasePoint,nsRegion}.h; r=jrmuizel (33ffb885b7)
- Bug 1069417 - Generalize Matrix4x4 into Matrix4x4Typed<SourceUnits, TargetUnits>. r=Bas (ef50fbb874)
- Bug 1229202 (part 1) - Remove some unused arguments in nsPrintEngine's functions. r=mattwoodrow. (7368283f53)
- Bug 1229202 (part 2) - Remove gfxQuartzSurface::GetCGContextWithClip, which is unused. r=mattwoodrow. (611ebc211e)
- Bug 1229202 (part 3) - Make gfxContextAutoDisableSubpixelAntialiasing take a DrawTarget instead of a gfxContext. r=mattwoodrow. (eac64c2002)
- Bug 1229202 (part 4) - Remove an unused gfxContextAutoSaveRestore. r=mattwoodrow. (050fc5796d)
- Bug 1229202 (part 5) - Remove an unneeded gfxContextAutoSaveRestore. r=mattwoodrow. (966558456b)
- Bug 1229202 (part 6) - Remove two nasty matrix reinterpret_casts. r=mattwoodrow. (c27b247af7)
- Bug 1229202 (part 7) - Pass a DrawTarget to gfxXlibNativeRenderer::DrawDirect(). r=mattwoodrow. (8356148bdb)
- Bug 1187134 (part 1) - Replace nsBaseHashtable::Enumerate() calls in netwerk/cache{,2}/ with iterators. r=valentin. (f7adf5b45f)
- Bug 1187134 (part 2) - Replace nsBaseHashtable::Enumerate() calls in netwerk/cache{,2}/ with iterators. r=valentin. (4af6bd04f0)
- Bug 1187134 (part 3) - Replace nsBaseHashtable::Enumerate() calls in netwerk/cache{,2}/ with iterators. r=valentin. (ad822eefa9)
- Bug 1187134 (part 4) - Replace nsBaseHashtable::Enumerate() calls in netwerk/cache{,2}/ with iterators. r=valentin. (b49e0625b4)
- Bug 1187134 (part 5) - Replace nsBaseHashtable::Enumerate() calls in netwerk/cache{,2}/ with iterators. r=valentin. (cb88e0d11f)
- Bug 1181040 - Always disable sccache when doing PGO builds. r=gps (d5b19682ee)
- Bug 1229613 - Properly disable sccache on PGO builds. r=mshal (930caf31b3)
- Bug 1164921 - part 3 - make more things depend on CONFIG[MOZ_ANDROID_CXX_STL]; r=glandium (e437ffb734)
- Bug 1207288. Ask ANGLE for the correct output version. r=jgilbert (43ab163d70)
- Bug 1219890. Construct context arguments on the stack. r=jgilbert (6bc3b04360)
- Bug 1219890. Use ES3 when appropriate. r=jgilbert (9cd5e81934)
- missing bit of Bug 1200595 - Consolidate the TextureClient's destruction logic. (96d02c0a21)
- Bug 1219890. Make assignment operator and copy constructor default. r=jgilbert (27e886223f)
- Bug 1228182 - Use division directly for generating double in XorShift128PlusRNG. r=Waldo (02b90bfcab)
- Bug 322529 part 1 - Use XorShift128PlusRNG for Math.random(). r=jwalden (bc70756ff6)
- Bug 322529 part 2 - Add xor64 and add64 to macro-assemblers. r=arai (ba54b70a25)
- Bug 322529 part 3 - Fix LRandom JIT code to use the new algorithm. r=arai,jwalden (8ba7676a56)
- Bug 322529 part 4 - Fix setRNGState shell function and math-random.js jit-test. r=arai (462a4779f9)
- Bug 322529 part 5 - Give Windows ExecutableAllocator its own XorShift128+ RNG. r=jwalden (0f96f35586)
- fix warnings (e564ce4515)
- Bug 1197282 - Include <atomic> in VideoDecoder.h. r=cpearce (aeb12e6082)
- Bug 1195939 - Flush decode queue on Reset() in gmp-clearkey - r=cpearce (4dcbde99e0)
- Bug 1186406 - Copy input to ClearKey's decoder, so we can return its containing shmem earlier. r=gerald (d8764fa545)
- Bug 1228461 - Don't assert we must have keys for keyIds we've seen in ~ClearKeySession(). r=gerald (4ddcbe699f)
- Bug 1228461 - Implement keyids initData type for ClearKey. r=gerald (09213c5e5f)
- Bug 1230026 - Support 'webm' initDataType format for MP4 ClearKey initData. r=gerald (b64a9e6a21)
- Bug 1173631 - [EME] Implement async shutdown in clearkey GMP. r=cpearce (366ec9235c)
- Bug 1181436 - Use 'gmp-api/' prefix consistently in includes in gmp-clearkey. r=gerald (eb4f4344c0)
- Bug 1185388 - Limit the number of cores used by WMF in ClearKey CDM -r=cpearce (9014cf6c29)
- Bug 1214469 - Ensure gmp-clearkey accounts for mNumInputTasks when flushing. r=gerald (5c2e691b64)
- Bug 1226430 - Remove alg from ClearKey license parser. r=gerald (43bf12a3b6)
- Bug 1157728: Removed StackArena::Init() and call to it as it is now useless. r=dholbert (fee41513de)
- Bug 1161392 - Enlarge touch area for AccessibleCaret. r=roc (15e9b18206)
- Bug 1207934 - Reset mImaginaryCaretRect if it is out of scrollport. r=roc (3d00572dd8)
- Bug 1225699 part 1 - Add EffectSet class; r=smaug (c4e255a722)
- Bug 1225699 part 2 - Add Add/RemoveEffect to EffectSet; r=smaug (70d1e3ada2)
- Bug 1225699 part 3 - Register and unregister effects with elements; r=smaug, r=heycam (7d6478b017)
- Bug 1225699 part 4 - Add iterator to EffectSet; r=heycam (cf28cff0f4)
- Bug 1225699 part 5 - Use EffectSet in Element::GetAnimations; r=heycam (0fdb687623)
- Bug 1225699 part 6 - Use strong refs to store effects on their target elements; r=smaug (078c58732c)
- Bug 1225699 part 7 - Keep effect properties when the ownerDocument of the element changes; r=smaug (ddd3ab54b1)
- Bug 1226118 part 1 - Add EffectSet::GetEffectSet(const nsIFrame*); r=dholbert (407533395c)
- Bug 1226118 part 2 - Use EffectSet in nsLayoutUtils animation functions; r=dholbert (808525d54b)
- Bug 1226118 part 3 - Use EffectSet in CommonAnimationManager::ClearIsRunningOnCompositor; r=hiro, r=dholbert (e5020bdc23)
- Bug 1226118 part 4 - Use EffectSet in ActiveLayerManager's animated-scale checks; r=dholbert (ef725a9753)
- Bug 1226118 part 5 - Move LogAsyncAnimationFailure to AnimationUtils; r=dholbert (aa2104cd55)
- Bug 1226118 part 6 - Remove no longer used LayerAnimationRecord/Info code from AnimationCommon; r=dholbert (6355d4132e)
- Bug 1226118 part 7 - Rename and rework KeyframeEffectReadOnly::CanAnimatePropertyOnCompositor to ShouldBlockCompositorAnimations; r=hiro (5ae5113f87)
- Bug 1226118 part 8 - Add EffectCompositor::GetAnimationsForCompositor that uses the EffectSet rather than AnimationCollection; r=dholbert (07067af8b8)
- Bug 1226118 part 9 - Use EffectCompositor::GetAnimationsForCompositor in nsDisplayList; r=dholbert (7b857c5030)
- Bug 1226118 part 10 - Use EffectCompositor::GetAnimationsForCompositor in nsLayoutUtils; r=dholbert (af9221073b)
- Bug 1226118 part 11 - Remove CommonAnimationManager::GetAnimationsForCompositor; r=dholbert (02865b2413)
- Bug 1226118 part 12a - Make RestyleManager::GetMaxAnimationGenerationForFrame used frame-based GetAnimationCollection; r=dholbert (34644baa17)
- Bug 1226118 part 12b - Rename CommonAnimationManager::GetAnimations to GetAnimationCollection; r=dholbert (fc391019a2)
- Bug 1226118 part 13 - Move the GetAnimationCollection definitions side-by-side; r=dholbert (8828457ba1)
- Bug 1226118 part 14 - Rewrite GetAnimationCollection(nsIFrame*) in terms of the existing GetAnimationCollection; r=dholbert (d7256f9a5b)
- Bug 1226118 part 15 - Remove no-longer-necessary delays from test_running_on_compositor.html; r=hiro (bd70ec1d14)
- Bug 1183786 - Part 1: Refactor timer setup code into a helper function. r=dholbert (b383718880)
- Bug 1183786 - Part 2: Delay updating after prefs changed if detached. r=tn r=dholbert (90e1564a20)
- Bug 1183786 - Part 3: Make nsPresContext helper-function return already_AddRefed instead of bool+outparam. r=tn (30acf78f3d)
- Bug 1183786 - Part 4: Drop unnecessary '!!' boolification. r=tn (66c94926a6)
- Bug 1168180 - Mark nsPresContext::mShell as MOZ_NON_OWNING_REF. r=dbaron (be86891cd6)
- Bug 1168179 - Mark nsPresContext::mMedium as MOZ_UNSAFE_REF. r=dbaron (2312071a0e)
- Bug 1167402 - Mark nsPresContext::mLinkHandler as MOZ_NON_OWNING_REF. r=dbaron (f6276a7e8f)
- Bug 1167406 - Mark nsRootPresContext::RunWillPaintObservers::mPresContext as MOZ_NON_OWNING_REF. r=dbaron (956aac5b52)
- Bug 1228934 - Remove style, weight, and stretch parameters from nsFont constructor. r=jdaggett (2c0b39d5bf)
- Bug 1215484 - make SVG in an image context ignore author colours to match how we treat raster images, and in a non-image context respect them to match html. f=dao, r=roc (b68056bfc0)
- Bug 1230466. Make sure to update our scrollbar styles when a <body> is removed from the DOM, since we might now need to propagate from some other element. r=roc (165ae94a09)
113 lines
3.0 KiB
C++
113 lines
3.0 KiB
C++
/* -*- Mode: C++; tab-width: 2; 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_BASEPOINT_H_
|
|
#define MOZILLA_GFX_BASEPOINT_H_
|
|
|
|
#include <cmath>
|
|
#include <ostream>
|
|
#include "mozilla/Attributes.h"
|
|
#include "mozilla/FloatingPoint.h"
|
|
#include "mozilla/TypeTraits.h"
|
|
|
|
namespace mozilla {
|
|
namespace gfx {
|
|
|
|
/**
|
|
* Do not use this class directly. Subclass it, pass that subclass as the
|
|
* Sub parameter, and only use that subclass. This allows methods to safely
|
|
* cast 'this' to 'Sub*'.
|
|
*/
|
|
template <class T, class Sub, class Coord = T>
|
|
struct BasePoint {
|
|
T x, y;
|
|
|
|
// Constructors
|
|
MOZ_CONSTEXPR BasePoint() : x(0), y(0) {}
|
|
MOZ_CONSTEXPR BasePoint(Coord aX, Coord aY) : x(aX), y(aY) {}
|
|
|
|
void MoveTo(T aX, T aY) { x = aX; y = aY; }
|
|
void MoveBy(T aDx, T aDy) { x += aDx; y += aDy; }
|
|
|
|
// Note that '=' isn't defined so we'll get the
|
|
// compiler generated default assignment operator
|
|
|
|
bool operator==(const Sub& aPoint) const {
|
|
return x == aPoint.x && y == aPoint.y;
|
|
}
|
|
bool operator!=(const Sub& aPoint) const {
|
|
return x != aPoint.x || y != aPoint.y;
|
|
}
|
|
|
|
Sub operator+(const Sub& aPoint) const {
|
|
return Sub(x + aPoint.x, y + aPoint.y);
|
|
}
|
|
Sub operator-(const Sub& aPoint) const {
|
|
return Sub(x - aPoint.x, y - aPoint.y);
|
|
}
|
|
Sub& operator+=(const Sub& aPoint) {
|
|
x += aPoint.x;
|
|
y += aPoint.y;
|
|
return *static_cast<Sub*>(this);
|
|
}
|
|
Sub& operator-=(const Sub& aPoint) {
|
|
x -= aPoint.x;
|
|
y -= aPoint.y;
|
|
return *static_cast<Sub*>(this);
|
|
}
|
|
|
|
Sub operator*(T aScale) const {
|
|
return Sub(x * aScale, y * aScale);
|
|
}
|
|
Sub operator/(T aScale) const {
|
|
return Sub(x / aScale, y / aScale);
|
|
}
|
|
|
|
Sub operator-() const {
|
|
return Sub(-x, -y);
|
|
}
|
|
|
|
T DotProduct(const Sub& aPoint) const {
|
|
return x * aPoint.x + y * aPoint.y;
|
|
}
|
|
|
|
T Length() const {
|
|
return hypot(x, y);
|
|
}
|
|
|
|
// Round() is *not* rounding to nearest integer if the values are negative.
|
|
// They are always rounding as floor(n + 0.5).
|
|
// See https://bugzilla.mozilla.org/show_bug.cgi?id=410748#c14
|
|
Sub& Round() {
|
|
x = Coord(floor(T(x) + T(0.5)));
|
|
y = Coord(floor(T(y) + T(0.5)));
|
|
return *static_cast<Sub*>(this);
|
|
}
|
|
|
|
// "Finite" means not inf and not NaN
|
|
bool IsFinite() const
|
|
{
|
|
typedef typename mozilla::Conditional<mozilla::IsSame<T, float>::value, float, double>::Type FloatType;
|
|
return (mozilla::IsFinite(FloatType(x)) && mozilla::IsFinite(FloatType(y)));
|
|
return true;
|
|
}
|
|
|
|
void Clamp(T aMaxAbsValue)
|
|
{
|
|
x = std::max(std::min(x, aMaxAbsValue), -aMaxAbsValue);
|
|
y = std::max(std::min(y, aMaxAbsValue), -aMaxAbsValue);
|
|
}
|
|
|
|
friend std::ostream& operator<<(std::ostream& stream, const BasePoint<T, Sub, Coord>& aPoint) {
|
|
return stream << '(' << aPoint.x << ',' << aPoint.y << ')';
|
|
}
|
|
|
|
};
|
|
|
|
} // namespace gfx
|
|
} // namespace mozilla
|
|
|
|
#endif /* MOZILLA_GFX_BASEPOINT_H_ */
|