https://bugs.webkit.org/show_bug.cgi?id=106358
Patch by Viatcheslav Ostapenko <sl.ostapenko@samsung.com> on 2013-02-11
Reviewed by Noam Rosenthal.
Source/WebCore:
When page size changes and layer parameters get updated LayerTreeRenderer::setLayerState
clears the layer backing store and detaches the canvas surface from the layer. If the layer
size is not changed then the canvas is not recreated. This leaves the canvas detached from
the layer, but still referenced from m_surfaceBackingStores.
Don't assign layer backing store to layer in assignImageBackingToLayer if there is a canvas
surface already attached to the layer.
Test: fast/canvas/webgl/webgl-layer-update.html
* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
(WebCore::CoordinatedGraphicsScene::setLayerState):
(WebCore::CoordinatedGraphicsScene::assignImageBackingToLayer):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
LayoutTests:
Add test checking that canvas painting is correct if layer parameters were changed,
but webgl canvas didn't change.
* fast/canvas/webgl/webgl-layer-update-expected.png: Added.
* fast/canvas/webgl/webgl-layer-update-expected.txt: Added.
* fast/canvas/webgl/webgl-layer-update.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142586
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-02-11 Viatcheslav Ostapenko <sl.ostapenko@samsung.com>
+
+ [EFL][WebGL] WebGL content is not painted after resizing the viewport.
+ https://bugs.webkit.org/show_bug.cgi?id=106358
+
+ Reviewed by Noam Rosenthal.
+
+ Add test checking that canvas painting is correct if layer parameters were changed,
+ but webgl canvas didn't change.
+
+ * fast/canvas/webgl/webgl-layer-update-expected.png: Added.
+ * fast/canvas/webgl/webgl-layer-update-expected.txt: Added.
+ * fast/canvas/webgl/webgl-layer-update.html: Added.
+
2013-02-11 KwangYong Choi <ky0.choi@samsung.com>
[EFL] Some placeholder paint order tests are passing now
--- /dev/null
+This test is only useful as a pixel test. You should see red canvas of size 100x100.
+
--- /dev/null
+<!DOCTYPE html>
+<html>
+<script>
+ function doUpdate()
+ {
+ document.getElementsByTagName('canvas')[0].style.top = "60px";
+
+ if (window.testRunner) {
+ testRunner.display();
+ testRunner.notifyDone();
+ }
+ }
+
+ function init()
+ {
+ if (window.testRunner)
+ doUpdate();
+ else {
+ // Delay canvas layer update if test runs without testRunner to
+ // allow first layer update to be processed on UI side.
+ window.setTimeout(doUpdate, 100);
+ }
+ }
+</script>
+<body onload="init()">
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+</script>
+<span id="description" style="color: white">
+This test is only useful as a pixel test. You should see red canvas of size 100x100.
+</span>
+<br>
+<style>
+canvas {
+ outline: 1px solid blue;
+}
+body {
+ background-color: darkblue;
+}
+</style>
+<script>
+
+if (window.testRunner) {
+ testRunner.overridePreference("WebKitWebGLEnabled", "1");
+ testRunner.dumpAsText(true);
+ document.getElementById("description").style.position = "absolute";
+ document.getElementById("description").style.top = "-5000px";
+}
+
+var can = document.createElement('canvas');
+can.width = can.height = 100;
+can.style.position = "absolute";
+can.style.left = "40px";
+can.style.top = "40px";
+document.body.appendChild(can);
+var ctx = can.getContext("experimental-webgl");
+ctx.clearColor(1, 0, 0, 1);
+ctx.clear(ctx.COLOR_BUFFER_BIT);
+
+if (window.testRunner)
+ testRunner.display();
+</script>
+</body>
+</html>
+
+2013-02-11 Viatcheslav Ostapenko <sl.ostapenko@samsung.com>
+
+ [EFL][WebGL] WebGL content is not painted after resizing the viewport.
+ https://bugs.webkit.org/show_bug.cgi?id=106358
+
+ Reviewed by Noam Rosenthal.
+
+ When page size changes and layer parameters get updated LayerTreeRenderer::setLayerState
+ clears the layer backing store and detaches the canvas surface from the layer. If the layer
+ size is not changed then the canvas is not recreated. This leaves the canvas detached from
+ the layer, but still referenced from m_surfaceBackingStores.
+ Don't assign layer backing store to layer in assignImageBackingToLayer if there is a canvas
+ surface already attached to the layer.
+
+ Test: fast/canvas/webgl/webgl-layer-update.html
+
+ * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
+ (WebCore::CoordinatedGraphicsScene::setLayerState):
+ (WebCore::CoordinatedGraphicsScene::assignImageBackingToLayer):
+ * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
+
2013-02-11 Eric Carlson <eric.carlson@apple.com>
[Mac] Track language selection should be sticky
else
m_fixedLayers.remove(id);
- assignImageBackingToLayer(layer, layerInfo.imageID);
+ assignImageBackingToLayer(id, layer, layerInfo.imageID);
prepareContentBackingStore(layer);
// Never make the root layer clip.
m_releasedImageBackings.append(m_imageBackings.take(imageID));
}
-void CoordinatedGraphicsScene::assignImageBackingToLayer(GraphicsLayer* layer, CoordinatedImageBackingID imageID)
+void CoordinatedGraphicsScene::assignImageBackingToLayer(CoordinatedLayerID id, GraphicsLayer* layer, CoordinatedImageBackingID imageID)
{
+#if USE(GRAPHICS_SURFACE)
+ if (m_surfaceBackingStores.contains(id))
+ return;
+#endif
+
if (imageID == InvalidCoordinatedImageBackingID) {
layer->setContentsToMedia(0);
return;
void createLayer(CoordinatedLayerID);
void deleteLayer(CoordinatedLayerID);
- void assignImageBackingToLayer(GraphicsLayer*, CoordinatedImageBackingID);
+ void assignImageBackingToLayer(CoordinatedLayerID, GraphicsLayer*, CoordinatedImageBackingID);
void removeReleasedImageBackingsIfNeeded();
void ensureRootLayer();
void commitPendingBackingStoreOperations();