https://bugs.webkit.org/show_bug.cgi?id=72208
Since the scroll is no longer applied at the top layer of the layer
tree, the scaleDelta transformation needs to be moved down to the
same level.
Also fix zoomAnimator to be applied the same way. I removed zoom
animator layout tests, as they aren't testing the actual impl-side
codepath, and are hard to continue supporting -- we should cover zoom
features with unit tests in the future.
Patch by Alexandre Elias <aelias@google.com> on 2011-11-14
Reviewed by James Robinson.
No new tests (planning to add later: https://bugs.webkit.org/show_bug.cgi?id=71529)
* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::scaleDelta):
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::drawLayersInternal):
* platform/graphics/chromium/LayerRendererChromium.h:
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::CCLayerImpl):
(WebCore::CCLayerImpl::setScaleDelta):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(WebCore::CCLayerImpl::scaleDelta):
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::calculateDrawTransformsAndVisibilityInternal):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::setScaleDelta):
(WebCore::CCLayerTreeHostImpl::setZoomAnimatorTransform):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100235
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+++ /dev/null
-<html>
- <head>
- <script>
- if (window.internals) {
- window.internals.setForceCompositingMode(document, true);
- window.internals.setZoomParameters(document, 1.25, 100, 100);
- }
- if (window.layoutTestController) {
- window.layoutTestController.dumpAsText(true);
- }
-
- function doTest() {
- document.getElementById("aBox").style.backgroundColor = "green";
- }
-
- window.addEventListener("load", doTest, false);
- </script>
- </head>
-<body>
- <!-- If successful, the box should enlarge to be 125x125 at (125,125).
- -->
- <div id="aBox" style="width:100px; height:100px; position:absolute; left:100px; top:100px; background-color:#FF0000"></div>
-</body>
-</html>
+++ /dev/null
-<html>
- <head>
- <script>
- if (window.internals) {
- window.internals.setEnableScrollAnimator(document, true);
- window.internals.setForceCompositingMode(document, true);
- }
-
- if (window.layoutTestController) {
- window.layoutTestController.dumpAsText(true);
- window.layoutTestController.waitUntilDone();
- }
-
- var timer;
- var count = 0;
- var maxCount = 60;
- var newScale = 1.25;
-
- function finishTest() {
- count++;
- if (!window.internals || (window.internals.getPageScaleFactor(document) == newScale || count > maxCount)) {
- clearInterval(timer);
-
- if (count > maxCount) {
- document.getElementById("aBox").style.backgroundColor = "red";
- document.getElementById("aBox").innerHTML = "<center>FAIL!</center>";
- }
-
- document.documentElement.style.overflow = "hidden";
- if (window.layoutTestController)
- window.layoutTestController.notifyDone();
- }
- }
-
- function doTest() {
- document.getElementById("aBox").style.backgroundColor = "green";
- if (window.internals) {
- window.internals.setZoomAnimatorTransform(document, newScale, 100.0, 100.0);
- // Check periodically for animation completion.
- timer = setInterval("finishTest()", 250);
- }
- }
-
- window.addEventListener("load", doTest, false);
- </script>
- </head>
-<body id="theBody">
- <!-- If successful, the box should enlarge to be 125x125 at (125,125).
- -->
- <div id="aBox" style="width:100px; height:100px; position:absolute; left:100px; top:100px; background-color:#FF0000"></div>
-</body>
-</html>
BUGWK58587 : media/video-controls-rendering.html = IMAGE
-// Take new baselines from the bots when 68035 lands.
-//BUGWK69624 SLOW WIN GPU : platform/chromium/compositing/zoom-animator-scale-test2.html = IMAGE+TEXT
-//BUGWK70046 SLOW MAC : platform/chromium/compositing/zoom-animator-scale-test2.html = PASS MISSING
-
BUGWK53868 : fast/notifications/notifications-document-close-crash.html = PASS TEXT
BUGWK54051 MAC : plugins/invalidate_rect.html = TEXT
BUGENNE GPU : compositing/overflow/fixed-position-ancestor-clip.html = FAIL
BUGENNE GPU : compositing/scaling/tiled-layer-recursion.html = FAIL
// Uncomment the above results for this when removing.
-BUGENNE GPU GPU-CG : platform/chromium/compositing/zoom-animator-scale-test2.html = FAIL TIMEOUT
// This test sometimes exceeds 60-second time limit (for SLOW tests) on
// win/linux debug. Since setting both SLOW and TIMEOUT is not allowed,
+2011-11-14 Alexandre Elias <aelias@google.com>
+
+ [chromium] Fix scaleDelta zoom-out visibility rect bug
+ https://bugs.webkit.org/show_bug.cgi?id=72208
+
+ Since the scroll is no longer applied at the top layer of the layer
+ tree, the scaleDelta transformation needs to be moved down to the
+ same level.
+
+ Also fix zoomAnimator to be applied the same way. I removed zoom
+ animator layout tests, as they aren't testing the actual impl-side
+ codepath, and are hard to continue supporting -- we should cover zoom
+ features with unit tests in the future.
+
+ Reviewed by James Robinson.
+
+ No new tests (planning to add later: https://bugs.webkit.org/show_bug.cgi?id=71529)
+
+ * platform/graphics/chromium/LayerChromium.h:
+ (WebCore::LayerChromium::scaleDelta):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::drawLayersInternal):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ * platform/graphics/chromium/cc/CCLayerImpl.cpp:
+ (WebCore::CCLayerImpl::CCLayerImpl):
+ (WebCore::CCLayerImpl::setScaleDelta):
+ * platform/graphics/chromium/cc/CCLayerImpl.h:
+ (WebCore::CCLayerImpl::scaleDelta):
+ * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
+ (WebCore::calculateDrawTransformsAndVisibilityInternal):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::setScaleDelta):
+ (WebCore::CCLayerTreeHostImpl::setZoomAnimatorTransform):
+
2011-11-14 Chris Fleizach <cfleizach@apple.com>
WebProcess crashes when trying to display your "uploaded videos" page on Facebook
void setSublayerTransform(const TransformationMatrix& transform) { m_sublayerTransform = transform; setNeedsCommit(); }
const TransformationMatrix& sublayerTransform() const { return m_sublayerTransform; }
+ TransformationMatrix zoomAnimatorTransform() const { return TransformationMatrix(); }
+
void setTransform(const TransformationMatrix& transform) { m_transform = transform; setNeedsCommit(); }
const TransformationMatrix& transform() const { return m_transform; }
IntSize scrollDelta() const { return IntSize(); }
+ float scaleDelta() const { return 1; }
+
bool doubleSided() const { return m_doubleSided; }
void setDoubleSided(bool doubleSided) { m_doubleSided = doubleSided; setNeedsCommit(); }
m_defaultRenderSurface = rootDrawLayer->renderSurface();
m_defaultRenderSurface->clearLayerList();
- TransformationMatrix magnifyMatrix(m_pageMagnifyMatrix);
- // TODO(aelias): These two transformations are redundant; unify zoomAnimator
- // and impl-thread side matrix.
- magnifyMatrix.multiply(m_zoomAnimatorTransform);
-
+ TransformationMatrix identityMatrix;
{
TRACE_EVENT("LayerRendererChromium::drawLayersInternal::calcDrawEtc", this, 0);
- CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootDrawLayer, rootDrawLayer, magnifyMatrix, magnifyMatrix, renderSurfaceLayerList, m_defaultRenderSurface->layerList(), &m_layerSorter, m_capabilities.maxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootDrawLayer, rootDrawLayer, identityMatrix, identityMatrix, renderSurfaceLayerList, m_defaultRenderSurface->layerList(), &m_layerSorter, m_capabilities.maxTextureSize);
}
// The GL viewport covers the entire visible area, including the scrollbars.
useRenderSurface(m_defaultRenderSurface);
- if (m_zoomAnimatorTransform.isIdentity())
- // Clear to blue to make it easier to spot unrendered regions.
- m_context->clearColor(0, 0, 1, 1);
- else
- // Clear to grey, as zoom animation may leave unrendered regions.
- // FIXME(wjmaclean): Render some interesting texture in unrendered regions.
- m_context->clearColor(0.25, 0.25, 0.25, 1);
+ // Clear to blue to make it easier to spot unrendered regions.
+ m_context->clearColor(0, 0, 1, 1);
m_context->colorMask(true, true, true, true);
m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
void viewportChanged();
- void setPageMagnifyTransform(const TransformationMatrix& pageMagnifyMatrix) { m_pageMagnifyMatrix = pageMagnifyMatrix; }
-
void drawLayers();
// waits for rendering to finish
// puts backbuffer onscreen
void swapBuffers();
- void setZoomAnimatorTransform(const TransformationMatrix& t) { m_zoomAnimatorTransform = t; }
-
static void debugGLCall(GraphicsContext3D*, const char* command, const char* file, int line);
const TransformationMatrix& projectionMatrix() const { return m_projectionMatrix; }
TransformationMatrix m_projectionMatrix;
TransformationMatrix m_windowMatrix;
- TransformationMatrix m_pageMagnifyMatrix;
CCRenderSurface* m_currentRenderSurface;
unsigned m_offscreenFramebufferId;
- TransformationMatrix m_zoomAnimatorTransform;
// Store values that are shared between instances of each layer type
// associated with this instance of the compositor. Since there can be
, m_usesLayerClipping(false)
, m_isNonCompositedContent(false)
, m_drawsContent(false)
+ , m_scaleDelta(1)
, m_targetRenderSurface(0)
, m_drawDepth(0)
, m_drawOpacity(0)
}
}
+void CCLayerImpl::setZoomAnimatorTransform(const TransformationMatrix& zoomAnimatorTransform)
+{
+ if (m_zoomAnimatorTransform != zoomAnimatorTransform) {
+ m_zoomAnimatorTransform = zoomAnimatorTransform;
+ noteLayerPropertyChangedForSubtree();
+ }
+}
+
+
void CCLayerImpl::setSublayerTransform(const TransformationMatrix& sublayerTransform)
{
if (m_sublayerTransform != sublayerTransform) {
}
}
+void CCLayerImpl::setScaleDelta(float scaleDelta)
+{
+ if (m_scaleDelta != scaleDelta) {
+ m_scaleDelta = scaleDelta;
+ noteLayerPropertyChangedForSubtree();
+ }
+}
+
void CCLayerImpl::setDoubleSided(bool doubleSided)
{
if (m_doubleSided != doubleSided) {
void setTransform(const TransformationMatrix&);
const TransformationMatrix& transform() const { return m_transform; }
+ void setZoomAnimatorTransform(const TransformationMatrix&);
+ const TransformationMatrix& zoomAnimatorTransform() const { return m_zoomAnimatorTransform; }
+
void setName(const String& name) { m_name = name; }
const String& name() const { return m_name; }
const IntSize& scrollDelta() const { return m_scrollDelta; }
void setScrollDelta(const IntSize&);
+ float scaleDelta() const { return m_scaleDelta; }
+ void setScaleDelta(float);
+
void scrollBy(const IntSize& scroll);
bool scrollable() const { return m_scrollable; }
float m_opacity;
FloatPoint m_position;
bool m_preserves3D;
+ TransformationMatrix m_zoomAnimatorTransform;
TransformationMatrix m_sublayerTransform;
TransformationMatrix m_transform;
bool m_usesLayerClipping;
IntSize m_scrollDelta;
IntSize m_maxScrollPosition;
+ float m_scaleDelta;
// Properties owned exclusively by this CCLayerImpl.
// Debugging.
RenderSurfaceChromium* rootRenderSurface = rootLayer->renderSurface();
rootRenderSurface->clearLayerList();
+ TransformationMatrix identityMatrix;
{
TRACE_EVENT("CCLayerTreeHost::updateLayers::calcDrawEtc", this, 0);
- CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootLayer, rootLayer, m_zoomAnimatorTransform, m_zoomAnimatorTransform, m_updateList, rootRenderSurface->layerList(), layerRendererCapabilities().maxTextureSize);
+ CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootLayer, rootLayer, identityMatrix, identityMatrix, m_updateList, rootRenderSurface->layerList(), layerRendererCapabilities().maxTextureSize);
}
paintLayerContents(m_updateList);
float centerOffsetY = (0.5 - anchorPoint.y()) * bounds.height();
TransformationMatrix layerLocalTransform;
- // LT = Tr[origin] * Tr[origin2anchor]
+ // LT = Tr[origin] * M[zoomAnimator]
+ layerLocalTransform.multiply(layer->zoomAnimatorTransform());
+ // LT = Tr[origin] * M[zoomAnimator] * S[scaleDelta]
+ layerLocalTransform.scale(layer->scaleDelta());
+ // LT = Tr[origin] * M[zoomAnimator] * S[scaleDelta] * Tr[origin2anchor]
layerLocalTransform.translate3d(position.x(), position.y(), layer->anchorPointZ());
- // LT = Tr[origin] * Tr[origin2anchor] * M[layer]
+ // LT = Tr[origin] * M[zoomAnimator] * S[scaleDelta] * Tr[origin2anchor] * M[layer]
layerLocalTransform.multiply(layer->transform());
- // LT = Tr[origin] * Tr[origin2anchor] * M[layer] * Tr[anchor2center]
+ // LT = Tr[origin] * M[zoomAnimator] * S[scaleDelta] * Tr[origin2anchor] * M[layer] * Tr[anchor2center]
layerLocalTransform.translate3d(centerOffsetX, centerOffsetY, -layer->anchorPointZ());
TransformationMatrix combinedTransform = parentMatrix;
updateMaxScrollPosition();
- TransformationMatrix deltaMatrix;
- deltaMatrix.scale(m_scaleDelta);
- m_layerRenderer->setPageMagnifyTransform(deltaMatrix);
+ if (m_scrollLayerImpl && m_scrollLayerImpl->scrollable())
+ m_scrollLayerImpl->setScaleDelta(m_scaleDelta);
}
void CCLayerTreeHostImpl::setPageScaleFactorLimits(float minPageScale, float maxPageScale)
void CCLayerTreeHostImpl::setZoomAnimatorTransform(const TransformationMatrix& zoom)
{
- m_layerRenderer->setZoomAnimatorTransform(zoom);
+ if (!m_scrollLayerImpl)
+ return;
+
+ m_scrollLayerImpl->setZoomAnimatorTransform(zoom);
}
void CCLayerTreeHostImpl::scrollRootLayer(const IntSize& scrollDelta)
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setPosition(arbitraryFloatPoint));
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setPreserves3D(true));
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setTransform(arbitraryTransform));
+ EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setZoomAnimatorTransform(arbitraryTransform));
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setDoubleSided(false)); // constructor initializes it to "true".
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->scrollBy(arbitraryIntSize));
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setScrollDelta(arbitraryIntSize));
EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setScrollPosition(arbitraryIntPoint));
+ EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->setScaleDelta(arbitraryNumber));
// Changing these properties only affects the layer itself.
EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->setContentBounds(arbitraryIntSize));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setReplicaLayer(dummyReplica));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setPosition(arbitraryFloatPoint));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setPreserves3D(true));
+ EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setZoomAnimatorTransform(arbitraryTransform));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setTransform(arbitraryTransform));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setDoubleSided(false)); // constructor initializes it to "true".
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setScrollDelta(arbitraryIntSize));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setScrollPosition(arbitraryIntPoint));
+ EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setScaleDelta(arbitraryNumber));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setContentBounds(arbitraryIntSize));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setOpaque(true));
EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->setOpacity(arbitraryNumber));