Replace WTF::move with WTFMove
[WebKit-https.git] / Source / WebCore / rendering / RenderHTMLCanvas.cpp
index e42fe8d..eee7440 100644 (file)
@@ -41,8 +41,8 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-RenderHTMLCanvas::RenderHTMLCanvas(HTMLCanvasElement& element, PassRef<RenderStyle> style)
-    : RenderReplaced(element, WTF::move(style), element.size())
+RenderHTMLCanvas::RenderHTMLCanvas(HTMLCanvasElement& element, Ref<RenderStyle>&& style)
+    : RenderReplaced(element, WTFMove(style), element.size())
 {
     // Actual size is not known yet, report the default intrinsic size.
     view().frameView().incrementVisuallyNonEmptyPixelCount(roundedIntSize(intrinsicSize()));
@@ -50,7 +50,7 @@ RenderHTMLCanvas::RenderHTMLCanvas(HTMLCanvasElement& element, PassRef<RenderSty
 
 HTMLCanvasElement& RenderHTMLCanvas::canvasElement() const
 {
-    return toHTMLCanvasElement(nodeForNonAnonymous());
+    return downcast<HTMLCanvasElement>(nodeForNonAnonymous());
 }
 
 bool RenderHTMLCanvas::requiresLayer() const
@@ -66,26 +66,26 @@ bool RenderHTMLCanvas::requiresLayer() const
 
 void RenderHTMLCanvas::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
-    GraphicsContext* context = paintInfo.context;
+    GraphicsContext& context = paintInfo.context();
 
-    LayoutRect contentRect = contentBoxRect();
-    contentRect.moveBy(paintOffset);
-    LayoutRect paintRect = replacedContentRect(intrinsicSize());
-    paintRect.moveBy(paintOffset);
+    LayoutRect contentBoxRect = this->contentBoxRect();
+    contentBoxRect.moveBy(paintOffset);
+    LayoutRect replacedContentRect = this->replacedContentRect(intrinsicSize());
+    replacedContentRect.moveBy(paintOffset);
 
     // Not allowed to overflow the content box.
-    bool clip = !contentRect.contains(paintRect);
-    GraphicsContextStateSaver stateSaver(*paintInfo.context, clip);
+    bool clip = !contentBoxRect.contains(replacedContentRect);
+    GraphicsContextStateSaver stateSaver(paintInfo.context(), clip);
     if (clip)
-        paintInfo.context->clip(snappedIntRect(contentRect));
+        paintInfo.context().clip(snappedIntRect(contentBoxRect));
 
     if (Page* page = frame().page()) {
         if (paintInfo.phase == PaintPhaseForeground)
-            page->addRelevantRepaintedObject(this, intersection(paintRect, contentRect));
+            page->addRelevantRepaintedObject(this, intersection(replacedContentRect, contentBoxRect));
     }
 
     bool useLowQualityScale = style().imageRendering() == ImageRenderingCrispEdges || style().imageRendering() == ImageRenderingOptimizeSpeed;
-    canvasElement().paint(context, paintRect, useLowQualityScale);
+    canvasElement().paint(context, replacedContentRect, useLowQualityScale);
 }
 
 void RenderHTMLCanvas::canvasSizeChanged()