Diff
Modified: branches/safari-534.51-branch/Source/WebCore/ChangeLog (92011 => 92012)
--- branches/safari-534.51-branch/Source/WebCore/ChangeLog 2011-07-29 21:41:21 UTC (rev 92011)
+++ branches/safari-534.51-branch/Source/WebCore/ChangeLog 2011-07-29 21:44:26 UTC (rev 92012)
@@ -1,3 +1,28 @@
+2011-07-29 Lucas Forschler <[email protected]>
+
+ Merged 90293.
+
+ 2011-07-01 Darin Adler <[email protected]>
+
+ Consider backing scale when setting up graphics layers
+ https://bugs.webkit.org/show_bug.cgi?id=63848
+
+ Reviewed by Simon Fraser.
+
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::clampedContentsScaleForScale):
+ Increased the maximum scale since scale factor can now include
+ both page contents scale and backing scale.
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::createGraphicsLayer): Multiply in the
+ backing scale as well as the page contents scale.
+ (WebCore::RenderLayerBacking::updateForegroundLayer): Ditto.
+ (WebCore::RenderLayerBacking::updateMaskLayer): Ditto.
+ (WebCore::RenderLayerBacking::pageContentsScale): Added.
+ (WebCore::RenderLayerBacking::backingScale): Added.
+ * rendering/RenderLayerBacking.h: Added new private functions.
+
2011-07-25 Lucas Forschler <[email protected]>
Merged 91147.
Modified: branches/safari-534.51-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (92011 => 92012)
--- branches/safari-534.51-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2011-07-29 21:41:21 UTC (rev 92011)
+++ branches/safari-534.51-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2011-07-29 21:44:26 UTC (rev 92012)
@@ -1969,7 +1969,7 @@
{
// Define some limits as a sanity check for the incoming scale value
// those too small to see.
- const float maxScale = 5.0f;
+ const float maxScale = 10.0f;
const float minScale = 0.01f;
// Avoid very slight scale changes that would be doing extra work for no benefit
Modified: branches/safari-534.51-branch/Source/WebCore/rendering/RenderLayerBacking.cpp (92011 => 92012)
--- branches/safari-534.51-branch/Source/WebCore/rendering/RenderLayerBacking.cpp 2011-07-29 21:41:21 UTC (rev 92011)
+++ branches/safari-534.51-branch/Source/WebCore/rendering/RenderLayerBacking.cpp 2011-07-29 21:44:26 UTC (rev 92012)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,14 +31,13 @@
#include "AnimationController.h"
#include "CanvasRenderingContext.h"
-#include "CanvasRenderingContext2D.h"
#include "CSSPropertyNames.h"
#include "CSSStyleSelector.h"
+#include "Chrome.h"
#include "FrameView.h"
#include "GraphicsContext.h"
#include "GraphicsLayer.h"
#include "HTMLCanvasElement.h"
-#include "HTMLElement.h"
#include "HTMLIFrameElement.h"
#include "HTMLMediaElement.h"
#include "HTMLNames.h"
@@ -46,14 +45,12 @@
#include "KeyframeList.h"
#include "PluginViewBase.h"
#include "RenderApplet.h"
-#include "RenderBox.h"
#include "RenderIFrame.h"
#include "RenderImage.h"
#include "RenderLayerCompositor.h"
#include "RenderEmbeddedObject.h"
#include "RenderVideo.h"
#include "RenderView.h"
-#include "Settings.h"
#if ENABLE(WEBGL) || ENABLE(ACCELERATED_2D_CANVAS)
#include "GraphicsContext3D.h"
@@ -106,12 +103,13 @@
#ifndef NDEBUG
m_graphicsLayer->setName(nameForLayer());
-#endif // NDEBUG
+#endif
#if USE(ACCELERATED_COMPOSITING)
- ASSERT(renderer() && renderer()->document() && renderer()->document()->frame());
- if (Frame* frame = renderer()->document()->frame())
- m_graphicsLayer->setContentsScale(frame->pageScaleFactor());
+ ASSERT(renderer());
+ ASSERT(renderer()->document());
+ ASSERT(renderer()->document()->frame());
+ m_graphicsLayer->setContentsScale(pageScaleFactor() * backingScaleFactor());
#endif
updateLayerOpacity(renderer()->style());
@@ -610,7 +608,7 @@
if (!m_layerForHorizontalScrollbar) {
m_layerForHorizontalScrollbar = GraphicsLayer::create(this);
#ifndef NDEBUG
- m_layerForHorizontalScrollbar ->setName("horizontal scrollbar");
+ m_layerForHorizontalScrollbar->setName("horizontal scrollbar");
#endif
layersChanged = true;
}
@@ -659,8 +657,7 @@
#endif
m_foregroundLayer->setDrawsContent(true);
m_foregroundLayer->setPaintingPhase(GraphicsLayerPaintForeground);
- if (Frame* frame = renderer()->document()->frame())
- m_foregroundLayer->setContentsScale(frame->pageScaleFactor());
+ m_foregroundLayer->setContentsScale(pageScaleFactor() * backingScaleFactor());
layerChanged = true;
}
} else if (m_foregroundLayer) {
@@ -686,8 +683,7 @@
#endif
m_maskLayer->setDrawsContent(true);
m_maskLayer->setPaintingPhase(GraphicsLayerPaintMask);
- if (Frame* frame = renderer()->document()->frame())
- m_maskLayer->setContentsScale(frame->pageScaleFactor());
+ m_maskLayer->setContentsScale(pageScaleFactor() * backingScaleFactor());
layerChanged = true;
}
} else if (m_maskLayer) {
@@ -1494,6 +1490,25 @@
m_maskLayer->setContentsScale(scale);
}
+float RenderLayerBacking::pageScaleFactor() const
+{
+ Frame* frame = renderer()->document()->frame();
+ if (!frame)
+ return 1;
+ return frame->pageScaleFactor();
+}
+
+float RenderLayerBacking::backingScaleFactor() const
+{
+ Frame* frame = renderer()->document()->frame();
+ if (!frame)
+ return 1;
+ Page* page = frame->page();
+ if (!page)
+ return 1;
+ return page->chrome()->scaleFactor();
+}
+
} // namespace WebCore
#endif // USE(ACCELERATED_COMPOSITING)
Modified: branches/safari-534.51-branch/Source/WebCore/rendering/RenderLayerBacking.h (92011 => 92012)
--- branches/safari-534.51-branch/Source/WebCore/rendering/RenderLayerBacking.h 2011-07-29 21:41:21 UTC (rev 92011)
+++ branches/safari-534.51-branch/Source/WebCore/rendering/RenderLayerBacking.h 2011-07-29 21:44:26 UTC (rev 92012)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -186,17 +186,18 @@
bool hasNonCompositingDescendants() const;
- void paintIntoLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& paintDirtyRect,
- PaintBehavior paintBehavior, GraphicsLayerPaintingPhase, RenderObject* paintingRoot);
+ void paintIntoLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& paintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase, RenderObject* paintingRoot);
static int graphicsLayerToCSSProperty(AnimatedPropertyID);
static AnimatedPropertyID cssToGraphicsLayerProperty(int);
+ float pageScaleFactor() const;
+ float backingScaleFactor() const;
+
#ifndef NDEBUG
String nameForLayer() const;
#endif
-private:
RenderLayer* m_owningLayer;
OwnPtr<GraphicsLayer> m_ancestorClippingLayer; // only used if we are clipped by an ancestor which is not a stacking context
Modified: branches/safari-534.51-branch/Source/WebKit2/ChangeLog (92011 => 92012)
--- branches/safari-534.51-branch/Source/WebKit2/ChangeLog 2011-07-29 21:41:21 UTC (rev 92011)
+++ branches/safari-534.51-branch/Source/WebKit2/ChangeLog 2011-07-29 21:44:26 UTC (rev 92012)
@@ -1,3 +1,20 @@
+2011-07-29 Lucas Forschler <[email protected]>
+
+ Merged 90293.
+
+ 2011-07-01 Darin Adler <[email protected]>
+
+ Consider backing scale factor when setting up graphics layers
+ https://bugs.webkit.org/show_bug.cgi?id=63848
+
+ Reviewed by Simon Fraser.
+
+ * WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
+ (WebKit::LayerTreeHostCA::initialize): Set contents scale on the
+ non-composited content layer based on the backing scale factor.
+ (WebKit::LayerTreeHostCA::createPageOverlayLayer): Set contents
+ scale on the page overlay layer based on the backing scale factor.
+
2011-07-22 Lucas Forschler <[email protected]>
Merged 91146.
Modified: branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp (92011 => 92012)
--- branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp 2011-07-29 21:41:21 UTC (rev 92011)
+++ branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp 2011-07-29 21:44:26 UTC (rev 92012)
@@ -67,6 +67,7 @@
m_nonCompositedContentLayer->setDrawsContent(true);
m_nonCompositedContentLayer->setContentsOpaque(m_webPage->drawsBackground() && !m_webPage->drawsTransparentBackground());
m_nonCompositedContentLayer->setSize(m_webPage->size());
+ m_nonCompositedContentLayer->setContentsScale(m_webPage->userSpaceScaleFactor());
if (m_webPage->corePage()->settings()->acceleratedDrawingEnabled())
m_nonCompositedContentLayer->setAcceleratesDrawing(true);
@@ -252,6 +253,7 @@
m_pageOverlayLayer->setDrawsContent(true);
m_pageOverlayLayer->setSize(m_webPage->size());
+ m_pageOverlayLayer->setContentsScale(m_webPage->userSpaceScaleFactor());
m_rootLayer->addChild(m_pageOverlayLayer.get());
}