Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 0aa79d80bd3b0f541317c4258b297326686f33a5..4dc11f9ecac7db38ec34ae53d73cd7c8b7aee5c1 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -2188,7 +2188,7 @@ IntRect CompositedLayerMapping::localClipRectForSquashedLayer(const PaintLayer&
return parentClipRect;
}
-void CompositedLayerMapping::doPaintTask(const GraphicsLayerPaintInfo& paintInfo, const GraphicsLayer& graphicsLayer, const PaintLayerFlags& paintLayerFlags, GraphicsContext* context,
+void CompositedLayerMapping::doPaintTask(const GraphicsLayerPaintInfo& paintInfo, const GraphicsLayer& graphicsLayer, const PaintLayerFlags& paintLayerFlags, GraphicsContext& context,
const IntRect& clip /* In the coords of rootLayer */) const
{
FontCachePurgePreventer fontCachePurgePreventer;
@@ -2196,7 +2196,7 @@ void CompositedLayerMapping::doPaintTask(const GraphicsLayerPaintInfo& paintInfo
IntSize offset = paintInfo.offsetFromLayoutObject;
AffineTransform translation;
translation.translate(-offset.width(), -offset.height());
- TransformRecorder transformRecorder(*context, graphicsLayer, translation);
+ TransformRecorder transformRecorder(context, graphicsLayer, translation);
// The dirtyRect is in the coords of the painting root.
IntRect dirtyRect(clip);
@@ -2215,7 +2215,7 @@ void CompositedLayerMapping::doPaintTask(const GraphicsLayerPaintInfo& paintInfo
#endif
float deviceScaleFactor = blink::deviceScaleFactor(paintInfo.paintLayer->layoutObject()->frame());
- context->setDeviceScaleFactor(deviceScaleFactor);
+ context.setDeviceScaleFactor(deviceScaleFactor);
if (paintInfo.paintLayer->compositingState() != PaintsIntoGroupedBacking) {
// FIXME: GraphicsLayers need a way to split for multicol.
@@ -2233,10 +2233,10 @@ void CompositedLayerMapping::doPaintTask(const GraphicsLayerPaintInfo& paintInfo
// FIXME: Is it correct to clip to dirtyRect in slimming paint mode?
// FIXME: Combine similar code here and LayerClipRecorder.
dirtyRect.intersect(paintInfo.localClipRectForSquashedLayer);
- context->paintController().createAndAppend<ClipDisplayItem>(graphicsLayer, DisplayItem::ClipLayerOverflowControls, dirtyRect);
+ context.paintController().createAndAppend<ClipDisplayItem>(graphicsLayer, DisplayItem::ClipLayerOverflowControls, dirtyRect);
PaintLayerPainter(*paintInfo.paintLayer).paintLayer(context, paintingInfo, paintLayerFlags);
- context->paintController().endItem<EndClipDisplayItem>(graphicsLayer, DisplayItem::clipTypeToEndClipType(DisplayItem::ClipLayerOverflowControls));
+ context.paintController().endItem<EndClipDisplayItem>(graphicsLayer, DisplayItem::clipTypeToEndClipType(DisplayItem::ClipLayerOverflowControls));
}
}
@@ -2403,10 +2403,10 @@ void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G
paintInfo.offsetFromLayoutObject = graphicsLayer->offsetFromLayoutObject();
// We have to use the same root as for hit testing, because both methods can compute and cache clipRects.
- doPaintTask(paintInfo, *graphicsLayer, paintLayerFlags, &context, interestRect);
+ doPaintTask(paintInfo, *graphicsLayer, paintLayerFlags, context, interestRect);
} else if (graphicsLayer == m_squashingLayer.get()) {
for (size_t i = 0; i < m_squashedLayers.size(); ++i)
- doPaintTask(m_squashedLayers[i], *graphicsLayer, paintLayerFlags, &context, interestRect);
+ doPaintTask(m_squashedLayers[i], *graphicsLayer, paintLayerFlags, context, interestRect);
} else if (graphicsLayer == layerForHorizontalScrollbar()) {
paintScrollbar(m_owningLayer.scrollableArea()->horizontalScrollbar(), context, interestRect);
} else if (graphicsLayer == layerForVerticalScrollbar()) {
@@ -2417,7 +2417,7 @@ void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G
ScrollableAreaPainter(*m_owningLayer.scrollableArea()).paintScrollCorner(context, -scrollCornerAndResizerLocation, cullRect);
ScrollableAreaPainter(*m_owningLayer.scrollableArea()).paintResizer(context, -scrollCornerAndResizerLocation, cullRect);
}
- InspectorInstrumentation::didPaint(m_owningLayer.layoutObject(), graphicsLayer, &context, LayoutRect(interestRect));
+ InspectorInstrumentation::didPaint(m_owningLayer.layoutObject(), graphicsLayer, context, LayoutRect(interestRect));
#if ENABLE(ASSERT)
if (Page* page = layoutObject()->frame()->page())
page->setIsPainting(false);

Powered by Google App Engine
This is Rietveld 408576698