Modified: trunk/Source/WebCore/ChangeLog (87948 => 87949)
--- trunk/Source/WebCore/ChangeLog 2011-06-02 20:15:34 UTC (rev 87948)
+++ trunk/Source/WebCore/ChangeLog 2011-06-02 20:20:34 UTC (rev 87949)
@@ -1,3 +1,28 @@
+2011-06-02 Alok Priyadarshi <[email protected]>
+
+ Reviewed by James Robinson.
+
+ [chromium] Things jump around when selecting anything on the page
+ https://bugs.webkit.org/show_bug.cgi?id=61639
+
+ WebCore::LayerTextureUpdaterSkPicture::updateTextureRect was not updating a tile sub-region properly.
+ It did not consider dest-rect when selecting the clip and translation required to draw the content-rect into dest-rect.
+ Also removed clearing of framebuffer because it used to clear the whole tile not just dest-rect.
+ An appropriate viewport could be set to just clear the dest-rect, but it was debug only code and I did not want to mess
+ with the viewport set by skia.
+
+ No new tests. This case should be covered by most of the layout tests (pixel) targeting selection or hovering when chromium is run in compositing mode.
+ Here is a non-exhaustive list of existing tests covering this case.
+ Test: editing/selection/14971.html (existing)
+ editing/selection/3690703-2.html (existing)
+ editing/selection/4402375.html (existing)
+ editing/selection/4818145.html (existing)
+
+ * platform/graphics/chromium/LayerTextureUpdaterCanvas.cpp:
+ (WebCore::LayerTextureUpdaterSkPicture::updateTextureRect):
+ (WebCore::LayerTextureUpdaterSkPicture::createFrameBuffer):
+ * platform/graphics/chromium/LayerTextureUpdaterCanvas.h:
+
2011-06-02 Dimitri Glazkov <[email protected]>
Reviewed by Darin Adler.
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.cpp (87948 => 87949)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.cpp 2011-06-02 20:15:34 UTC (rev 87948)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.cpp 2011-06-02 20:20:34 UTC (rev 87949)
@@ -137,15 +137,14 @@
texture->framebufferTexture2D();
ASSERT(context()->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) == GraphicsContext3D::FRAMEBUFFER_COMPLETE);
- context()->viewport(0, 0, m_bufferSize.width(), m_bufferSize.height());
- clearFrameBuffer();
-
// Notify SKIA to sync its internal GL state.
m_skiaContext->resetContext();
- // Offset from source rectangle to this destination rectangle.
- IntPoint offset(sourceRect.x() - contentRect().x(), sourceRect.y() - contentRect().y());
m_canvas->save();
- m_canvas->translate(-offset.x(), -offset.y());
+ m_canvas->clipRect(SkRect(destRect));
+ // Translate the origin of contentRect to that of destRect.
+ // Note that destRect is defined relative to sourceRect.
+ m_canvas->translate(contentRect().x() - sourceRect.x() + destRect.x(),
+ contentRect().y() - sourceRect.y() + destRect.y());
m_canvas->drawPicture(m_picture);
m_canvas->restore();
// Flush SKIA context so that all the rendered stuff appears on the texture.
@@ -210,8 +209,7 @@
}
context()->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
context()->renderbufferStorage(GraphicsContext3D::RENDERBUFFER, Extensions3D::DEPTH24_STENCIL8, m_bufferSize.width(), m_bufferSize.height());
- context()->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::STENCIL_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
- context()->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
+ context()->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
// Create a skia gpu canvas.
GrPlatformSurfaceDesc targetDesc;
@@ -232,15 +230,6 @@
context()->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0);
return true;
}
-
-void LayerTextureUpdaterSkPicture::clearFrameBuffer()
-{
-#ifndef NDEBUG
- // Clear to green to make it easier to spot unrendered regions.
- context()->clearColor(0, 1, 0, 1);
- context()->clear(GraphicsContext3D::COLOR_BUFFER_BIT | GraphicsContext3D::STENCIL_BUFFER_BIT);
-#endif
-}
#endif // SKIA
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.h (87948 => 87949)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.h 2011-06-02 20:15:34 UTC (rev 87948)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.h 2011-06-02 20:20:34 UTC (rev 87949)
@@ -91,7 +91,6 @@
private:
void deleteFrameBuffer();
bool createFrameBuffer();
- void clearFrameBuffer();
GrContext* m_skiaContext; // SKIA graphics context.