Changeset 163931 in webkit
- Timestamp:
- Feb 11, 2014 7:28:43 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r163928 r163931 1 2014-02-11 Zalan Bujtas <zalan@apple.com> 2 3 Subpixel rendering: Make GraphicsLayerClient::paintContents's clip rect subpixel based. 4 https://bugs.webkit.org/show_bug.cgi?id=128460 5 6 Reviewed by Simon Fraser. 7 8 GraphicsClient::paintContents takes clipRect as FloatRect now so that we can paint on 9 subpixel position. 10 11 No change in functionality. 12 13 * platform/graphics/GraphicsLayerClient.h: 14 * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp: 15 (WebCore::CompositingCoordinator::paintContents): 16 * platform/graphics/texmap/coordinated/CompositingCoordinator.h: 17 * rendering/RenderLayer.cpp: 18 (WebCore::cornerRect): 19 (WebCore::RenderLayer::scrollCornerRect): 20 (WebCore::resizerCornerRect): 21 (WebCore::RenderLayer::scrollCornerAndResizerRect): 22 (WebCore::RenderLayer::verticalScrollbarStart): 23 (WebCore::RenderLayer::horizontalScrollbarStart): 24 (WebCore::RenderLayer::paintResizer): 25 (WebCore::RenderLayer::hitTestOverflowControls): 26 * rendering/RenderLayer.h: 27 * rendering/RenderLayerBacking.cpp: 28 (WebCore::RenderLayerBacking::paintIntoLayer): 29 (WebCore::RenderLayerBacking::paintContents): 30 * rendering/RenderLayerBacking.h: 31 * rendering/RenderLayerCompositor.cpp: 32 (WebCore::RenderLayerCompositor::paintContents): 33 * rendering/RenderLayerCompositor.h: 34 * rendering/RenderWidget.cpp: 35 (WebCore::RenderWidget::paint): 36 1 37 2014-02-11 Antti Koivisto <antti@apple.com> 2 38 -
trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h
r163104 r163931 30 30 31 31 class FloatPoint; 32 class FloatRect; 32 33 class GraphicsContext; 33 34 class GraphicsLayer; … … 71 72 virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) { } 72 73 73 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) = 0;74 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& inClip) = 0; 74 75 virtual void didCommitChangesForLayer(const GraphicsLayer*) const { } 75 76 -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp
r162644 r163931 254 254 255 255 256 void CompositingCoordinator::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const IntRect& clipRect)257 { 258 m_client->paintLayerContents(graphicsLayer, graphicsContext, clipRect);256 void CompositingCoordinator::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect) 257 { 258 m_client->paintLayerContents(graphicsLayer, graphicsContext, enclosingIntRect(clipRect)); 259 259 } 260 260 -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h
r162644 r163931 92 92 virtual void notifyAnimationStarted(const GraphicsLayer*, double time) override; 93 93 virtual void notifyFlushRequired(const GraphicsLayer*) override; 94 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& clipRect) override;94 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clipRect) override; 95 95 virtual float deviceScaleFactor() const override; 96 96 virtual float pageScaleFactor() const override; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r163873 r163931 2700 2700 RenderBox* box = renderBox(); 2701 2701 if (!box) 2702 return IntRect();2702 return LayoutRect(); 2703 2703 LayoutRect scrollCornerAndResizer = scrollCornerRect(); 2704 2704 if (scrollCornerAndResizer.isEmpty()) -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r163725 r163931 2128 2128 2129 2129 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, GraphicsContext* context, 2130 const IntRect& paintDirtyRect, // In the coords of rootLayer.2131 2130 const LayoutRect& paintDirtyRect, // In the coords of rootLayer. 2131 PaintBehavior paintBehavior, GraphicsLayerPaintingPhase paintingPhase) 2132 2132 { 2133 2133 if (paintsIntoWindow() || paintsIntoCompositedAncestor()) { … … 2187 2187 2188 2188 // Up-call from compositing layer drawing callback. 2189 void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase paintingPhase, const IntRect& clip)2189 void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase paintingPhase, const FloatRect& clip) 2190 2190 { 2191 2191 #ifndef NDEBUG … … 2193 2193 page->setIsPainting(true); 2194 2194 #endif 2195 2196 // The dirtyRect is in the coords of the painting root. 2197 LayoutRect dirtyRect(clip); 2198 IntRect pixelSnappedRectForIntegralPositionedItems = pixelSnappedIntRect(dirtyRect); 2195 2199 2196 2200 if (graphicsLayer == m_graphicsLayer.get() … … 2201 2205 InspectorInstrumentation::willPaint(&renderer()); 2202 2206 2203 // The dirtyRect is in the coords of the painting root.2204 IntRect dirtyRect = clip;2205 2207 if (!(paintingPhase & GraphicsLayerPaintOverflowContents)) 2206 2208 dirtyRect.intersect(enclosingIntRect(compositedBoundsIncludingMargin())); … … 2209 2211 paintIntoLayer(graphicsLayer, &context, dirtyRect, PaintBehaviorNormal, paintingPhase); 2210 2212 2211 InspectorInstrumentation::didPaint(&renderer(), &context, clip);2213 InspectorInstrumentation::didPaint(&renderer(), &context, dirtyRect); 2212 2214 } else if (graphicsLayer == layerForHorizontalScrollbar()) { 2213 paintScrollbar(m_owningLayer.horizontalScrollbar(), context, clip);2215 paintScrollbar(m_owningLayer.horizontalScrollbar(), context, pixelSnappedRectForIntegralPositionedItems); 2214 2216 } else if (graphicsLayer == layerForVerticalScrollbar()) { 2215 paintScrollbar(m_owningLayer.verticalScrollbar(), context, clip);2217 paintScrollbar(m_owningLayer.verticalScrollbar(), context, pixelSnappedRectForIntegralPositionedItems); 2216 2218 } else if (graphicsLayer == layerForScrollCorner()) { 2217 2219 const LayoutRect& scrollCornerAndResizer = m_owningLayer.scrollCornerAndResizerRect(); 2218 2220 context.save(); 2219 2221 context.translate(-scrollCornerAndResizer.x(), -scrollCornerAndResizer.y()); 2220 LayoutRect transformedClip = clip;2222 LayoutRect transformedClip = LayoutRect(clip); 2221 2223 transformedClip.moveBy(scrollCornerAndResizer.location()); 2222 2224 m_owningLayer.paintScrollCorner(&context, IntPoint(), pixelSnappedIntRect(transformedClip)); -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r163190 r163931 166 166 virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) override; 167 167 168 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& clip) override;168 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clip) override; 169 169 170 170 virtual float deviceScaleFactor() const override; … … 284 284 GraphicsLayer* tileCacheFlatteningLayer() const { return m_usingTiledCacheLayer ? m_childContainmentLayer.get() : 0; } 285 285 286 void paintIntoLayer(const GraphicsLayer*, GraphicsContext*, const IntRect& paintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase);286 void paintIntoLayer(const GraphicsLayer*, GraphicsContext*, const LayoutRect& paintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase); 287 287 288 288 // Helper function for updateGraphicsLayerGeometry. -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r163194 r163931 2609 2609 } 2610 2610 2611 void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase, const IntRect& clip) 2612 { 2611 void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& clip) 2612 { 2613 IntRect pixelSnappedRectForIntegralPositionedItems = pixelSnappedIntRect(LayoutRect(clip)); 2613 2614 if (graphicsLayer == layerForHorizontalScrollbar()) 2614 paintScrollbar(m_renderView.frameView().horizontalScrollbar(), context, clip);2615 paintScrollbar(m_renderView.frameView().horizontalScrollbar(), context, pixelSnappedRectForIntegralPositionedItems); 2615 2616 else if (graphicsLayer == layerForVerticalScrollbar()) 2616 paintScrollbar(m_renderView.frameView().verticalScrollbar(), context, clip);2617 paintScrollbar(m_renderView.frameView().verticalScrollbar(), context, pixelSnappedRectForIntegralPositionedItems); 2617 2618 else if (graphicsLayer == layerForScrollCorner()) { 2618 2619 const IntRect& scrollCorner = m_renderView.frameView().scrollCornerRect(); 2619 2620 context.save(); 2620 2621 context.translate(-scrollCorner.x(), -scrollCorner.y()); 2621 IntRect transformedClip = clip;2622 IntRect transformedClip = pixelSnappedRectForIntegralPositionedItems; 2622 2623 transformedClip.moveBy(scrollCorner.location()); 2623 2624 m_renderView.frameView().paintScrollCorner(&context, transformedClip); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r163190 r163931 308 308 virtual void notifyAnimationStarted(const GraphicsLayer*, double) override { } 309 309 virtual void notifyFlushRequired(const GraphicsLayer*) override; 310 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect&) override;310 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect&) override; 311 311 312 312 virtual bool isTrackingRepaints() const override; -
trunk/Source/WebKit/gtk/ChangeLog
r163797 r163931 1 2014-02-11 Zalan Bujtas <zalan@apple.com> 2 3 Subpixel rendering: Make GraphicsLayerClient::paintContents's clip rect subpixel based. 4 https://bugs.webkit.org/show_bug.cgi?id=128460 5 6 Reviewed by Simon Fraser. 7 8 GraphicsClient::paintContents takes clipRect as FloatRect now so that we can paint on 9 subpixel position. 10 11 No change in functionality. 12 13 * WebCoreSupport/AcceleratedCompositingContext.h: 14 * WebCoreSupport/AcceleratedCompositingContextGL.cpp: 15 (WebKit::AcceleratedCompositingContext::paintContents): 16 1 17 2014-02-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 18 -
trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h
r163079 r163931 20 20 #define AcceleratedCompositingContext_h 21 21 22 #include "FloatRect.h" 22 23 #include "GraphicsLayer.h" 23 24 #include "GraphicsLayerClient.h" … … 59 60 virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time); 60 61 virtual void notifyFlushRequired(const WebCore::GraphicsLayer*); 61 virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore:: IntRect& rectToPaint);62 virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& rectToPaint); 62 63 63 64 void initialize(); -
trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContextGL.cpp
r163079 r163931 397 397 } 398 398 399 void AcceleratedCompositingContext::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const IntRect& rectToPaint)399 void AcceleratedCompositingContext::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& rectToPaint) 400 400 { 401 401 context.save(); 402 402 context.clip(rectToPaint); 403 core(m_webView)->mainFrame().view()->paint(&context, rectToPaint);403 core(m_webView)->mainFrame().view()->paint(&context, enclosingIntRect(rectToPaint)); 404 404 context.restore(); 405 405 } -
trunk/Source/WebKit/win/ChangeLog
r163903 r163931 1 2014-02-11 Zalan Bujtas <zalan@apple.com> 2 3 Subpixel rendering: Make GraphicsLayerClient::paintContents's clip rect subpixel based. 4 https://bugs.webkit.org/show_bug.cgi?id=128460 5 6 Reviewed by Simon Fraser. 7 8 GraphicsClient::paintContents takes clipRect as FloatRect now so that we can paint on 9 subpixel position. 10 11 No change in functionality. 12 13 * WebView.cpp: 14 (WebView::paintContents): 15 * WebView.h: 16 1 17 2014-02-11 Alex Christensen <achristensen@webkit.org> 2 18 -
trunk/Source/WebKit/win/WebView.cpp
r163885 r163931 6731 6731 } 6732 6732 6733 void WebView::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const IntRect& inClip)6733 void WebView::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& inClip) 6734 6734 { 6735 6735 Frame* frame = core(m_mainFrame); … … 6739 6739 context.save(); 6740 6740 context.clip(inClip); 6741 frame->view()->paint(&context, inClip);6741 frame->view()->paint(&context, enclosingIntRect(inClip)); 6742 6742 context.restore(); 6743 6743 } -
trunk/Source/WebKit/win/WebView.h
r163079 r163931 1020 1020 virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time); 1021 1021 virtual void notifyFlushRequired(const WebCore::GraphicsLayer*); 1022 virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore:: IntRect& inClip);1022 virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& inClip); 1023 1023 1024 1024 // CACFLayerTreeHostClient -
trunk/Source/WebKit2/ChangeLog
r163930 r163931 1 2014-02-11 Zalan Bujtas <zalan@apple.com> 2 3 Subpixel rendering: Make GraphicsLayerClient::paintContents's clip rect subpixel based. 4 https://bugs.webkit.org/show_bug.cgi?id=128460 5 6 Reviewed by Simon Fraser. 7 8 GraphicsClient::paintContents takes clipRect as FloatRect now so that we can paint on 9 subpixel position. 10 11 No change in functionality. 12 13 * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: 14 (WebKit::LayerTreeHostGtk::paintContents): 15 * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: 16 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: 17 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: 18 (WebKit::RemoteLayerTreeDrawingArea::paintContents): 19 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: 20 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 21 (WebKit::TiledCoreAnimationDrawingArea::paintContents): 22 1 23 2014-02-11 Sam Weinig <sam@webkit.org> 2 24 -
trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp
r158110 r163931 273 273 } 274 274 275 void LayerTreeHostGtk::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const IntRect& clipRect)275 void LayerTreeHostGtk::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect) 276 276 { 277 277 if (graphicsLayer == m_nonCompositedContentLayer.get()) { 278 m_webPage->drawRect(graphicsContext, clipRect);278 m_webPage->drawRect(graphicsContext, enclosingIntRect(clipRect)); 279 279 return; 280 280 } … … 282 282 for (auto& pageOverlayLayer : m_pageOverlayLayers) { 283 283 if (pageOverlayLayer.value.get() == graphicsLayer) { 284 m_webPage->drawPageOverlay(pageOverlayLayer.key, graphicsContext, clipRect);284 m_webPage->drawPageOverlay(pageOverlayLayer.key, graphicsContext, enclosingIntRect(clipRect)); 285 285 break; 286 286 } -
trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h
r162139 r163931 80 80 virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time); 81 81 virtual void notifyFlushRequired(const WebCore::GraphicsLayer*); 82 virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore:: IntRect& clipRect);82 virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect); 83 83 virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const { } 84 84 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
r162730 r163931 81 81 virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) override { } 82 82 virtual void notifyFlushRequired(const WebCore::GraphicsLayer*) override { } 83 virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore:: IntRect& clipRect) override;83 virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect) override; 84 84 virtual float deviceScaleFactor() const override; 85 85 virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const override { } -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
r163666 r163931 190 190 } 191 191 192 void RemoteLayerTreeDrawingArea::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const IntRect& clipRect)192 void RemoteLayerTreeDrawingArea::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect) 193 193 { 194 194 for (const auto& overlayAndLayer : m_pageOverlayLayers) { 195 195 if (overlayAndLayer.value.get() == graphicsLayer) { 196 m_webPage->drawPageOverlay(overlayAndLayer.key, graphicsContext, clipRect);196 m_webPage->drawPageOverlay(overlayAndLayer.key, graphicsContext, enclosingIntRect(clipRect)); 197 197 break; 198 198 } -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
r163676 r163931 95 95 virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) override; 96 96 virtual void notifyFlushRequired(const WebCore::GraphicsLayer*) override; 97 virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore:: IntRect& clipRect) override;97 virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect) override; 98 98 virtual float deviceScaleFactor() const override; 99 99 virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const override; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r163230 r163931 357 357 } 358 358 359 void TiledCoreAnimationDrawingArea::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const IntRect& clipRect)359 void TiledCoreAnimationDrawingArea::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect) 360 360 { 361 361 for (auto it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it) { 362 362 if (it->value.get() == graphicsLayer) { 363 m_webPage->drawPageOverlay(it->key, graphicsContext, clipRect);363 m_webPage->drawPageOverlay(it->key, graphicsContext, enclosingIntRect(clipRect)); 364 364 break; 365 365 }
Note: See TracChangeset
for help on using the changeset viewer.