Changeset 91137 in webkit
- Timestamp:
- Jul 15, 2011 6:30:13 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r91135 r91137 1 2011-07-15 Simon Fraser <simon.fraser@apple.com> 2 3 Have GraphicsLayer pull their contentsScale, rather than pushing it onto them 4 https://bugs.webkit.org/show_bug.cgi?id=64643 5 6 Reviewed by Darin Adler. 7 8 RenderLayerBacking would set the contentsScale on GraphicsLayers 9 on creation, and update it when the pageScaleFactor changed. However, 10 RenderLayerBacking doesn't really know what contentsScale is best 11 for a layer, so instead, have GraphicsLayers call back through the 12 GraphicsLayerClient to get the two relevant scale factors, and do 13 their own computation of contentsScale. 14 15 No testable behavior changes. 16 17 * page/Frame.cpp: 18 (WebCore::Frame::pageScaleFactorChanged): No need to pass the scale. 19 20 * platform/graphics/GraphicsLayer.cpp: 21 (WebCore::GraphicsLayer::notePageScaleFactorChangedIncludingDescendants): 22 Recurse through the GraphicsLayer tree, calling pageScaleFactorChanged() on 23 each layer. 24 25 * platform/graphics/GraphicsLayer.h: 26 (WebCore::GraphicsLayer::pageScaleFactorChanged): 27 Remove contentsScale/setContentsScale 28 29 * platform/graphics/GraphicsLayerClient.h: 30 Add methods to fetch the backingScaleFactor() and pageScaleFactor(). 31 32 * platform/graphics/ca/GraphicsLayerCA.cpp: 33 (WebCore::GraphicsLayerCA::GraphicsLayerCA): m_uncommittedChanges 34 defaults to ContentsScaleChanged so we update contentsScale on 35 the first flush. 36 37 (WebCore::GraphicsLayerCA::setContentsToBackgroundColor): 38 This was the wrong time to call updateContentsRect() and setupContentsLayer(); 39 those should be done at commit time, so moved to updateLayerBackgroundColor(). 40 (WebCore::GraphicsLayerCA::recursiveCommitChanges): Note whether we 41 have any changes, and call didCommitChangesForLayer() on the client. 42 (WebCore::GraphicsLayerCA::updateLayerBackgroundColor): Code moved to here. 43 (WebCore::clampedContentsScaleForScale): No longer has any hysteresis 44 on the scale, and now just clamps. 45 (WebCore::GraphicsLayerCA::updateContentsScale): Fetch the scales 46 from the client, and multiply them, then clamp. 47 (WebCore::GraphicsLayerCA::requiresTiledLayer): This now takes 48 contentsScale into account when deciding to use tiled layer, 49 so that zooming in will cause layers to start tiling. 50 (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): Don't call 51 setContentsScale(), but rather updateContentsScale(). 52 (WebCore::GraphicsLayerCA::pageScaleFactorChanged): Set the bits 53 for properties that depend on the scale. 54 (WebCore::GraphicsLayerCA::noteChangesForScaleSensitiveProperties): 55 Note that contentsScale needs to be updated. At some point we might also 56 need to dirty other properties. 57 * platform/graphics/ca/GraphicsLayerCA.h: Moved the m_allowTiledLayer 58 bool for better packing. No need for a m_contentsScale member now. 59 * rendering/RenderLayer.cpp: Removed pageScaleFactorChanged(). 60 * rendering/RenderLayer.h: Ditto. 61 * rendering/RenderLayerBacking.cpp: 62 (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): No need 63 to push the contents scale. 64 (WebCore::RenderLayerBacking::updateForegroundLayer): Ditto. 65 (WebCore::RenderLayerBacking::updateMaskLayer): Ditto. 66 (WebCore::RenderLayerBacking::pageScaleFactor): GraphicsLayerClient method. 67 (WebCore::RenderLayerBacking::backingScaleFactor): GraphicsLayerClient method. 68 (WebCore::RenderLayerBacking::didCommitChangesForLayer): Send through 69 to the compositor. 70 * rendering/RenderLayerBacking.h: GraphicsLayerClient methods. 71 * rendering/RenderLayerCompositor.cpp: 72 (WebCore::RenderLayerCompositor::didFlushChangesForLayer): We'll use 73 this later. 74 (WebCore::RenderLayerCompositor::backingScaleFactor): GraphicsLayerClient method. 75 (WebCore::RenderLayerCompositor::pageScaleFactor): Ditto. 76 (WebCore::RenderLayerCompositor::didCommitChangesForLayer): Ditto. 77 (WebCore::RenderLayerCompositor::ensureRootLayer): No need to push the contents scale. 78 (WebCore::RenderLayerCompositor::pageScaleFactorChanged): Just call notePageScaleFactorChangedIncludingDescendants() 79 on the root GraphicsLayer. 80 * rendering/RenderLayerCompositor.h: Added GraphicsLayerClient methods. 81 1 82 2011-07-15 Jon Honeycutt <jhoneycutt@apple.com> 2 83 -
trunk/Source/WebCore/page/Frame.cpp
r90925 r91137 1112 1112 RenderView* root = contentRenderer(); 1113 1113 if (root && root->compositor()) 1114 root->compositor()->pageScaleFactorChanged( scale);1114 root->compositor()->pageScaleFactorChanged(); 1115 1115 } 1116 1116 #endif -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r88664 r91137 221 221 setParent(0); 222 222 } 223 } 224 225 void GraphicsLayer::notePageScaleFactorChangedIncludingDescendants() 226 { 227 pageScaleFactorChanged(); 228 229 if (m_maskLayer) 230 m_maskLayer->pageScaleFactorChanged(); 231 232 if (m_replicaLayer) 233 m_replicaLayer->notePageScaleFactorChangedIncludingDescendants(); 234 235 const Vector<GraphicsLayer*>& childLayers = children(); 236 size_t numChildren = childLayers.size(); 237 for (size_t i = 0; i < numChildren; ++i) 238 childLayers[i]->notePageScaleFactorChangedIncludingDescendants(); 223 239 } 224 240 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r88653 r91137 326 326 virtual PlatformLayer* platformLayer() const { return 0; } 327 327 328 // Change the scale at which the contents are rendered. Note that contentsScale may not return329 // the same value passed to setContentsScale(), because of clamping and hysteresis.330 virtual float contentsScale() const { return 1; }331 virtual void setContentsScale(float) { }332 333 328 void dumpLayer(TextStream&, int indent = 0, LayerTreeAsTextBehavior = LayerTreeAsTextBehaviorNormal) const; 334 329 … … 355 350 virtual void distributeOpacity(float); 356 351 virtual float accumulatedOpacity() const; 352 353 virtual void pageScaleFactorChanged() { } 354 void notePageScaleFactorChangedIncludingDescendants(); 357 355 358 356 // Some compositing systems may do internal batching to synchronize compositing updates -
trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h
r51122 r91137 63 63 64 64 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) = 0; 65 virtual void didCommitChangesForLayer(const GraphicsLayer*) const = 0; 66 67 // Multiplier for backing store size, related to high DPI. 68 virtual float backingScaleFactor() const = 0; 69 // Scaling factor of the page. 70 virtual float pageScaleFactor() const = 0; 65 71 66 72 virtual bool showDebugBorders() const = 0; -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r90293 r91137 250 250 , m_contentsLayerPurpose(NoContentsLayer) 251 251 , m_contentsLayerHasBackgroundColor(false) 252 , m_uncommittedChanges(NoChange)253 , m_contentsScale(1)254 252 , m_allowTiledLayer(true) 253 , m_uncommittedChanges(ContentsScaleChanged) 255 254 { 256 255 m_layer = PlatformCALayer::create(PlatformCALayer::LayerTypeWebLayer, this); … … 680 679 m_contentsLayer->setName("Background Color Layer"); 681 680 #endif 682 updateContentsRect();683 setupContentsLayer(m_contentsLayer.get());684 681 } else { 685 682 m_contentsLayerPurpose = NoContentsLayer; … … 808 805 void GraphicsLayerCA::recursiveCommitChanges() 809 806 { 807 bool hadChanges = m_uncommittedChanges; 808 810 809 commitLayerChangesBeforeSublayers(); 811 810 … … 827 826 828 827 commitLayerChangesAfterSublayers(); 828 829 if (hadChanges && client()) 830 client()->didCommitChangesForLayer(this); 829 831 } 830 832 … … 1247 1249 if (!m_contentsLayer) 1248 1250 return; 1251 1252 setupContentsLayer(m_contentsLayer.get()); 1253 updateContentsRect(); 1249 1254 1250 1255 if (m_backgroundColorSet) … … 1938 1943 } 1939 1944 1940 void GraphicsLayerCA::setContentsScale(float scale) 1941 { 1942 float newScale = clampedContentsScaleForScale(scale); 1943 if (newScale == m_contentsScale) 1944 return; 1945 1946 m_contentsScale = newScale; 1947 noteLayerPropertyChanged(ContentsScaleChanged); 1948 } 1949 1950 float GraphicsLayerCA::clampedContentsScaleForScale(float scale) const 1945 static float clampedContentsScaleForScale(float scale) 1951 1946 { 1952 1947 // Define some limits as a sanity check for the incoming scale value … … 1954 1949 const float maxScale = 10.0f; 1955 1950 const float minScale = 0.01f; 1956 1957 // Avoid very slight scale changes that would be doing extra work for no benefit 1958 const float maxAllowableDelta = 0.05f; 1959 1960 // Clamp 1961 float result = max(minScale, min(scale, maxScale)); 1962 1963 // If it hasn't changed much, don't do any work 1964 return ((fabs(result - m_contentsScale) / m_contentsScale) < maxAllowableDelta) ? m_contentsScale : result; 1951 return max(minScale, min(scale, maxScale)); 1965 1952 } 1966 1953 … … 1971 1958 swapFromOrToTiledLayer(needTiledLayer); 1972 1959 1973 m_layer->setContentsScale(m_contentsScale); 1960 float backingScaleFactor = m_client ? m_client->backingScaleFactor() : 1; 1961 float pageScaleFactor = m_client ? m_client->pageScaleFactor() : 1; 1962 1963 float contentsScale = clampedContentsScaleForScale(pageScaleFactor * backingScaleFactor); 1964 1965 m_layer->setContentsScale(contentsScale); 1974 1966 if (drawsContent()) 1975 1967 m_layer->setNeedsDisplay(); … … 2024 2016 return false; 2025 2017 2018 float contentsScale = m_client ? m_client->backingScaleFactor() * m_client->pageScaleFactor() : 1; 2019 2026 2020 // FIXME: catch zero-size height or width here (or earlier)? 2027 return size.width() > cMaxPixelDimension || size.height()> cMaxPixelDimension;2021 return size.width() * contentsScale > cMaxPixelDimension || size.height() * contentsScale > cMaxPixelDimension; 2028 2022 } 2029 2023 … … 2034 2028 2035 2029 m_layer = PlatformCALayer::create(useTiledLayer ? PlatformCALayer::LayerTypeWebTiledLayer : PlatformCALayer::LayerTypeWebLayer, this); 2036 m_layer->setContentsScale(m_contentsScale);2037 2038 2030 m_usingTiledLayer = useTiledLayer; 2039 2031 … … 2066 2058 updateBackfaceVisibility(); 2067 2059 updateLayerBackgroundColor(); 2068 2060 updateContentsScale(); 2069 2061 updateOpacityOnLayer(); 2070 2062 … … 2371 2363 } 2372 2364 2365 void GraphicsLayerCA::pageScaleFactorChanged() 2366 { 2367 noteChangesForScaleSensitiveProperties(); 2368 } 2369 2370 void GraphicsLayerCA::noteChangesForScaleSensitiveProperties() 2371 { 2372 noteLayerPropertyChanged(ContentsScaleChanged); 2373 } 2374 2373 2375 void GraphicsLayerCA::noteSublayersChanged() 2374 2376 { -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r89441 r91137 57 57 virtual PlatformCALayer* platformCALayer() const { return primaryLayer(); } 58 58 59 virtual float contentsScale() const { return m_contentsScale; }60 virtual void setContentsScale(float);61 62 59 virtual bool setChildren(const Vector<GraphicsLayer*>&); 63 60 virtual void addChild(GraphicsLayer*); … … 119 116 120 117 virtual void layerDidDisplay(PlatformLayer*); 118 119 virtual void pageScaleFactorChanged(); 121 120 122 121 void recursiveCommitChanges(); … … 332 331 void noteLayerPropertyChanged(LayerChangeFlags flags); 333 332 void noteSublayersChanged(); 333 void noteChangesForScaleSensitiveProperties(); 334 334 335 335 void repaintLayerDirtyRects(); … … 354 354 ContentsLayerPurpose m_contentsLayerPurpose; 355 355 bool m_contentsLayerHasBackgroundColor : 1; 356 bool m_allowTiledLayer : 1; 356 357 357 358 RetainPtr<CGImageRef> m_uncorrectedContentsImage; … … 397 398 398 399 Vector<FloatRect> m_dirtyRects; 400 FloatSize m_pixelAlignmentOffset; 399 401 400 402 LayerChangeFlags m_uncommittedChanges; 401 402 float clampedContentsScaleForScale(float) const;403 float m_contentsScale;404 405 bool m_allowTiledLayer;406 403 }; 407 404 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r91110 r91137 4166 4166 } 4167 4167 4168 void RenderLayer::pageScaleFactorChanged(float scale)4169 {4170 #if USE(ACCELERATED_COMPOSITING)4171 if (m_backing)4172 m_backing->pageScaleFactorChanged(scale);4173 #endif4174 }4175 4176 4168 } // namespace WebCore 4177 4169 -
trunk/Source/WebCore/rendering/RenderLayer.h
r90925 r91137 614 614 #endif 615 615 616 void pageScaleFactorChanged(float);617 618 616 friend class RenderLayerBacking; 619 617 friend class RenderLayerCompositor; -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r90959 r91137 117 117 m_graphicsLayer = createGraphicsLayer(layerName); 118 118 119 ASSERT(renderer());120 ASSERT(renderer()->document());121 ASSERT(renderer()->document()->frame());122 m_graphicsLayer->setContentsScale(pageScaleFactor() * backingScaleFactor());123 124 119 updateLayerOpacity(renderer()->style()); 125 120 updateLayerTransform(renderer()->style()); … … 653 648 m_foregroundLayer->setDrawsContent(true); 654 649 m_foregroundLayer->setPaintingPhase(GraphicsLayerPaintForeground); 655 m_foregroundLayer->setContentsScale(pageScaleFactor() * backingScaleFactor());656 650 layerChanged = true; 657 651 } … … 676 670 m_maskLayer->setDrawsContent(true); 677 671 m_maskLayer->setPaintingPhase(GraphicsLayerPaintMask); 678 m_maskLayer->setContentsScale(pageScaleFactor() * backingScaleFactor());679 672 layerChanged = true; 680 673 } … … 1249 1242 } 1250 1243 1244 float RenderLayerBacking::pageScaleFactor() const 1245 { 1246 return compositor()->pageScaleFactor(); 1247 } 1248 1249 float RenderLayerBacking::backingScaleFactor() const 1250 { 1251 return compositor()->backingScaleFactor(); 1252 } 1253 1254 void RenderLayerBacking::didCommitChangesForLayer(const GraphicsLayer*) const 1255 { 1256 compositor()->didFlushChangesForLayer(m_owningLayer); 1257 } 1258 1251 1259 bool RenderLayerBacking::showDebugBorders() const 1252 1260 { … … 1468 1476 } 1469 1477 1470 void RenderLayerBacking::pageScaleFactorChanged(float scale)1471 {1472 float combinedScale = scale * backingScaleFactor();1473 1474 if (m_graphicsLayer)1475 m_graphicsLayer->setContentsScale(combinedScale);1476 1477 if (m_foregroundLayer)1478 m_foregroundLayer->setContentsScale(combinedScale);1479 1480 if (m_maskLayer)1481 m_maskLayer->setContentsScale(combinedScale);1482 }1483 1484 float RenderLayerBacking::pageScaleFactor() const1485 {1486 Frame* frame = renderer()->document()->frame();1487 if (!frame)1488 return 1;1489 return frame->pageScaleFactor();1490 }1491 1492 float RenderLayerBacking::backingScaleFactor() const1493 {1494 Frame* frame = renderer()->document()->frame();1495 if (!frame)1496 return 1;1497 Page* page = frame->page();1498 if (!page)1499 return 1;1500 return page->chrome()->scaleFactor();1501 }1502 1503 1478 } // namespace WebCore 1504 1479 -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r90954 r91137 129 129 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& clip); 130 130 131 virtual float backingScaleFactor() const; 132 virtual float pageScaleFactor() const; 133 virtual void didCommitChangesForLayer(const GraphicsLayer*) const; 134 131 135 virtual bool showDebugBorders() const; 132 136 virtual bool showRepaintCounter() const; … … 137 141 CompositingLayerType compositingLayerType() const; 138 142 139 void pageScaleFactorChanged(float);140 141 143 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizontalScrollbar.get(); } 142 144 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVerticalScrollbar.get(); } … … 194 196 static AnimatedPropertyID cssToGraphicsLayerProperty(int); 195 197 196 float pageScaleFactor() const;197 float backingScaleFactor() const;198 199 198 #ifndef NDEBUG 200 199 String nameForLayer() const; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r91114 r91137 208 208 } 209 209 210 void RenderLayerCompositor::didFlushChangesForLayer(RenderLayer*) 211 { 212 } 213 210 214 RenderLayerCompositor* RenderLayerCompositor::enclosingCompositorFlushingLayers() const 211 215 { … … 1533 1537 } 1534 1538 1539 float RenderLayerCompositor::backingScaleFactor() const 1540 { 1541 Frame* frame = m_renderView->frameView()->frame(); 1542 if (!frame) 1543 return 1; 1544 Page* page = frame->page(); 1545 if (!page) 1546 return 1; 1547 return page->chrome()->scaleFactor(); 1548 } 1549 1550 float RenderLayerCompositor::pageScaleFactor() const 1551 { 1552 Frame* frame = m_renderView->frameView()->frame(); 1553 if (!frame) 1554 return 1; 1555 Page* page = frame->page(); 1556 if (!page) 1557 return 1; 1558 return page->mainFrame()->pageScaleFactor(); 1559 } 1560 1561 void RenderLayerCompositor::didCommitChangesForLayer(const GraphicsLayer*) const 1562 { 1563 // Nothing to do here yet. 1564 } 1565 1535 1566 static bool shouldCompositeOverflowControls(ScrollView* view) 1536 1567 { … … 1618 1649 m_rootContentLayer = GraphicsLayer::create(0); 1619 1650 #ifndef NDEBUG 1620 m_rootContentLayer->setName(" Root platform");1651 m_rootContentLayer->setName("content root"); 1621 1652 #endif 1622 1653 m_rootContentLayer->setSize(FloatSize(m_renderView->maxXLayoutOverflow(), m_renderView->maxYLayoutOverflow())); … … 1641 1672 m_clipLayer = GraphicsLayer::create(this); 1642 1673 #ifndef NDEBUG 1643 m_clipLayer->setName(" iframe Clipping");1674 m_clipLayer->setName("frame clipping"); 1644 1675 #endif 1645 1676 m_clipLayer->setMasksToBounds(true); … … 1647 1678 m_scrollLayer = GraphicsLayer::create(this); 1648 1679 #ifndef NDEBUG 1649 m_scrollLayer->setName(" iframe scrolling");1680 m_scrollLayer->setName("frame scrolling"); 1650 1681 #endif 1651 1682 … … 1848 1879 } 1849 1880 1850 void RenderLayerCompositor::pageScaleFactorChanged(float scale, RenderLayer* layer) 1851 { 1852 if (!layer) 1853 layer = rootRenderLayer(); 1854 1855 layer->pageScaleFactorChanged(scale); 1856 1857 if (layer->isStackingContext()) { 1858 if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) { 1859 size_t listSize = negZOrderList->size(); 1860 for (size_t i = 0; i < listSize; ++i) 1861 pageScaleFactorChanged(scale, negZOrderList->at(i)); 1862 } 1863 1864 if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) { 1865 size_t listSize = posZOrderList->size(); 1866 for (size_t i = 0; i < listSize; ++i) 1867 pageScaleFactorChanged(scale, posZOrderList->at(i)); 1868 } 1869 } 1870 1871 if (Vector<RenderLayer*>* normalFlowList = layer->normalFlowList()) { 1872 size_t listSize = normalFlowList->size(); 1873 for (size_t i = 0; i < listSize; ++i) 1874 pageScaleFactorChanged(scale, normalFlowList->at(i)); 1875 } 1881 void RenderLayerCompositor::pageScaleFactorChanged() 1882 { 1883 // Start at the RenderView's layer, since that's where the scale is applied. 1884 RenderLayer* viewLayer = m_renderView->layer(); 1885 if (!viewLayer->isComposited()) 1886 return; 1887 1888 if (GraphicsLayer* rootLayer = viewLayer->backing()->graphicsLayer()) 1889 rootLayer->notePageScaleFactorChangedIncludingDescendants(); 1876 1890 } 1877 1891 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r91114 r91137 94 94 // This call returns the rootmost compositor that is being flushed (including self). 95 95 RenderLayerCompositor* enclosingCompositorFlushingLayers() const; 96 97 // Called when the GraphicsLayer for the given RenderLayer has flushed changes inside of flushPendingLayerChanges(). 98 void didFlushChangesForLayer(RenderLayer*); 96 99 97 100 // Rebuild the tree of compositing layers … … 185 188 bool compositorShowRepaintCounter() const { return m_showRepaintCounter; } 186 189 187 void pageScaleFactorChanged(float, RenderLayer* = 0); 190 virtual float backingScaleFactor() const; 191 virtual float pageScaleFactor() const; 192 virtual void didCommitChangesForLayer(const GraphicsLayer*) const; 193 194 void pageScaleFactorChanged(); 188 195 189 196 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizontalScrollbar.get(); } -
trunk/Source/WebKit/chromium/ChangeLog
r91127 r91137 1 2011-07-15 Simon Fraser <simon.fraser@apple.com> 2 3 Have GraphicsLayer pull their contentsScale, rather than pushing it onto them 4 https://bugs.webkit.org/show_bug.cgi?id=64643 5 6 Reviewed by Darin Adler. 7 8 Impement new GraphicsLayerClient methods related to contents scale. 9 10 * src/PageOverlay.cpp: 11 (WebKit::OverlayGraphicsLayerClientImpl::backingScaleFactor): 12 (WebKit::OverlayGraphicsLayerClientImpl::pageScaleFactor): 13 1 14 2011-07-15 Sheriff Bot <webkit.review.bot@gmail.com> 2 15 -
trunk/Source/WebKit/chromium/src/PageOverlay.cpp
r88582 r91137 69 69 { 70 70 m_pageOverlayClient->paintPageOverlay(context); 71 } 72 73 // Multiplier for backing store size, related to high DPI. 74 virtual float backingScaleFactor() const 75 { 76 return 1; 77 } 78 79 virtual float pageScaleFactor() const 80 { 81 return 1; 71 82 } 72 83 -
trunk/Source/WebKit2/ChangeLog
r91108 r91137 1 2011-07-15 Simon Fraser <simon.fraser@apple.com> 2 3 Have GraphicsLayer pull their contentsScale, rather than pushing it onto them 4 https://bugs.webkit.org/show_bug.cgi?id=64643 5 6 Reviewed by Darin Adler. 7 8 Impement new GraphicsLayerClient methods related to contents scale, 9 and don't push the scale. 10 11 * WebProcess/WebPage/ca/LayerTreeHostCA.cpp: 12 (WebKit::LayerTreeHostCA::initialize): 13 (WebKit::LayerTreeHostCA::backingScaleFactor): 14 (WebKit::LayerTreeHostCA::pageScaleFactor): 15 (WebKit::LayerTreeHostCA::createPageOverlayLayer): 16 * WebProcess/WebPage/ca/LayerTreeHostCA.h: 17 (WebKit::LayerTreeHostCA::didCommitChangesForLayer): 18 1 19 2011-07-15 Ada Chan <adachan@apple.com> 2 20 -
trunk/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp
r90293 r91137 68 68 m_nonCompositedContentLayer->setContentsOpaque(m_webPage->drawsBackground() && !m_webPage->drawsTransparentBackground()); 69 69 m_nonCompositedContentLayer->setSize(m_webPage->size()); 70 m_nonCompositedContentLayer->setContentsScale(m_webPage->userSpaceScaleFactor());71 70 if (m_webPage->corePage()->settings()->acceleratedDrawingEnabled()) 72 71 m_nonCompositedContentLayer->setAcceleratesDrawing(true); … … 208 207 } 209 208 209 float LayerTreeHostCA::backingScaleFactor() const 210 { 211 return m_webPage->userSpaceScaleFactor(); 212 } 213 214 float LayerTreeHostCA::pageScaleFactor() const 215 { 216 return 1; 217 } 218 210 219 void LayerTreeHostCA::performScheduledLayerFlush() 211 220 { … … 254 263 m_pageOverlayLayer->setDrawsContent(true); 255 264 m_pageOverlayLayer->setSize(m_webPage->size()); 256 m_pageOverlayLayer->setContentsScale(m_webPage->userSpaceScaleFactor());257 265 258 266 m_rootLayer->addChild(m_pageOverlayLayer.get()); -
trunk/Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h
r87755 r91137 75 75 virtual bool showDebugBorders() const; 76 76 virtual bool showRepaintCounter() const; 77 virtual float backingScaleFactor() const; 78 virtual float pageScaleFactor() const; 79 virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const { } 77 80 78 81 // LayerTreeHostCA
Note: See TracChangeset
for help on using the changeset viewer.