Remove codes related to scaling in GraphicsLayer tree.

There are three kind of codes:
1. getters of page/device scale.
2. callbacks when page/device scale is changed.
3. layer pixel aligned booleans.

All codes are not used, so this patch removes all.

BUG=

Review URL: https://chromiumcodereview.appspot.com/14974003

git-svn-id: svn://svn.chromium.org/blink/trunk@150298 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/Source/WebKit/chromium/src/PageOverlay.cpp b/Source/WebKit/chromium/src/PageOverlay.cpp
index 566f7a5..b2560a7 100644
--- a/Source/WebKit/chromium/src/PageOverlay.cpp
+++ b/Source/WebKit/chromium/src/PageOverlay.cpp
@@ -66,9 +66,9 @@
 
 class OverlayGraphicsLayerClientImpl : public WebCore::GraphicsLayerClient {
 public:
-    static PassOwnPtr<OverlayGraphicsLayerClientImpl*> create(WebViewImpl* webViewImpl, WebPageOverlay* overlay)
+    static PassOwnPtr<OverlayGraphicsLayerClientImpl*> create(WebPageOverlay* overlay)
     {
-        return adoptPtr(new OverlayGraphicsLayerClientImpl(webViewImpl, overlay));
+        return adoptPtr(new OverlayGraphicsLayerClientImpl(overlay));
     }
 
     virtual ~OverlayGraphicsLayerClientImpl() { }
@@ -82,25 +82,13 @@
         gc.restore();
     }
 
-    virtual float deviceScaleFactor() const
-    {
-        return m_webViewImpl->deviceScaleFactor();
-    }
-
-    virtual float pageScaleFactor() const
-    {
-        return m_webViewImpl->pageScaleFactor();
-    }
-
 private:
-    OverlayGraphicsLayerClientImpl(WebViewImpl* webViewImpl, WebPageOverlay* overlay)
+    explicit OverlayGraphicsLayerClientImpl(WebPageOverlay* overlay)
         : m_overlay(overlay)
-        , m_webViewImpl(webViewImpl)
     {
     }
 
     WebPageOverlay* m_overlay;
-    WebViewImpl* m_webViewImpl;
 };
 
 void PageOverlay::clear()
@@ -119,7 +107,7 @@
     invalidateWebFrame();
 
     if (!m_layer) {
-        m_layerClient = OverlayGraphicsLayerClientImpl::create(m_viewImpl, m_overlay);
+        m_layerClient = OverlayGraphicsLayerClientImpl::create(m_overlay);
         m_layer = GraphicsLayer::create(m_viewImpl->graphicsLayerFactory(), m_layerClient.get());
         m_layer->setName("WebViewImpl page overlay content");
         m_layer->setDrawsContent(true);
diff --git a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp
index ec05925..8cb03d4 100644
--- a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp
+++ b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp
@@ -50,7 +50,6 @@
   public:
     virtual void notifyAnimationStarted(const GraphicsLayer*, double time) OVERRIDE { }
     virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) OVERRIDE { }
-    virtual float deviceScaleFactor() const OVERRIDE { return 2; }
 };
 
 class GraphicsLayerChromiumTest : public testing::Test {
diff --git a/Source/core/page/Frame.cpp b/Source/core/page/Frame.cpp
index d1c1c37..850cfdd 100644
--- a/Source/core/page/Frame.cpp
+++ b/Source/core/page/Frame.cpp
@@ -656,10 +656,6 @@
     for (RefPtr<Frame> child = tree()->firstChild(); child; child = child->tree()->nextSibling())
         child->deviceOrPageScaleFactorChanged();
 
-    RenderView* root = contentRenderer();
-    if (root && root->compositor())
-        root->compositor()->deviceOrPageScaleFactorChanged();
-
     m_page->chrome()->client()->deviceOrPageScaleFactorChanged();
 }
 
diff --git a/Source/core/platform/graphics/GraphicsLayer.cpp b/Source/core/platform/graphics/GraphicsLayer.cpp
index f6789b8..cbccc1f 100644
--- a/Source/core/platform/graphics/GraphicsLayer.cpp
+++ b/Source/core/platform/graphics/GraphicsLayer.cpp
@@ -114,7 +114,6 @@
     , m_masksToBounds(false)
     , m_drawsContent(false)
     , m_contentsVisible(true)
-    , m_maintainsPixelAlignment(false)
     , m_showDebugBorder(false)
     , m_showRepaintCounter(false)
     , m_paintingPhase(GraphicsLayerPaintAllWithOverflowClip)
@@ -327,22 +326,6 @@
     platformLayer()->removeFromParent();
 }
 
-void GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants()
-{
-    deviceOrPageScaleFactorChanged();
-
-    if (m_maskLayer)
-        m_maskLayer->deviceOrPageScaleFactorChanged();
-
-    if (m_replicaLayer)
-        m_replicaLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
-
-    const Vector<GraphicsLayer*>& childLayers = children();
-    size_t numChildren = childLayers.size();
-    for (size_t i = 0; i < numChildren; ++i)
-        childLayers[i]->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
-}
-
 void GraphicsLayer::setReplicatedByLayer(GraphicsLayer* layer)
 {
     // FIXME: this could probably be a full early exit.
diff --git a/Source/core/platform/graphics/GraphicsLayer.h b/Source/core/platform/graphics/GraphicsLayer.h
index 114a269..621578d 100644
--- a/Source/core/platform/graphics/GraphicsLayer.h
+++ b/Source/core/platform/graphics/GraphicsLayer.h
@@ -406,15 +406,6 @@
     void distributeOpacity(float);
     float accumulatedOpacity() const;
 
-    void setMaintainsPixelAlignment(bool maintainsAlignment) { m_maintainsPixelAlignment = maintainsAlignment; }
-    bool maintainsPixelAlignment() const { return m_maintainsPixelAlignment; }
-    
-    float pageScaleFactor() const { return m_client ? m_client->pageScaleFactor() : 1; }
-    float deviceScaleFactor() const { return m_client ? m_client->deviceScaleFactor() : 1; }
-
-    void deviceOrPageScaleFactorChanged() { }
-    void noteDeviceOrPageScaleFactorChangedIncludingDescendants();
-
     // If the exposed rect of this layer changes, returns true if this or descendant layers need a flush,
     // for example to allocate new tiles.
     bool visibleRectChangeRequiresFlush(const FloatRect& /* clipRect */) const { return false; }
@@ -535,7 +526,6 @@
     bool m_masksToBounds : 1;
     bool m_drawsContent : 1;
     bool m_contentsVisible : 1;
-    bool m_maintainsPixelAlignment : 1;
     bool m_showDebugBorder : 1;
     bool m_showRepaintCounter : 1;
     
diff --git a/Source/core/platform/graphics/GraphicsLayerClient.h b/Source/core/platform/graphics/GraphicsLayerClient.h
index c3fcc2e..277deeb 100644
--- a/Source/core/platform/graphics/GraphicsLayerClient.h
+++ b/Source/core/platform/graphics/GraphicsLayerClient.h
@@ -67,11 +67,6 @@
     // initialized to identity already. Returns false if the layer has no transform.
     virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix&) const { return false; }
 
-    // Multiplier for backing store size, related to high DPI.
-    virtual float deviceScaleFactor() const { return 1; }
-    // Page scale factor.
-    virtual float pageScaleFactor() const { return 1; }
-
     virtual bool isTrackingRepaints() const { return false; }
 
 #ifndef NDEBUG
diff --git a/Source/core/rendering/RenderLayerBacking.cpp b/Source/core/rendering/RenderLayerBacking.cpp
index 167aed7..7423b13 100644
--- a/Source/core/rendering/RenderLayerBacking.cpp
+++ b/Source/core/rendering/RenderLayerBacking.cpp
@@ -135,7 +135,6 @@
 #else
     UNUSED_PARAM(name);
 #endif
-    graphicsLayer->setMaintainsPixelAlignment(compositor()->keepLayersPixelAligned());
     
     return graphicsLayer.release();
 }
@@ -1683,16 +1682,6 @@
 #endif
 }
 
-float RenderLayerBacking::pageScaleFactor() const
-{
-    return compositor()->pageScaleFactor();
-}
-
-float RenderLayerBacking::deviceScaleFactor() const
-{
-    return compositor()->deviceScaleFactor();
-}
-
 void RenderLayerBacking::didCommitChangesForLayer(const GraphicsLayer* layer) const
 {
 }
diff --git a/Source/core/rendering/RenderLayerBacking.h b/Source/core/rendering/RenderLayerBacking.h
index f13c487..29127e0 100644
--- a/Source/core/rendering/RenderLayerBacking.h
+++ b/Source/core/rendering/RenderLayerBacking.h
@@ -148,8 +148,6 @@
 
     virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& clip) OVERRIDE;
 
-    virtual float deviceScaleFactor() const OVERRIDE;
-    virtual float pageScaleFactor() const OVERRIDE;
     virtual void didCommitChangesForLayer(const GraphicsLayer*) const OVERRIDE;
     virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix&) const OVERRIDE;
 
diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp
index 48e0463..d566103 100644
--- a/Source/core/rendering/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/RenderLayerCompositor.cpp
@@ -2135,29 +2135,11 @@
     return m_isTrackingRepaints;
 }
 
-float RenderLayerCompositor::deviceScaleFactor() const
-{
-    Page* page = this->page();
-    return page ? page->deviceScaleFactor() : 1;
-}
-
-float RenderLayerCompositor::pageScaleFactor() const
-{
-    Page* page = this->page();
-    return page ? page->pageScaleFactor() : 1;
-}
-
 void RenderLayerCompositor::didCommitChangesForLayer(const GraphicsLayer*) const
 {
     // Nothing to do here yet.
 }
 
-bool RenderLayerCompositor::keepLayersPixelAligned() const
-{
-    // When scaling, attempt to align compositing layers to pixel boundaries.
-    return true;
-}
-
 static bool shouldCompositeOverflowControls(FrameView* view)
 {
     if (Page* page = view->frame()->page()) {
@@ -2633,17 +2615,6 @@
     return false;
 }
 
-void RenderLayerCompositor::deviceOrPageScaleFactorChanged()
-{
-    // Start at the RenderView's layer, since that's where the scale is applied.
-    RenderLayer* viewLayer = m_renderView->layer();
-    if (!viewLayer->isComposited())
-        return;
-
-    if (GraphicsLayer* rootLayer = viewLayer->backing()->childForSuperlayers())
-        rootLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
-}
-
 static bool isRootmostFixedOrStickyLayer(RenderLayer* layer)
 {
     if (layer->renderer()->isStickyPositioned())
diff --git a/Source/core/rendering/RenderLayerCompositor.h b/Source/core/rendering/RenderLayerCompositor.h
index a9579cb..edd86a2 100644
--- a/Source/core/rendering/RenderLayerCompositor.h
+++ b/Source/core/rendering/RenderLayerCompositor.h
@@ -204,14 +204,8 @@
 
     String layerTreeAsText(LayerTreeFlags);
 
-    virtual float deviceScaleFactor() const OVERRIDE;
-    virtual float pageScaleFactor() const OVERRIDE;
     virtual void didCommitChangesForLayer(const GraphicsLayer*) const OVERRIDE;
 
-    bool keepLayersPixelAligned() const;
-
-    void deviceOrPageScaleFactorChanged();
-
     GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizontalScrollbar.get(); }
     GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVerticalScrollbar.get(); }
     GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.get(); }