Diff
Modified: trunk/Source/Platform/ChangeLog (127788 => 127789)
--- trunk/Source/Platform/ChangeLog 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/Platform/ChangeLog 2012-09-06 22:23:29 UTC (rev 127789)
@@ -1,3 +1,18 @@
+2012-09-06 Jeff Timanus <[email protected]>
+
+ [Chromium] Remove contentsScale and related logic from GraphicsLayerChromium.
+ https://bugs.webkit.org/show_bug.cgi?id=95094
+
+ Reviewed by Adrienne Walker.
+
+ In the short term, the page-scale logic is to be unified in the CCLayerTreeHost class. This is a first pass to
+ try to remove the page-scale logic from GraphicsLayerChromium. This change should be a no-op in terms of
+ contentsScale behaviour.
+
+ * chromium/public/WebContentLayer.h:
+ (WebContentLayer):
+ Export setBoundsContainPageScale() family of routines.
+
2012-09-06 Tommy Widenflycht <[email protected]>
MediaStream API: Add the local and remote description functionality to RTCPeerConnection
Modified: trunk/Source/Platform/chromium/public/WebContentLayer.h (127788 => 127789)
--- trunk/Source/Platform/chromium/public/WebContentLayer.h 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/Platform/chromium/public/WebContentLayer.h 2012-09-06 22:23:29 UTC (rev 127789)
@@ -45,8 +45,8 @@
// Defaults to false.
virtual void setDoubleSided(bool) = 0;
- // Set to apply a scale factor used when painting and drawing this layer's content. Defaults to 1.0.
- virtual void setContentsScale(float) = 0;
+ virtual void setBoundsContainPageScale(bool) = 0;
+ virtual bool boundsContainPageScale() const = 0;
// Set to render text in this layer with LCD antialiasing. Only set if you know that this layer will be
// drawn in a way where this makes sense - i.e. opaque background, not rotated or scaled, etc.
Modified: trunk/Source/WebCore/ChangeLog (127788 => 127789)
--- trunk/Source/WebCore/ChangeLog 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebCore/ChangeLog 2012-09-06 22:23:29 UTC (rev 127789)
@@ -1,3 +1,49 @@
+2012-09-06 Jeff Timanus <[email protected]>
+
+ [Chromium] Remove contentsScale and related logic from GraphicsLayerChromium.
+ https://bugs.webkit.org/show_bug.cgi?id=95094
+
+ Reviewed by Adrienne Walker.
+
+ In the short term, the page-scale logic is to be unified in the CCLayerTreeHost class. This is a first pass to
+ try to remove the page-scale logic from GraphicsLayerChromium. This change should be a no-op in terms of
+ contentsScale behaviour.
+
+ Testing covered by existing compositor layout and unit tests.
+
+ * platform/graphics/GraphicsLayer.h:
+ (WebCore::GraphicsLayer::setAppliesPageScale):
+ (WebCore::GraphicsLayer::appliesPageScale):
+ These routines are now virtual, so that they can push the notification to setDisregardsContentsScale in
+ LayerChromium.
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::GraphicsLayerChromium):
+ (WebCore::GraphicsLayerChromium::setSize):
+ (WebCore::GraphicsLayerChromium::setTransform):
+ (WebCore::GraphicsLayerChromium::updateLayerPreserves3D):
+ (WebCore):
+ (WebCore::GraphicsLayerChromium::setAppliesPageScale):
+ (WebCore::GraphicsLayerChromium::appliesPageScale):
+ Now forwards the appliesPageScaleStatus to the owned layer.
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+ (GraphicsLayerChromium):
+ (WebCore::GraphicsLayerChromium::contentsLayer):
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::LayerChromium):
+ (WebCore::LayerChromium::setContentsScale):
+ (WebCore):
+ (WebCore::LayerChromium::setBoundsContainPageScale):
+ setAppliesPageScale is renamed to setBoundsContainPageScale in LayerChromium.
+ * platform/graphics/chromium/LayerChromium.h:
+ (LayerChromium):
+ (WebCore::LayerChromium::boundsContainPageScale):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore):
+ (WebCore::setScale):
+ (WebCore::updateLayerScale):
+ (WebCore::CCLayerTreeHost::updateLayers):
+ The contents scale of a layer is now applied in this routine.
+
2012-09-06 James Robinson <[email protected]>
[chromium] Split platform geometry types into separate static target
@@ -1917,6 +1963,7 @@
(WebCore::RTCPeerConnectionHandlerDummy::RTCPeerConnectionHandlerDummy):
Use ASSERT_UNUSED() to suppress -Wunused-private-field warning
+>>>>>>> .r127747
2012-09-05 Patrick Gansterer <[email protected]>
Build fix for Windows.
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (127788 => 127789)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2012-09-06 22:23:29 UTC (rev 127789)
@@ -368,8 +368,8 @@
virtual void setMaintainsPixelAlignment(bool maintainsAlignment) { m_maintainsPixelAlignment = maintainsAlignment; }
virtual bool maintainsPixelAlignment() const { return m_maintainsPixelAlignment; }
- void setAppliesPageScale(bool appliesScale = true) { m_appliesPageScale = appliesScale; }
- bool appliesPageScale() const { return m_appliesPageScale; }
+ virtual void setAppliesPageScale(bool appliesScale = true) { m_appliesPageScale = appliesScale; }
+ virtual bool appliesPageScale() const { return m_appliesPageScale; }
float pageScaleFactor() const { return m_client ? m_client->pageScaleFactor() : 1; }
float deviceScaleFactor() const { return m_client ? m_client->deviceScaleFactor() : 1; }
@@ -501,4 +501,3 @@
#endif // USE(ACCELERATED_COMPOSITING)
#endif // GraphicsLayer_h
-
Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp (127788 => 127789)
--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp 2012-09-06 22:23:29 UTC (rev 127789)
@@ -90,7 +90,6 @@
, m_contentsLayerPurpose(NoContentsLayer)
, m_contentsLayerHasBackgroundColor(false)
, m_inSetChildren(false)
- , m_pageScaleChanged(false)
, m_scrollableArea(0)
{
m_opaqueRectTrackingContentLayerDelegate = adoptPtr(new OpaqueRectTrackingContentLayerDelegate(this));
@@ -102,8 +101,6 @@
m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible);
m_layer->layer()->setScrollClient(this);
- if (client)
- deviceOrPageScaleFactorChanged();
updateDebugIndicators();
}
@@ -227,20 +224,10 @@
GraphicsLayer::setSize(clampedSize);
updateLayerSize();
-
- if (m_pageScaleChanged) {
- m_layer->layer()->invalidate();
- if (m_linkHighlight)
- m_linkHighlight->invalidate();
- }
- m_pageScaleChanged = false;
}
void GraphicsLayerChromium::setTransform(const TransformationMatrix& transform)
{
- // Call this method first to assign contents scale to our layer so the painter can apply the scale transform.
- updateContentsScale();
-
GraphicsLayer::setTransform(transform);
updateTransform();
}
@@ -759,8 +746,6 @@
// Set the old layer to opacity of 1. Further down we will set the opacity on the transform layer.
m_layer->layer()->setOpacity(1);
- m_layer->setContentsScale(contentsScale());
-
// Move this layer to be a child of the transform layer.
if (parent())
parent()->platformLayer()->replaceChild(m_layer->layer(), m_transformLayer.get());
@@ -842,15 +827,6 @@
contentsLayer->setBounds(IntSize(m_contentsRect.width(), m_contentsRect.height()));
}
-void GraphicsLayerChromium::updateContentsScale()
-{
- // If page scale is already applied then there's no need to apply it again.
- if (appliesPageScale())
- return;
-
- m_layer->setContentsScale(contentsScale());
-}
-
void GraphicsLayerChromium::setupContentsLayer(WebLayer* contentsLayer)
{
m_contentsLayer = contentsLayer;
@@ -877,20 +853,14 @@
updateNames();
}
-float GraphicsLayerChromium::contentsScale() const
+void GraphicsLayerChromium::setAppliesPageScale(bool appliesScale)
{
- if (!appliesPageScale())
- return pageScaleFactor() * deviceScaleFactor();
- return 1;
+ m_layer->setBoundsContainPageScale(appliesScale);
}
-void GraphicsLayerChromium::deviceOrPageScaleFactorChanged()
+bool GraphicsLayerChromium::appliesPageScale() const
{
- updateContentsScale();
- // Invalidations are clamped to the layer's bounds but we receive the scale changed notification before receiving
- // the new layer bounds. When the scale changes, we really want to invalidate the post-scale layer bounds, so we
- // remember that the scale has changed and then invalidate the full layer bounds when we receive the new size.
- m_pageScaleChanged = true;
+ return m_layer->boundsContainPageScale();
}
void GraphicsLayerChromium::paint(GraphicsContext& context, const IntRect& clip)
Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h (127788 => 127789)
--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h 2012-09-06 22:23:29 UTC (rev 127789)
@@ -133,8 +133,10 @@
virtual void setDebugBackgroundColor(const Color&);
virtual void setDebugBorder(const Color&, float borderWidth);
- virtual void deviceOrPageScaleFactorChanged();
+ virtual void setAppliesPageScale(bool appliesScale) OVERRIDE;
+ virtual bool appliesPageScale() const OVERRIDE;
+
void setScrollableArea(ScrollableArea* scrollableArea) { m_scrollableArea = scrollableArea; }
ScrollableArea* scrollableArea() const { return m_scrollableArea; }
@@ -152,7 +154,6 @@
// Exposed for tests.
WebKit::WebLayer* contentsLayer() const { return m_contentsLayer; }
- float contentsScale() const;
private:
void updateNames();
@@ -170,7 +171,6 @@
void updateContentsImage();
void updateContentsVideo();
void updateContentsRect();
- void updateContentsScale();
enum ContentsLayerPurpose {
NoContentsLayer = 0,
@@ -203,7 +203,6 @@
ContentsLayerPurpose m_contentsLayerPurpose;
bool m_contentsLayerHasBackgroundColor : 1;
bool m_inSetChildren;
- bool m_pageScaleChanged;
typedef HashMap<String, int> AnimationIdMap;
AnimationIdMap m_animationIdMap;
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp (127788 => 127789)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp 2012-09-06 22:23:29 UTC (rev 127789)
@@ -92,6 +92,7 @@
, m_drawTransformIsAnimating(false)
, m_screenSpaceTransformIsAnimating(false)
, m_contentsScale(1.0)
+ , m_boundsContainPageScale(false)
, m_layerAnimationDelegate(0)
, m_layerScrollClient(0)
{
@@ -617,9 +618,19 @@
if (!needsContentsScale() || m_contentsScale == contentsScale)
return;
m_contentsScale = contentsScale;
+
setNeedsDisplay();
}
+void LayerChromium::setBoundsContainPageScale(bool boundsContainPageScale)
+{
+ if (boundsContainPageScale == m_boundsContainPageScale)
+ return;
+
+ m_boundsContainPageScale = boundsContainPageScale;
+ setNeedsDisplay();
+}
+
void LayerChromium::createRenderSurface()
{
ASSERT(!m_renderSurface);
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h (127788 => 127789)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h 2012-09-06 22:23:29 UTC (rev 127789)
@@ -250,6 +250,10 @@
float contentsScale() const { return m_contentsScale; }
void setContentsScale(float);
+ // When true, the layer's contents are not scaled by the current page scale factor.
+ void setBoundsContainPageScale(bool);
+ bool boundsContainPageScale() const { return m_boundsContainPageScale; }
+
// Returns true if any of the layer's descendants has content to draw.
bool descendantDrawsContent();
@@ -385,6 +389,7 @@
// Uses target surface space.
IntRect m_drawableContentRect;
float m_contentsScale;
+ bool m_boundsContainPageScale;
WebKit::WebAnimationDelegate* m_layerAnimationDelegate;
WebKit::WebLayerScrollClient* m_layerScrollClient;
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (127788 => 127789)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp 2012-09-06 22:23:29 UTC (rev 127789)
@@ -464,7 +464,6 @@
return true;
}
-
void CCLayerTreeHost::updateLayers(CCTextureUpdateQueue& queue, size_t memoryAllocationLimitBytes)
{
ASSERT(m_rendererInitialized);
@@ -481,10 +480,37 @@
updateLayers(rootLayer(), queue);
}
+static void setScale(LayerChromium* layer, float deviceScaleFactor, float pageScaleFactor)
+{
+ if (layer->boundsContainPageScale())
+ layer->setContentsScale(deviceScaleFactor);
+ else
+ layer->setContentsScale(deviceScaleFactor * pageScaleFactor);
+}
+
+static void updateLayerScale(LayerChromium* layer, float deviceScaleFactor, float pageScaleFactor)
+{
+ setScale(layer, deviceScaleFactor, pageScaleFactor);
+
+ LayerChromium* maskLayer = layer->maskLayer();
+ if (maskLayer)
+ setScale(maskLayer, deviceScaleFactor, pageScaleFactor);
+
+ LayerChromium* replicaMaskLayer = layer->replicaLayer() ? layer->replicaLayer()->maskLayer() : 0;
+ if (replicaMaskLayer)
+ setScale(replicaMaskLayer, deviceScaleFactor, pageScaleFactor);
+
+ const Vector<RefPtr<LayerChromium> >& children = layer->children();
+ for (unsigned int i = 0; i < children.size(); ++i)
+ updateLayerScale(children[i].get(), deviceScaleFactor, pageScaleFactor);
+}
+
void CCLayerTreeHost::updateLayers(LayerChromium* rootLayer, CCTextureUpdateQueue& queue)
{
TRACE_EVENT0("cc", "CCLayerTreeHost::updateLayers");
+ updateLayerScale(rootLayer, m_deviceScaleFactor, m_pageScaleFactor);
+
LayerList updateList;
{
Modified: trunk/Source/WebKit/chromium/ChangeLog (127788 => 127789)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-09-06 22:23:29 UTC (rev 127789)
@@ -1,3 +1,41 @@
+2012-09-06 Jeff Timanus <[email protected]>
+
+ [Chromium] Remove contentsScale and related logic from GraphicsLayerChromium.
+ https://bugs.webkit.org/show_bug.cgi?id=95094
+
+ Reviewed by Adrienne Walker.
+
+ In the short term, the page-scale logic is to be unified in the CCLayerTreeHost class. This is a first pass to
+ try to remove the page-scale logic from GraphicsLayerChromium. This change should be a no-op in terms of
+ contentsScale behaviour.
+ This change exports the disregardsPageScale() set of functions from WebContentLayer to LayerChromium.
+
+ * src/NonCompositedContentHost.cpp:
+ (WebKit::NonCompositedContentHost::NonCompositedContentHost):
+ Inform the layer associated with the NCCH that it is to disregard the page scale factor.
+ Also remove now unused m_deviceScaleFactor and associated routines.
+ (WebKit::NonCompositedContentHost::setViewport):
+ * src/NonCompositedContentHost.h:
+ (NonCompositedContentHost):
+ * src/WebContentLayerImpl.cpp:
+ (WebKit::WebContentLayerImpl::setBoundsContainPageScale):
+ (WebKit):
+ (WebKit::WebContentLayerImpl::boundsContainPageScale):
+ * src/WebContentLayerImpl.h:
+ (WebContentLayerImpl):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::updateLayerTreeViewport):
+ * tests/CCLayerTreeHostTest.cpp:
+ (NoScaleContentLayerChromium):
+ (WebKitTests::NoScaleContentLayerChromium::create):
+ (WebKitTests::NoScaleContentLayerChromium::NoScaleContentLayerChromium):
+ (WebKitTests):
+ (WebKitTests::CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers::CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers):
+ Rebaselined to correspond to the new behaviour. Because the layers are now assigned a contentsScale, the
+ scale on the draw transforms remain identity.
+ * tests/GraphicsLayerChromiumTest.cpp:
+ (WebKit): Remove now obsolete unit-test.
+
2012-09-06 Adrienne Walker <[email protected]>
[chromium] Remove Scrollbar/Settings dependencies from ScrollbarLayerChromiumTest
Modified: trunk/Source/WebKit/chromium/src/NonCompositedContentHost.cpp (127788 => 127789)
--- trunk/Source/WebKit/chromium/src/NonCompositedContentHost.cpp 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebKit/chromium/src/NonCompositedContentHost.cpp 2012-09-06 22:23:29 UTC (rev 127789)
@@ -42,13 +42,13 @@
: m_webView(webView)
, m_opaque(true)
, m_showDebugBorders(false)
- , m_deviceScaleFactor(1.0)
{
m_graphicsLayer = WebCore::GraphicsLayer::create(this);
#ifndef NDEBUG
m_graphicsLayer->setName("non-composited content");
#endif
m_graphicsLayer->setDrawsContent(true);
+ m_graphicsLayer->setAppliesPageScale(true);
WebContentLayer* layer = static_cast<WebCore::GraphicsLayerChromium*>(m_graphicsLayer.get())->contentLayer();
layer->setUseLCDText(true);
layer->layer()->setOpaque(true);
@@ -88,7 +88,7 @@
ASSERT(haveScrollLayer());
}
-void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, float deviceScale)
+void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin)
{
if (!haveScrollLayer())
return;
@@ -102,8 +102,6 @@
// Due to the possibility of pinch zoom, the noncomposited layer is always
// assumed to be scrollable.
layer->setScrollable(true);
- m_deviceScaleFactor = deviceScale;
- m_graphicsLayer->deviceOrPageScaleFactorChanged();
m_graphicsLayer->setSize(contentsSize);
// In RTL-style pages, the origin of the initial containing block for the
Modified: trunk/Source/WebKit/chromium/src/NonCompositedContentHost.h (127788 => 127789)
--- trunk/Source/WebKit/chromium/src/NonCompositedContentHost.h 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebKit/chromium/src/NonCompositedContentHost.h 2012-09-06 22:23:29 UTC (rev 127789)
@@ -58,7 +58,7 @@
void setBackgroundColor(const WebCore::Color&);
void setOpaque(bool);
void setScrollLayer(WebCore::GraphicsLayer*);
- void setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, float deviceScale);
+ void setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin);
WebCore::GraphicsLayer* topLevelRootLayer() const { return m_graphicsLayer.get(); }
void setShowDebugBorders(bool);
@@ -73,11 +73,6 @@
virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect);
virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const;
virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const;
- // The deviceScaleFactor given to the GraphicsLayer can be non-1 when the
- // contents are scaled in the compositor instead of by the pageScaleFactor.
- // However, the pageScaleFactor is always baked into the GraphicsLayer's
- // size, so it is always 1 for the GraphicsLayer.
- virtual float deviceScaleFactor() const OVERRIDE { return m_deviceScaleFactor; }
bool haveScrollLayer();
WebLayer* scrollLayer();
@@ -89,7 +84,6 @@
bool m_opaque;
bool m_showDebugBorders;
- float m_deviceScaleFactor;
};
} // namespace WebKit
Modified: trunk/Source/WebKit/chromium/src/WebContentLayerImpl.cpp (127788 => 127789)
--- trunk/Source/WebKit/chromium/src/WebContentLayerImpl.cpp 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebKit/chromium/src/WebContentLayerImpl.cpp 2012-09-06 22:23:29 UTC (rev 127789)
@@ -65,11 +65,16 @@
m_layer->layer()->setDoubleSided(doubleSided);
}
-void WebContentLayerImpl::setContentsScale(float scale)
+void WebContentLayerImpl::setBoundsContainPageScale(bool boundsContainPageScale)
{
- m_layer->layer()->setContentsScale(scale);
+ return m_layer->layer()->setBoundsContainPageScale(boundsContainPageScale);
}
+bool WebContentLayerImpl::boundsContainPageScale() const
+{
+ return m_layer->layer()->boundsContainPageScale();
+}
+
void WebContentLayerImpl::setUseLCDText(bool enable)
{
m_layer->layer()->setUseLCDText(enable);
Modified: trunk/Source/WebKit/chromium/src/WebContentLayerImpl.h (127788 => 127789)
--- trunk/Source/WebKit/chromium/src/WebContentLayerImpl.h 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebKit/chromium/src/WebContentLayerImpl.h 2012-09-06 22:23:29 UTC (rev 127789)
@@ -42,7 +42,8 @@
// WebContentLayer implementation.
virtual WebLayer* layer() OVERRIDE;
virtual void setDoubleSided(bool) OVERRIDE;
- virtual void setContentsScale(float) OVERRIDE;
+ virtual void setBoundsContainPageScale(bool) OVERRIDE;
+ virtual bool boundsContainPageScale() const OVERRIDE;
virtual void setUseLCDText(bool) OVERRIDE;
virtual void setDrawCheckerboardForMissingTiles(bool) OVERRIDE;
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (127788 => 127789)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-09-06 22:23:29 UTC (rev 127789)
@@ -3981,14 +3981,14 @@
IntRect visibleRect = view->visibleContentRect(true /* include scrollbars */);
IntPoint scroll(view->scrollX(), view->scrollY());
- // This part of the deviceScale will be used to scale the contents of
- // the NCCH's GraphicsLayer.
- float deviceScale = m_deviceScaleInCompositor;
- m_nonCompositedContentHost->setViewport(visibleRect.size(), view->contentsSize(), scroll, view->scrollOrigin(), deviceScale);
+ m_nonCompositedContentHost->setViewport(visibleRect.size(), view->contentsSize(), scroll, view->scrollOrigin());
IntSize layoutViewportSize = size();
IntSize deviceViewportSize = size();
- deviceViewportSize.scale(deviceScale);
+
+ // This part of the deviceScale will be used to scale the contents of
+ // the NCCH's GraphicsLayer.
+ deviceViewportSize.scale(m_deviceScaleInCompositor);
m_layerTreeView->setViewportSize(layoutViewportSize, deviceViewportSize);
m_layerTreeView->setPageScaleFactorAndLimits(pageScaleFactor(), m_minimumPageScaleFactor, m_maximumPageScaleFactor);
}
Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (127788 => 127789)
--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp 2012-09-06 22:23:29 UTC (rev 127789)
@@ -1279,11 +1279,22 @@
void notifySyncRequired() { }
};
+class NoScaleContentLayerChromium : public ContentLayerChromium {
+public:
+ static PassRefPtr<NoScaleContentLayerChromium> create(ContentLayerChromiumClient* client) { return adoptRef(new NoScaleContentLayerChromium(client)); }
+
+ virtual bool needsContentsScale() const OVERRIDE { return false; }
+
+private:
+ explicit NoScaleContentLayerChromium(ContentLayerChromiumClient* client)
+ : ContentLayerChromium(client) { }
+};
+
class CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers : public CCLayerTreeHostTest {
public:
CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers()
- : m_rootLayer(ContentLayerChromium::create(&m_client))
+ : m_rootLayer(NoScaleContentLayerChromium::create(&m_client))
, m_childLayer(ContentLayerChromium::create(&m_client))
{
}
@@ -1345,6 +1356,11 @@
// The root render surface is the size of the viewport.
EXPECT_RECT_EQ(IntRect(0, 0, 60, 60), root->renderSurface()->contentRect());
+ // The content bounds of the child should be scaled.
+ IntSize childBoundsScaled = child->bounds();
+ childBoundsScaled.scale(1.5);
+ EXPECT_EQ(childBoundsScaled, child->contentBounds());
+
WebTransformationMatrix scaleTransform;
scaleTransform.scale(impl->deviceScaleFactor());
@@ -1355,11 +1371,10 @@
EXPECT_EQ(rootDrawTransform, root->drawTransform());
EXPECT_EQ(rootScreenSpaceTransform, root->screenSpaceTransform());
- // The child is at position 2,2, so translate by 2,2 before applying the scale by 2x.
- WebTransformationMatrix childScreenSpaceTransform = scaleTransform;
- childScreenSpaceTransform.translate(2, 2);
- WebTransformationMatrix childDrawTransform = scaleTransform;
- childDrawTransform.translate(2, 2);
+ // The child is at position 2,2, which is transformed to 3,3 after the scale
+ WebTransformationMatrix childScreenSpaceTransform;
+ childScreenSpaceTransform.translate(3, 3);
+ WebTransformationMatrix childDrawTransform = childScreenSpaceTransform;
EXPECT_EQ(childDrawTransform, child->drawTransform());
EXPECT_EQ(childScreenSpaceTransform, child->screenSpaceTransform());
@@ -1375,7 +1390,7 @@
private:
MockContentLayerChromiumClient m_client;
- RefPtr<ContentLayerChromium> m_rootLayer;
+ RefPtr<NoScaleContentLayerChromium> m_rootLayer;
RefPtr<ContentLayerChromium> m_childLayer;
};
Modified: trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp (127788 => 127789)
--- trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp 2012-09-06 22:07:34 UTC (rev 127788)
+++ trunk/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp 2012-09-06 22:23:29 UTC (rev 127789)
@@ -122,11 +122,6 @@
ASSERT_FALSE(m_platformLayer->hasActiveAnimation());
}
-TEST_F(GraphicsLayerChromiumTest, shouldStartWithCorrectContentsScale)
-{
- EXPECT_EQ(2, m_graphicsLayer->contentsScale());
-}
-
class FakeScrollableArea : public ScrollableArea {
public:
virtual bool isActive() const OVERRIDE { return false; }