Title: [114118] trunk/Source
Revision
114118
Author
[email protected]
Date
2012-04-13 05:56:08 -0700 (Fri, 13 Apr 2012)

Log Message

[Qt] Use QQuickFlickable::setPixelAligned instead of doing pixel-alignment when rendering.
https://bugs.webkit.org/show_bug.cgi?id=83770

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Revert the previous way of dealing with things. The problem is that different layers
would end up rounding in different directions, and would cause jittering between
layers or with the QQuickWebPage's background.

* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawTexture):

Source/WebKit2:

- Do the alignment on the highest level as possible: the QQuickFlickable content item
  position. It already supports this with setPixelAligned which rounds the content item's position.
- Also move the setClip(true) to the common constructor as this constructor is currently only used by WTR.
- Remove setFlags(QQuickItem::ItemClipsChildrenToShape) as it is redundant with setClip(true).

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::QQuickWebViewPrivate):
(QQuickWebView::QQuickWebView):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114117 => 114118)


--- trunk/Source/WebCore/ChangeLog	2012-04-13 12:25:25 UTC (rev 114117)
+++ trunk/Source/WebCore/ChangeLog	2012-04-13 12:56:08 UTC (rev 114118)
@@ -1,3 +1,17 @@
+2012-04-12  Jocelyn Turcotte  <[email protected]>
+
+        [Qt] Use QQuickFlickable::setPixelAligned instead of doing pixel-alignment when rendering.
+        https://bugs.webkit.org/show_bug.cgi?id=83770
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Revert the previous way of dealing with things. The problem is that different layers
+        would end up rounding in different directions, and would cause jittering between
+        layers or with the QQuickWebPage's background.
+
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+        (WebCore::TextureMapperGL::drawTexture):
+
 2012-04-13  Pavel Feldman  <[email protected]>
 
         Web Inspector: introduce ParsedURL type, clean up url and displayName mess in Resource and NetworkRequest.

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp (114117 => 114118)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2012-04-13 12:25:25 UTC (rev 114117)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2012-04-13 12:56:08 UTC (rev 114118)
@@ -326,23 +326,7 @@
     const GLfloat unitRect[] = {0, 0, 1, 0, 1, 1, 0, 1};
     GL_CMD(glVertexAttribPointer(shaderInfo->vertexAttrib(), 2, GL_FLOAT, GL_FALSE, 0, unitRect));
 
-    TransformationMatrix adjustedModelViewMatrix(modelViewMatrix);
-    // Check if the transformed target rect has the same shape/dimensions as the drawn texture (i.e. translated only).
-    FloatQuad finalQuad = modelViewMatrix.mapQuad(FloatQuad(targetRect));
-    FloatSize finalSize = finalQuad.p3() - finalQuad.p1();
-    if (abs(textureSize.width() - finalSize.width()) < 0.001
-        && abs(textureSize.height() - finalSize.height()) < 0.001
-        && finalQuad.p2().y() == finalQuad.p1().y()
-        && finalQuad.p2().x() == finalQuad.p3().x()
-        && finalQuad.p4().x() == finalQuad.p1().x()
-        && finalQuad.p4().y() == finalQuad.p3().y()) {
-        // Pixel-align the origin of our layer's coordinate system within the frame buffer's
-        // coordinate system to avoid sub-pixel interpolation.
-        adjustedModelViewMatrix.setM41(floor(adjustedModelViewMatrix.m41() + 0.5));
-        adjustedModelViewMatrix.setM42(floor(adjustedModelViewMatrix.m42() + 0.5));
-    }
-
-    TransformationMatrix matrix = TransformationMatrix(data().projectionMatrix).multiply(adjustedModelViewMatrix).multiply(TransformationMatrix(
+    TransformationMatrix matrix = TransformationMatrix(data().projectionMatrix).multiply(modelViewMatrix).multiply(TransformationMatrix(
             targetRect.width(), 0, 0, 0,
             0, targetRect.height(), 0, 0,
             0, 0, 1, 0,

Modified: trunk/Source/WebKit2/ChangeLog (114117 => 114118)


--- trunk/Source/WebKit2/ChangeLog	2012-04-13 12:25:25 UTC (rev 114117)
+++ trunk/Source/WebKit2/ChangeLog	2012-04-13 12:56:08 UTC (rev 114118)
@@ -1,3 +1,19 @@
+2012-04-12  Jocelyn Turcotte  <[email protected]>
+
+        [Qt] Use QQuickFlickable::setPixelAligned instead of doing pixel-alignment when rendering.
+        https://bugs.webkit.org/show_bug.cgi?id=83770
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        - Do the alignment on the highest level as possible: the QQuickFlickable content item
+          position. It already supports this with setPixelAligned which rounds the content item's position.
+        - Also move the setClip(true) to the common constructor as this constructor is currently only used by WTR.
+        - Remove setFlags(QQuickItem::ItemClipsChildrenToShape) as it is redundant with setClip(true).
+
+        * UIProcess/API/qt/qquickwebview.cpp:
+        (QQuickWebViewPrivate::QQuickWebViewPrivate):
+        (QQuickWebView::QQuickWebView):
+
 2012-04-12  Alexey Proskuryakov  <[email protected]>
 
         Preprocessing text files with modern clang treats double slashes in comments

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp (114117 => 114118)


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-04-13 12:25:25 UTC (rev 114117)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp	2012-04-13 12:56:08 UTC (rev 114118)
@@ -82,7 +82,8 @@
     , m_loadStartedSignalSent(false)
     , m_dialogActive(false)
 {
-    viewport->setFlags(QQuickItem::ItemClipsChildrenToShape);
+    viewport->setClip(true);
+    viewport->setPixelAligned(true);
     QObject::connect(viewport, SIGNAL(visibleChanged()), viewport, SLOT(_q_onVisibleChanged()));
     QObject::connect(viewport, SIGNAL(urlChanged()), viewport, SLOT(_q_onUrlChanged()));
     pageView.reset(new QQuickWebPage(viewport));
@@ -1062,7 +1063,6 @@
 {
     Q_D(QQuickWebView);
     d->initialize(contextRef, pageGroupRef);
-    setClip(true);
 }
 
 QQuickWebView::~QQuickWebView()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to