зеркало из https://github.com/mozilla/gecko-dev.git
Bug 572680 - Shuffle some gfx dependencies around. r=joe
--HG-- extra : rebase_source : 982a57f4466a69e6e6a2053794b6b09c2b470b12
This commit is contained in:
Родитель
d13b3a057f
Коммит
283b92b9e1
|
@ -49,6 +49,7 @@
|
|||
|
||||
#include "gfxContext.h"
|
||||
#include "gfxPattern.h"
|
||||
#include "gfxUtils.h"
|
||||
|
||||
#include "CanvasUtils.h"
|
||||
#include "NativeJSContext.h"
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "gfxPoint.h"
|
||||
#include "gfxTypes.h"
|
||||
#include "gfxRect.h"
|
||||
#include "gfxUtils.h"
|
||||
#include "nsMathUtils.h"
|
||||
|
||||
// XX - I don't think this class should use gfxFloat at all,
|
||||
|
@ -189,8 +188,8 @@ public:
|
|||
*/
|
||||
PRBool HasNonIntegerTranslation() const {
|
||||
return HasNonTranslation() ||
|
||||
!gfxUtils::FuzzyEqual(x0, NS_floor(x0 + 0.5)) ||
|
||||
!gfxUtils::FuzzyEqual(y0, NS_floor(y0 + 0.5));
|
||||
!FuzzyEqual(x0, NS_floor(x0 + 0.5)) ||
|
||||
!FuzzyEqual(y0, NS_floor(y0 + 0.5));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -198,8 +197,8 @@ public:
|
|||
* than a straight translation
|
||||
*/
|
||||
PRBool HasNonTranslation() const {
|
||||
return !gfxUtils::FuzzyEqual(xx, 1.0) || !gfxUtils::FuzzyEqual(yy, 1.0) ||
|
||||
!gfxUtils::FuzzyEqual(xy, 0.0) || !gfxUtils::FuzzyEqual(yx, 0.0);
|
||||
return !FuzzyEqual(xx, 1.0) || !FuzzyEqual(yy, 1.0) ||
|
||||
!FuzzyEqual(xy, 0.0) || !FuzzyEqual(yx, 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -207,9 +206,9 @@ public:
|
|||
* than a translation or a -1 y scale (y axis flip)
|
||||
*/
|
||||
PRBool HasNonTranslationOrFlip() const {
|
||||
return !gfxUtils::FuzzyEqual(xx, 1.0) ||
|
||||
(!gfxUtils::FuzzyEqual(yy, 1.0) && !gfxUtils::FuzzyEqual(yy, -1.0)) ||
|
||||
!gfxUtils::FuzzyEqual(xy, 0.0) || !gfxUtils::FuzzyEqual(yx, 0.0);
|
||||
return !FuzzyEqual(xx, 1.0) ||
|
||||
(!FuzzyEqual(yy, 1.0) && !FuzzyEqual(yy, -1.0)) ||
|
||||
!FuzzyEqual(xy, 0.0) || !FuzzyEqual(yx, 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -218,7 +217,7 @@ public:
|
|||
* no rotation.
|
||||
*/
|
||||
PRBool HasNonAxisAlignedTransform() const {
|
||||
return !gfxUtils::FuzzyEqual(xy, 0.0) || !gfxUtils::FuzzyEqual(yx, 0.0);
|
||||
return !FuzzyEqual(xy, 0.0) || !FuzzyEqual(yx, 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -258,6 +257,11 @@ public:
|
|||
|
||||
return gfxSize(minor, major);
|
||||
}
|
||||
|
||||
private:
|
||||
static PRBool FuzzyEqual(gfxFloat aV1, gfxFloat aV2) {
|
||||
return fabs(aV2 - aV1) < 1e-6;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* GFX_MATRIX_H */
|
||||
|
|
|
@ -44,10 +44,6 @@ class gfxImageSurface;
|
|||
|
||||
class THEBES_API gfxUtils {
|
||||
public:
|
||||
static PRBool FuzzyEqual(gfxFloat aV1, gfxFloat aV2) {
|
||||
return fabs(aV2 - aV1) < 1e-6;
|
||||
}
|
||||
|
||||
/*
|
||||
* Premultiply or Unpremultiply aSourceSurface, writing the result
|
||||
* to aDestSurface or back into aSourceSurface if aDestSurface is null.
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "gfxWindowsNativeDrawing.h"
|
||||
#include "gfxWindowsSurface.h"
|
||||
#include "gfxAlphaRecovery.h"
|
||||
#include "gfxPattern.h"
|
||||
|
||||
enum {
|
||||
RENDER_STATE_INIT,
|
||||
|
|
Загрузка…
Ссылка в новой задаче