From dffe42dac6795ee8f8154e789b41bbe127176a9b Mon Sep 17 00:00:00 2001 From: "noam.rosenthal@nokia.com" Date: Tue, 21 Feb 2012 23:30:52 +0000 Subject: [PATCH] [Qt] Previous web page appears outside content rect https://bugs.webkit.org/show_bug.cgi?id=78816 Source/WebCore: Adjust the scissor clipping by -1, as the glScissor() function requires coordinates and not sizes. Reviewed by Kenneth Rohde Christiansen. No new functionality. * platform/graphics/opengl/TextureMapperGL.cpp: (WebCore::scissorClip): Source/WebKit2: Apply a clip on painted tiles if some of the tiles fall outside of the target rect. Reviewed by Kenneth Rohde Christiansen. * UIProcess/qt/LayerBackingStore.cpp: (WebKit::LayerBackingStore::paintToTextureMapper): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108407 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 15 +++++++++++++++ .../WebCore/platform/graphics/opengl/TextureMapperGL.cpp | 2 +- Source/WebKit2/ChangeLog | 12 ++++++++++++ Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp | 10 +++++++++- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 7aa4c8e..4d30611 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2012-02-21 No'am Rosenthal + + [Qt] Previous web page appears outside content rect + https://bugs.webkit.org/show_bug.cgi?id=78816 + + Adjust the scissor clipping by -1, as the glScissor() function requires coordinates and + not sizes. + + Reviewed by Kenneth Rohde Christiansen. + + No new functionality. + + * platform/graphics/opengl/TextureMapperGL.cpp: + (WebCore::scissorClip): + 2012-02-21 Victor Carbune Added support for pause-on-exit flag on a TextTrackCue. diff --git a/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp b/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp index 16d5dd1..71dd985 100644 --- a/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp +++ b/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp @@ -618,7 +618,7 @@ static void scissorClip(const IntRect& rect) { GLint viewport[4]; glGetIntegerv(GL_VIEWPORT, viewport); - glScissor(rect.x(), viewport[3] - rect.maxY(), rect.width(), rect.height()); + glScissor(rect.x(), viewport[3] - rect.maxY() + 1, rect.width() - 1, rect.height() - 1); } bool TextureMapperGL::beginScissorClip(const TransformationMatrix& modelViewMatrix, const FloatRect& targetRect) diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index 5c94f49..58d5c80 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,5 +1,17 @@ 2012-02-21 No'am Rosenthal + [Qt] Previous web page appears outside content rect + https://bugs.webkit.org/show_bug.cgi?id=78816 + + Apply a clip on painted tiles if some of the tiles fall outside of the target rect. + + Reviewed by Kenneth Rohde Christiansen. + + * UIProcess/qt/LayerBackingStore.cpp: + (WebKit::LayerBackingStore::paintToTextureMapper): + +2012-02-21 No'am Rosenthal + [Qt][WK2] Accelerated animations don't work on Mac https://bugs.webkit.org/show_bug.cgi?id=78963 diff --git a/Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp b/Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp index cd01ac6..1c3c288 100644 --- a/Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp +++ b/Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp @@ -94,7 +94,7 @@ PassRefPtr LayerBackingStore::texture() const return PassRefPtr(); } -void LayerBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect&, const TransformationMatrix& transform, float opacity, BitmapTexture* mask) +void LayerBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity, BitmapTexture* mask) { Vector tilesToPaint; @@ -115,8 +115,16 @@ void LayerBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const tilesToPaint.prepend(&tile); } + bool shouldClip = !targetRect.contains(coveredRect); + + if (shouldClip) + textureMapper->beginClip(transform, targetRect); + for (size_t i = 0; i < tilesToPaint.size(); ++i) tilesToPaint[i]->paint(textureMapper, transform, opacity, mask); + + if (shouldClip) + textureMapper->endClip(); } void LayerBackingStore::swapBuffers(TextureMapper* textureMapper) -- 2.7.4