From e1dc535a7ce476f85b5be389307108139d54c3ae Mon Sep 17 00:00:00 2001 From: "jocelyn.turcotte@nokia.com" Date: Fri, 13 Apr 2012 12:56:08 +0000 Subject: [PATCH] [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): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114118 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 14 ++++++++++++++ .../platform/graphics/texmap/TextureMapperGL.cpp | 18 +----------------- Source/WebKit2/ChangeLog | 16 ++++++++++++++++ Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp | 4 ++-- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index ba974f2..2dff950 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,17 @@ +2012-04-12 Jocelyn Turcotte + + [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 Web Inspector: introduce ParsedURL type, clean up url and displayName mess in Resource and NetworkRequest. diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp index 323a923..894ebbf 100644 --- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp +++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp @@ -326,23 +326,7 @@ void TextureMapperGL::drawTexture(uint32_t texture, Flags flags, const IntSize& 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, diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index e1a532a..16d8586 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,19 @@ +2012-04-12 Jocelyn Turcotte + + [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 Preprocessing text files with modern clang treats double slashes in comments diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp index 01f8da4..6f919a9 100644 --- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp +++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp @@ -82,7 +82,8 @@ QQuickWebViewPrivate::QQuickWebViewPrivate(QQuickWebView* viewport) , 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 @@ QQuickWebView::QQuickWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRe { Q_D(QQuickWebView); d->initialize(contextRef, pageGroupRef); - setClip(true); } QQuickWebView::~QQuickWebView() -- 2.7.4