Use an epsilon value 0.001f for the rectilinear calculation.
authorHyowon Kim <hw1008.kim@samsung.com>
Sat, 14 Sep 2013 11:11:44 +0000 (20:11 +0900)
committerHurnjoo Lee <hurnjoo.lee@samsung.com>
Sun, 29 Sep 2013 06:29:20 +0000 (15:29 +0900)
[Title] Use an epsilon value 0.001f for the rectilinear calculation.
[Issue#] P130910-04255
[Problem] Flickering occurs when the menu appears with animation on the Docomo PhotoCollection website.
[Cause] The results of whether a quad can be losslessly represented by a FloatRect are inconsistent during CSS animation.
Because the value of epsilon is set too high.
[Solution] Set the epsilon value to 0.001f for rectilinear clips.

Change-Id: Ibadf414b882035d1698bbc41b6088b6c54d63869

Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp

index a611e8a..cafd980 100755 (executable)
@@ -1011,6 +1011,20 @@ static inline TransformationMatrix createProjectionMatrix(const IntSize& size, b
                                 -1, mirrored ? -1 : 1, -(far + near) / (far - near), 1);
 }
 
+#if OS(TIZEN)
+static inline bool withinEpsilon(float a, float b)
+{
+    const float epsilon = 0.001f;
+    return fabs(a - b) < epsilon;
+}
+
+static inline bool isRectilinear(const FloatQuad& rect)
+{
+    return (withinEpsilon(rect.p1().x(), rect.p2().x()) && withinEpsilon(rect.p2().y(), rect.p3().y()) && withinEpsilon(rect.p3().x(), rect.p4().x()) && withinEpsilon(rect.p4().y(), rect.p1().y()))
+        || (withinEpsilon(rect.p1().y(), rect.p2().y()) && withinEpsilon(rect.p2().x(), rect.p3().x()) && withinEpsilon(rect.p3().y(), rect.p4().y()) && withinEpsilon(rect.p4().x(), rect.p1().x()));
+}
+#endif
+
 void BitmapTextureGL::initializeStencil()
 {
     if (m_rbo)
@@ -1138,7 +1152,11 @@ bool TextureMapperGL::beginScissorClip(const TransformationMatrix& modelViewMatr
     IntRect rect = quad.enclosingBoundingBox();
 
     // Only use scissors on rectilinear clips.
+#if OS(TIZEN)
+    if (!isRectilinear(quad) || rect.isEmpty())
+#else
     if (!quad.isRectilinear() || rect.isEmpty())
+#endif
         return false;
 
 #if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)