[Qt] Previous web page appears outside content rect
authornoam.rosenthal@nokia.com <noam.rosenthal@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 23:30:52 +0000 (23:30 +0000)
committernoam.rosenthal@nokia.com <noam.rosenthal@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 23:30:52 +0000 (23:30 +0000)
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
Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/qt/LayerBackingStore.cpp

index 7aa4c8e..4d30611 100644 (file)
@@ -1,3 +1,18 @@
+2012-02-21  No'am Rosenthal  <noam.rosenthal@nokia.com>
+
+        [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  <vcarbune@adobe.com>
 
         Added support for pause-on-exit flag on a TextTrackCue.
index 16d5dd1..71dd985 100644 (file)
@@ -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)
index 5c94f49..58d5c80 100644 (file)
@@ -1,5 +1,17 @@
 2012-02-21  No'am Rosenthal  <noam.rosenthal@nokia.com>
 
+        [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  <noam.rosenthal@nokia.com>
+
         [Qt][WK2] Accelerated animations don't work on Mac
         https://bugs.webkit.org/show_bug.cgi?id=78963
 
index cd01ac6..1c3c288 100644 (file)
@@ -94,7 +94,7 @@ PassRefPtr<BitmapTexture> LayerBackingStore::texture() const
     return PassRefPtr<BitmapTexture>();
 }
 
-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<TextureMapperTile*> 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)