Bug 1211360 - Don't snap for non-translation 3D transform. r=roc

--HG--
extra : histedit_source : 7515376b0eb76c7957adce0fc37cc5bb52361de5
This commit is contained in:
Thinker K.F. Li 2015-10-25 22:05:00 -04:00
Родитель 922927d4f3
Коммит 2a3f9839c2
4 изменённых файлов: 37 добавлений и 5 удалений

Просмотреть файл

@ -1005,6 +1005,36 @@ public:
void Perspective(float aDepth);
Point3D GetNormalVector() const;
/**
* Returns true if the matrix has any transform other
* than a straight translation.
*/
bool HasNonTranslation() const {
return !gfx::FuzzyEqual(_11, 1.0) || !gfx::FuzzyEqual(_22, 1.0) ||
!gfx::FuzzyEqual(_12, 0.0) || !gfx::FuzzyEqual(_21, 0.0) ||
!gfx::FuzzyEqual(_13, 0.0) || !gfx::FuzzyEqual(_23, 0.0) ||
!gfx::FuzzyEqual(_31, 0.0) || !gfx::FuzzyEqual(_32, 0.0) ||
!gfx::FuzzyEqual(_33, 1.0);
}
/**
* Returns true if the matrix is anything other than a straight
* translation by integers.
*/
bool HasNonIntegerTranslation() const {
return HasNonTranslation() ||
!gfx::FuzzyEqual(_41, floor(_41 + 0.5)) ||
!gfx::FuzzyEqual(_42, floor(_42 + 0.5)) ||
!gfx::FuzzyEqual(_43, floor(_43 + 0.5));
}
/**
* Return true if the matrix is with perspective (w).
*/
bool HasPerspectiveComponent() const {
return _14 != 0 || _24 != 0 || _34 != 0 || _44 != 1;
}
};
class Matrix5x4

Просмотреть файл

@ -660,7 +660,9 @@ Layer::SnapTransformTranslation(const Matrix4x4& aTransform,
}
if(aTransform.IsSingular() ||
(aTransform._14 != 0 || aTransform._24 != 0 || aTransform._34 != 0)) {
aTransform.HasPerspectiveComponent() ||
aTransform.HasNonTranslation() ||
!aTransform.HasNonIntegerTranslation()) {
// For a singular transform, there is no reversed matrix, so we
// don't snap it.
// For a perspective transform, the content is transformed in

Просмотреть файл

@ -1904,7 +1904,7 @@ skip-if(!B2G) == 1133905-3-rtl.html 1133905-ref-rtl.html
skip-if(!B2G) == 1133905-4-rtl.html 1133905-ref-rtl.html
skip-if(!B2G) == 1133905-5-rtl.html 1133905-ref-rtl.html
skip-if(!B2G) == 1133905-6-rtl.html 1133905-ref-rtl.html
skip-if(!B2G) fuzzy-if(B2G,20,177) == 1133905-1-v-rtl.html 1133905-ref-v-rtl.html
skip-if(!B2G) fuzzy-if(B2G,21,175) == 1133905-1-v-rtl.html 1133905-ref-v-rtl.html
skip-if(!B2G) fuzzy-if(B2G,20,174) == 1133905-2-v-rtl.html 1133905-ref-v-rtl.html
skip-if(!B2G) fuzzy-if(B2G,64,181) == 1133905-3-v-rtl.html 1133905-ref-v-rtl.html
skip-if(!B2G) == 1133905-4-v-rtl.html 1133905-ref-v-rtl.html
@ -1916,7 +1916,7 @@ skip-if(!B2G) == 1133905-3-h-rtl.html 1133905-ref-h-rtl.html
skip-if(!B2G) == 1133905-4-h-rtl.html 1133905-ref-h-rtl.html
skip-if(!B2G) == 1133905-5-h-rtl.html 1133905-ref-h-rtl.html
skip-if(!B2G) == 1133905-6-h-rtl.html 1133905-ref-h-rtl.html
skip-if(!B2G) fuzzy-if(B2G,20,177) == 1133905-1-vh-rtl.html 1133905-ref-vh-rtl.html
skip-if(!B2G) fuzzy-if(B2G,21,175) == 1133905-1-vh-rtl.html 1133905-ref-vh-rtl.html
skip-if(!B2G) fuzzy-if(B2G,62,176) == 1133905-2-vh-rtl.html 1133905-ref-vh-rtl.html
skip-if(!B2G) fuzzy-if(B2G,23,176) == 1133905-3-vh-rtl.html 1133905-ref-vh-rtl.html
skip-if(!B2G) == 1133905-4-vh-rtl.html 1133905-ref-vh-rtl.html

Просмотреть файл

@ -20,7 +20,7 @@ fuzzy-if(gtkWidget||winWidget,8,376) fuzzy-if(Android,8,441) fuzzy-if(cocoaWidge
== preserve3d-2d.html preserve3d-2-ref.html
== preserve3d-3a.html preserve3d-3-ref.html
skip-if(B2G||Mulet) == preserve3d-4a.html green-rect.html # Initial mulet triage: parity with B2G/B2G Desktop
fuzzy-if(gtkWidget,4,200) fuzzy-if(Android&&AndroidVersion>=15,4,300) == preserve3d-5a.html preserve3d-5-ref.html
fuzzy-if(gtkWidget,4,200) fuzzy-if(Android&&AndroidVersion>=15,4,300) fuzzy-if(winWidget&&!layersGPUAccelerated,2,100) == preserve3d-5a.html preserve3d-5-ref.html
== scale3d-z.html scalez-1-ref.html
fuzzy-if(winWidget,102,580) fuzzy-if(d2d,143,681) fuzzy-if(OSX>=1008,224,924) == scale3d-all.html scale3d-1-ref.html # subpixel AA
fuzzy-if(winWidget,102,580) fuzzy-if(d2d,143,681) fuzzy-if(OSX>=1008,224,924) == scale3d-all-separate.html scale3d-1-ref.html # subpixel AA
@ -64,7 +64,7 @@ fuzzy(3,99) fuzzy-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccele
fuzzy(3,99) == animate-cube-degrees.html animate-cube-degrees-ref.html # subpixel AA
== animate-cube-degrees-zoom.html animate-cube-degrees-zoom-ref.html
!= animate-cube-degrees-ref.html animate-cube-degrees-zoom-ref.html
fuzzy-if(B2G,15,100) fuzzy-if(Android,100,100) fuzzy-if(winWidget,90,200) fuzzy-if(B2G,88,100) fuzzy-if(cocoaWidget,90,100) fuzzy-if(gtkWidget,80,200) == preserves3d-nested.html preserves3d-nested-ref.html
fuzzy-if(B2G||Android||OSX==1010,143,100) fuzzy-if(winWidget||OSX<1010,141,100) fuzzy-if(gtkWidget,128,100) == preserves3d-nested.html preserves3d-nested-ref.html
fuzzy-if(cocoaWidget,128,9) == animate-preserve3d-parent.html animate-preserve3d-ref.html # intermittently fuzzy on Mac
fuzzy-if(cocoaWidget,128,9) == animate-preserve3d-child.html animate-preserve3d-ref.html # intermittently fuzzy on Mac
== animate-backface-hidden.html about:blank