Migrate GraphicsContexts from pointers to references
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Aug 2015 06:15:28 +0000 (06:15 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Aug 2015 06:15:28 +0000 (06:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148561

Reviewed by Tim Horton.

Source/WebCore:

We were using GraphicsContext*s throughout our rendering code. However,
these contexts can't be nullptr. This patch migrates users to
GraphicsContext&s.

This is a purely mechanical change.

No new tests because there is no behavior change.

* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image):
* editing/Editor.cpp:
(WebCore::Editor::countMatchesForText):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::paintCaret):
(WebCore::CaretBase::paintCaret):
(WebCore::DragCaretController::paintDragCaret):
* editing/FrameSelection.h:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::paint):
(WebCore::HTMLCanvasElement::createImageBuffer):
(WebCore::HTMLCanvasElement::drawingContext):
* html/HTMLCanvasElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::paintCurrentFrameInContext):
* html/HTMLVideoElement.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawImage):
(WebCore::drawImageToContext):
(WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint):
* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRect):
* page/FrameView.cpp:
(WebCore::FrameView::paintScrollCorner):
(WebCore::FrameView::paintScrollbar):
(WebCore::FrameView::paintControlTints):
(WebCore::FrameView::willPaintContents):
(WebCore::FrameView::didPaintContents):
(WebCore::FrameView::paintContents):
(WebCore::FrameView::paintContentsForSnapshot):
(WebCore::FrameView::paintOverhangAreas):
(WebCore::FrameView::adjustPageHeightDeprecated):
* page/FrameView.h:
* page/PrintContext.cpp:
(WebCore::PrintContext::spoolPage):
(WebCore::PrintContext::spoolRect):
* page/win/FrameCGWin.cpp:
(WebCore::drawRectIntoContext):
(WebCore::imageFromRect):
* platform/ScrollView.cpp:
(WebCore::ScrollView::paintScrollCorner):
(WebCore::ScrollView::paintScrollbar):
(WebCore::ScrollView::paintScrollbars):
(WebCore::ScrollView::paintPanScrollIcon):
(WebCore::ScrollView::paint):
(WebCore::ScrollView::paintOverhangAreas):
(WebCore::ScrollView::calculateAndPaintOverhangAreas):
* platform/ScrollView.h:
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::paint):
* platform/Scrollbar.h:
* platform/ScrollbarTheme.h:
(WebCore::ScrollbarTheme::paintScrollCorner):
(WebCore::ScrollbarTheme::defaultPaintScrollCorner):
(WebCore::ScrollbarTheme::paintOverhangAreas):
* platform/ScrollbarThemeComposite.cpp:
(WebCore::ScrollbarThemeComposite::paintScrollCorner):
(WebCore::ScrollbarThemeComposite::paintOverhangAreas):
* platform/ScrollbarThemeComposite.h:
* platform/Theme.cpp:
(WebCore::Theme::drawNamedImage):
* platform/Theme.h:
(WebCore::Theme::paint):
* platform/Widget.h:
* platform/cocoa/ThemeCocoa.cpp:
(WebCore::fitContextToBox):
(WebCore::ThemeCocoa::drawNamedImage):
* platform/cocoa/ThemeCocoa.h:
* platform/efl/WidgetEfl.cpp:
(WebCore::Widget::paint):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern):
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::drawCrossfadeSubimage):
(WebCore::CrossfadeGeneratedImage::drawCrossfade):
(WebCore::CrossfadeGeneratedImage::draw):
(WebCore::CrossfadeGeneratedImage::drawPattern):
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::drawText):
(WebCore::FontCascade::drawEmphasisMarks):
(WebCore::FontCascade::drawSimpleText):
(WebCore::FontCascade::drawEmphasisMarksForSimpleText):
(WebCore::FontCascade::drawGlyphBuffer):
* platform/graphics/FontCascade.h:
* platform/graphics/GeneratedImage.h:
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::draw):
(WebCore::GradientImage::drawPattern):
* platform/graphics/GradientImage.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawText):
(WebCore::GraphicsContext::drawGlyphs):
(WebCore::GraphicsContext::drawEmphasisMarks):
(WebCore::GraphicsContext::drawBidiText):
(WebCore::GraphicsContext::drawImage):
(WebCore::GraphicsContext::drawTiledImage):
(WebCore::GraphicsContext::drawImageBuffer):
(WebCore::GraphicsContext::clipToImageBuffer):
(WebCore::GraphicsContext::createCompatibleBuffer):
(WebCore::GraphicsContext::isCompatibleWithBuffer):
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/Image.cpp:
(WebCore::Image::fillWithSolidColor):
(WebCore::Image::draw):
(WebCore::Image::drawTiled):
* platform/graphics/Image.h:
(WebCore::Image::drawFrameMatchingSourceSize):
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
* platform/graphics/ImageBuffer.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::paint):
(WebCore::MediaPlayer::paintCurrentFrameInContext):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::draw):
(WebCore::NamedImageGeneratedImage::drawPattern):
* platform/graphics/NamedImageGeneratedImage.h:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::adjustBlurRadius):
(WebCore::ShadowBlur::calculateLayerBoundingRect):
(WebCore::ShadowBlur::drawShadowBuffer):
(WebCore::ShadowBlur::drawRectShadow):
(WebCore::ShadowBlur::drawInsetShadow):
(WebCore::ShadowBlur::drawRectShadowWithoutTiling):
(WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
(WebCore::ShadowBlur::drawRectShadowWithTiling):
(WebCore::ShadowBlur::drawLayerPieces):
(WebCore::ShadowBlur::blurAndColorShadowBuffer):
(WebCore::ShadowBlur::beginShadowLayer):
(WebCore::ShadowBlur::endShadowLayer):
* platform/graphics/ShadowBlur.h:
* platform/graphics/TextRun.h:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext):
(WebCore::MediaPlayerPrivateAVFoundationCF::paint):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paint):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
* platform/graphics/cairo/BitmapImageCairo.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::drawGlyphsToContext):
(WebCore::drawGlyphsShadow):
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::drawComplexText):
(WebCore::FontCascade::drawEmphasisMarksForComplexText):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::drawPathShadow):
(WebCore::fillCurrentCairoPath):
(WebCore::shadowAndFillCurrentCairoPath):
(WebCore::shadowAndStrokeCurrentCairoPath):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::context):
(WebCore::ImageBuffer::clip):
(WebCore::ImageBuffer::draw):
(WebCore::ImageBuffer::drawPattern):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/cairo/ImageCairo.cpp:
(WebCore::Image::drawPattern):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::drawSurfaceToContext):
* platform/graphics/cairo/PlatformContextCairo.h:
* platform/graphics/cg/BitmapImageCG.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::paintToCanvas):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer):
(WebCore::ImageBuffer::context):
(WebCore::ImageBuffer::flushContext):
(WebCore::ImageBuffer::copyNativeImage):
(WebCore::ImageBuffer::draw):
(WebCore::ImageBuffer::drawPattern):
(WebCore::ImageBuffer::clip):
(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
(WebCore::ImageBuffer::putByteArray):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/cg/ImageCG.cpp:
(WebCore::Image::drawPattern):
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::cacheParametersMatch):
(WebCore::transformContextForPainting):
(WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
(WebCore::PDFDocumentImage::draw):
(WebCore::applyRotationForPainting):
(WebCore::PDFDocumentImage::drawPDFPage):
* platform/graphics/cg/PDFDocumentImage.h:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showLetterpressedGlyphsWithAdvances):
(WebCore::showGlyphsWithAdvances):
(WebCore::FontCascade::drawGlyphs):
(WebCore::FontCascade::drawComplexText):
(WebCore::FontCascade::drawEmphasisMarksForComplexText):
* platform/graphics/efl/ImageBufferEfl.cpp:
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::platformApplySoftware):
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::platformApplySoftware):
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::platformApplySoftware):
* platform/graphics/filters/FEMerge.cpp:
(WebCore::FEMerge::platformApplySoftware):
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::platformApplySoftware):
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::platformApplySoftware):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::createImageBufferResult): Deleted.
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::platformApplySoftware):
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::platformApplySoftware):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::paint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::GraphicsContext::drawLineForDocumentMarker):
* platform/graphics/mac/IconMac.mm:
(WebCore::Icon::paint):
* platform/graphics/mac/MediaPlayerPrivateQTKit.h:
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
(WebCore::MediaPlayerPrivateQTKit::paint):
* platform/graphics/mac/PDFDocumentImageMac.mm:
(WebCore::PDFDocumentImage::drawPDFPage):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
* platform/graphics/texmap/BitmapTexture.cpp:
(WebCore::BitmapTexture::updateContents):
* platform/graphics/win/FontCGWin.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/win/FontWin.cpp:
(WebCore::FontCascade::drawComplexText):
(WebCore::FontCascade::drawEmphasisMarksForComplexText):
* platform/graphics/win/IconWin.cpp:
(WebCore::Icon::paint):
* platform/graphics/win/ImageCGWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/graphics/win/LocalWindowsContext.h:
(WebCore::LocalWindowsContext::LocalWindowsContext):
(WebCore::LocalWindowsContext::~LocalWindowsContext):
* platform/gtk/WidgetGtk.cpp:
(WebCore::Widget::paint):
* platform/ios/WidgetIOS.mm:
(WebCore::Widget::paint):
* platform/mac/DragImageMac.mm:
(WebCore::drawAtPoint):
* platform/mac/LocalCurrentGraphicsContext.h:
(WebCore::ContextContainer::ContextContainer):
* platform/mac/LocalCurrentGraphicsContext.mm:
(WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
(WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext):
(WebCore::LocalCurrentGraphicsContext::cgContext):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paint):
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
(WebCore::paintToggleButton):
(WebCore::paintButton):
(WebCore::paintStepper):
(WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
(WebCore::ThemeMac::paint):
* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint):
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::paint):
* platform/mock/mediasource/MockMediaPlayerMediaSource.h:
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::paint):
* platform/win/ScrollbarThemeWin.cpp:
(WebCore::ScrollbarThemeWin::paintTrackPiece):
(WebCore::ScrollbarThemeWin::paintButton):
(WebCore::ScrollbarThemeWin::paintThumb):
* platform/win/WebCoreTextRenderer.cpp:
(WebCore::doDrawTextAtPoint):
* platform/win/WidgetWin.cpp:
(WebCore::Widget::paint):
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paint):
(WebCore::EllipsisBox::paintSelection):
* rendering/EllipsisBox.h:
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::inputContext):
(WebCore::FilterEffectRendererHelper::applyFilterEffect):
* rendering/FilterEffectRenderer.h:
* rendering/ImageQualityController.cpp:
(WebCore::ImageQualityController::shouldPaintAtLowQuality):
* rendering/ImageQualityController.h:
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintFillLayer):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/PaintInfo.h:
(WebCore::PaintInfo::PaintInfo):
(WebCore::PaintInfo::context):
(WebCore::PaintInfo::setContext):
(WebCore::PaintInfo::applyTransform):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint):
(WebCore::RenderBlock::paintCaret):
(WebCore::RenderBlock::paintObject):
(WebCore::RenderBlock::paintSelection):
(WebCore::clipOutPositionedObjects):
(WebCore::RenderBlock::blockSelectionGap):
(WebCore::RenderBlock::logicalLeftSelectionGap):
(WebCore::RenderBlock::logicalRightSelectionGap):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::paintColumnRules):
(WebCore::RenderBlockFlow::clipOutFloatingObjects):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::determineBackgroundBleedAvoidance):
(WebCore::RenderBox::paintBoxDecorations):
(WebCore::RenderBox::paintMask):
(WebCore::RenderBox::paintClippingMask):
(WebCore::RenderBox::paintMaskImages):
(WebCore::RenderBox::paintFillLayers):
(WebCore::RenderBox::pushContentsClip):
(WebCore::RenderBox::popContentsClip):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::shouldPaintAtLowQuality):
(WebCore::RenderBoxModelObject::clipRoundedInnerRect):
(WebCore::applyBoxShadowForBackground):
(WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::paintNinePieceImage):
(WebCore::RenderBoxModelObject::paintOneBorderSide):
(WebCore::RenderBoxModelObject::paintBorderSides):
(WebCore::RenderBoxModelObject::paintTranslucentBorderSides):
(WebCore::RenderBoxModelObject::paintBorder):
(WebCore::RenderBoxModelObject::drawBoxSideFromPath):
(WebCore::RenderBoxModelObject::clipBorderSidePolygon):
(WebCore::RenderBoxModelObject::clipBorderSideForComplexInnerPath):
(WebCore::RenderBoxModelObject::paintBoxShadow):
(WebCore::RenderBoxModelObject::shouldAntialiasLines):
* rendering/RenderBoxModelObject.h:
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::paint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
(WebCore::RenderElement::paintOutline):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::paintSnapshotImage):
(WebCore::drawReplacementArrow):
(WebCore::RenderEmbeddedObject::paintReplaced):
* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::paintBoxDecorations):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paintColumnBorder):
(WebCore::RenderFrameSet::paintRowBorder):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintAreaElementFocusRing):
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):
(WebCore::RenderInline::paintOutlineForLine):
* rendering/RenderInline.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::RenderLayer::paintOverflowControls):
(WebCore::RenderLayer::paintScrollCorner):
(WebCore::RenderLayer::drawPlatformResizerImage):
(WebCore::RenderLayer::paintResizer):
(WebCore::RenderLayer::paint):
(WebCore::RenderLayer::paintOverlayScrollbars):
(WebCore::RenderLayer::clipToRect):
(WebCore::RenderLayer::restoreClip):
(WebCore::RenderLayer::paintLayer):
(WebCore::RenderLayer::paintLayerContentsAndReflection):
(WebCore::RenderLayer::setupFontSubpixelQuantization):
(WebCore::RenderLayer::setupClipPath):
(WebCore::RenderLayer::hasFilterThatIsPainting):
(WebCore::RenderLayer::setupFilters):
(WebCore::RenderLayer::applyFilters):
(WebCore::RenderLayer::paintFixedLayersInNamedFlows):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintLayerByApplyingTransform):
(WebCore::RenderLayer::paintList):
(WebCore::RenderLayer::paintTransformedLayerIntoFragments):
(WebCore::RenderLayer::paintBackgroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
(WebCore::RenderLayer::paintOutlineForFragments):
(WebCore::RenderLayer::paintMaskForFragments):
(WebCore::RenderLayer::paintChildClippingMaskForFragments):
(WebCore::RenderLayer::paintOverflowControlsForFragments):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::paintScrollbar):
(WebCore::RenderLayerCompositor::paintContents):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintScrollbar):
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
* rendering/RenderMediaControls.cpp:
(WebCore::getUnzoomedRectAndAdjustCurrentContext):
(WebCore::RenderMediaControls::paintMediaControlsPart):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::paintColumnRules):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addPDFURLRect):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* rendering/RenderReplica.cpp:
(WebCore::RenderReplica::paint):
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::paint):
(WebCore::RenderScrollbar::paintPart):
* rendering/RenderScrollbar.h:
* rendering/RenderScrollbarPart.cpp:
(WebCore::RenderScrollbarPart::paintIntoRect):
* rendering/RenderScrollbarPart.h:
* rendering/RenderScrollbarTheme.cpp:
(WebCore::RenderScrollbarTheme::paintScrollCorner):
(WebCore::RenderScrollbarTheme::paintScrollbarBackground):
(WebCore::RenderScrollbarTheme::paintTrackBackground):
(WebCore::RenderScrollbarTheme::paintTrackPiece):
(WebCore::RenderScrollbarTheme::paintButton):
(WebCore::RenderScrollbarTheme::paintThumb):
* rendering/RenderScrollbarTheme.h:
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::paintSnapshot):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::paintBoxDecorations):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintCollapsedBorders):
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paintRowGroupBorder):
(WebCore::RenderTableSection::paintRowGroupBorderIfRequired):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
(WebCore::RenderTheme::paintBorderOnly):
(WebCore::RenderTheme::paintDecorations):
(WebCore::RenderTheme::paintSliderTicks):
* rendering/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::paintThemePart):
* rendering/RenderThemeGtk.cpp:
(WebCore::paintToggle):
(WebCore::renderButton):
(WebCore::RenderThemeGtk::paintMenuList):
(WebCore::RenderThemeGtk::paintTextField):
(WebCore::paintGdkPixbuf):
(WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
(WebCore::RenderThemeGtk::paintCapsLockIndicator):
(WebCore::RenderThemeGtk::paintSliderTrack):
(WebCore::RenderThemeGtk::paintSliderThumb):
(WebCore::RenderThemeGtk::paintProgressBar):
(WebCore::paintSpinArrowButton):
(WebCore::RenderThemeGtk::paintMediaButton):
(WebCore::RenderThemeGtk::paintMediaFullscreenButton):
(WebCore::RenderThemeGtk::paintMediaMuteButton):
(WebCore::RenderThemeGtk::paintMediaPlayButton):
(WebCore::RenderThemeGtk::paintMediaSeekBackButton):
(WebCore::RenderThemeGtk::paintMediaSeekForwardButton):
(WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
(WebCore::RenderThemeGtk::paintMediaSliderTrack):
(WebCore::RenderThemeGtk::paintMediaSliderThumb):
(WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::addRoundedBorderClip):
(WebCore::RenderThemeIOS::paintCheckboxDecorations):
(WebCore::RenderThemeIOS::paintRadioDecorations):
(WebCore::RenderThemeIOS::paintTextFieldDecorations):
(WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
(WebCore::RenderThemeIOS::paintSliderTrack):
(WebCore::RenderThemeIOS::paintSliderThumbDecorations):
(WebCore::RenderThemeIOS::paintProgressBar):
(WebCore::RenderThemeIOS::paintPushButtonDecorations):
(WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintTextField):
(WebCore::RenderThemeMac::paintTextArea):
(WebCore::RenderThemeMac::paintMenuList):
(WebCore::RenderThemeMac::paintMeter):
(WebCore::RenderThemeMac::paintProgressBar):
(WebCore::RenderThemeMac::paintMenuListButtonGradients):
(WebCore::RenderThemeMac::paintMenuListButtonDecorations):
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
(WebCore::RenderThemeMac::paintSliderTrack):
(WebCore::RenderThemeMac::paintSliderThumb):
(WebCore::RenderThemeMac::paintSearchField):
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeMac::paintSearchFieldResultsButton):
(WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
(WebCore::RenderThemeMac::paintImageControlsButton):
(WebCore::RenderThemeMac::paintAttachment):
* rendering/RenderThemeSafari.cpp:
(WebCore::RenderThemeSafari::paintCheckbox):
(WebCore::RenderThemeSafari::paintRadio):
(WebCore::RenderThemeSafari::paintButton):
(WebCore::RenderThemeSafari::paintTextField):
(WebCore::RenderThemeSafari::paintCapsLockIndicator):
(WebCore::RenderThemeSafari::paintTextArea):
(WebCore::RenderThemeSafari::paintMenuList):
(WebCore::RenderThemeSafari::paintMenuListButtonGradients):
(WebCore::RenderThemeSafari::paintMenuListButtonDecorations):
(WebCore::RenderThemeSafari::paintSliderTrack):
(WebCore::RenderThemeSafari::paintSliderThumb):
(WebCore::RenderThemeSafari::paintSearchField):
(WebCore::RenderThemeSafari::paintSearchFieldCancelButton):
(WebCore::RenderThemeSafari::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeSafari::paintSearchFieldResultsButton):
* rendering/RenderThemeWin.cpp:
(WebCore::drawControl):
(WebCore::RenderThemeWin::paintButton):
(WebCore::RenderThemeWin::paintInnerSpinButton):
(WebCore::RenderThemeWin::paintTextField):
(WebCore::RenderThemeWin::paintMenuList):
(WebCore::RenderThemeWin::paintMenuListButtonDecorations):
(WebCore::RenderThemeWin::paintSliderTrack):
(WebCore::RenderThemeWin::paintSliderThumb):
(WebCore::RenderThemeWin::paintSearchFieldCancelButton):
(WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeWin::paintSearchFieldResultsButton):
(WebCore::RenderThemeWin::paintMeter):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced):
* rendering/RenderView.cpp:
(WebCore::RenderView::paint):
(WebCore::RenderView::paintBoxDecorations):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paintContents):
(WebCore::RenderWidget::paint):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::lineSelectionGap):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::paint):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::paint):
* rendering/mathml/RenderMathMLMenclose.cpp:
(WebCore::RenderMathMLMenclose::paint):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::paintGlyph):
(WebCore::RenderMathMLOperator::fillWithVerticalExtensionGlyph):
(WebCore::RenderMathMLOperator::fillWithHorizontalExtensionGlyph):
(WebCore::RenderMathMLOperator::paint):
* rendering/mathml/RenderMathMLRadicalOperator.cpp:
(WebCore::RenderMathMLRadicalOperator::paint):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::paint):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
* rendering/style/NinePieceImage.cpp:
(WebCore::NinePieceImage::paint):
* rendering/style/NinePieceImage.h:
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::paint):
* rendering/svg/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::fillShape):
(WebCore::RenderSVGEllipse::strokeShape):
* rendering/svg/RenderSVGEllipse.h:
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::paint):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::paint):
(WebCore::RenderSVGImage::paintForeground):
* rendering/svg/RenderSVGPath.cpp:
(WebCore::useStrokeStyleToFill):
(WebCore::RenderSVGPath::strokeShape):
* rendering/svg/RenderSVGPath.h:
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::fillShape):
(WebCore::RenderSVGRect::strokeShape):
* rendering/svg/RenderSVGRect.h:
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyResource):
(WebCore::RenderSVGResourceClipper::pathOnlyClipping):
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
(WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
* rendering/svg/RenderSVGResourceClipper.h:
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::createMaskAndSwapContextForTextGradient):
(WebCore::clipToTextMask):
(WebCore::RenderSVGResourceGradient::applyResource):
* rendering/svg/RenderSVGResourceMarker.cpp:
(WebCore::RenderSVGResourceMarker::applyViewportClip):
(WebCore::RenderSVGResourceMarker::draw):
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::applyResource):
(WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::postApplyResource):
(WebCore::RenderSVGResourcePattern::createTileImage):
* rendering/svg/RenderSVGResourceSolidColor.cpp:
(WebCore::RenderSVGResourceSolidColor::postApplyResource):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::paintReplaced):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::fillShape):
(WebCore::RenderSVGShape::strokeShape):
(WebCore::RenderSVGShape::fillStrokeMarkers):
(WebCore::RenderSVGShape::paint):
* rendering/svg/RenderSVGShape.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::paint):
* rendering/svg/RenderSVGViewportContainer.cpp:
(WebCore::RenderSVGViewportContainer::applyViewportClip):
* rendering/svg/SVGInlineFlowBox.cpp:
(WebCore::SVGInlineFlowBox::paintSelectionBackground):
(WebCore::SVGInlineFlowBox::paint):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paintSelectionBackground):
(WebCore::SVGInlineTextBox::paint):
(WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
(WebCore::SVGInlineTextBox::paintDecoration):
(WebCore::SVGInlineTextBox::paintDecorationWithStyle):
(WebCore::SVGInlineTextBox::paintTextWithShadows):
(WebCore::SVGInlineTextBox::paintText):
* rendering/svg/SVGInlineTextBox.h:
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::~SVGRenderingContext):
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):
(WebCore::SVGRenderingContext::createImageBuffer):
(WebCore::SVGRenderingContext::clipToImageBuffer):
(WebCore::SVGRenderingContext::bufferForeground):
(WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Deleted.
* rendering/svg/SVGRenderingContext.h:
* rendering/svg/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::paint):
* rendering/svg/SVGTextRunRenderingContext.cpp:
(WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
* rendering/svg/SVGTextRunRenderingContext.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawForContainer):
(WebCore::SVGImage::drawPatternForContainer):
(WebCore::SVGImage::draw):
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::draw):
(WebCore::SVGImageForContainer::drawPattern):
* svg/graphics/SVGImageForContainer.h:
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::platformApplySoftware):

Source/WebKit/mac:

* Misc/WebKitNSStringExtras.mm:
(-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]):
* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::imageForCurrentSharingServicePickerItem):
* WebView/WebFrame.mm:
(-[WebFrame _drawRect:contentsOnly:]):

Source/WebKit2:

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::paint):
* Shared/cairo/ShareableBitmapCairo.cpp:
(WebKit::ShareableBitmap::paint):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::imageForRect):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::paint):
(WebKit::NetscapePlugin::snapshot):
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Netscape/NetscapePluginNone.cpp:
(WebKit::NetscapePlugin::platformPaint):
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::platformPaint):
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
(WebKit::NetscapePlugin::platformPaint):
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::updateControlTints):
(WebKit::PDFPlugin::paintControlForLayerInContext):
* WebProcess/Plugins/Plugin.cpp:
(WebKit::Plugin::updateControlTints):
* WebProcess/Plugins/Plugin.h:
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::paint):
* WebProcess/Plugins/PluginProxy.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::paint):
* WebProcess/Plugins/PluginView.h:
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::convertCairoSurfaceToShareableBitmap):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::drawRect):
(WebKit::WebPage::snapshotAtSize):
(WebKit::WebPage::snapshotNode):
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindIndicatorOverlayClientIOS::drawRect):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189144 268f45cc-cd09-0410-ab3c-d52691b4dbfc

252 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFilterImageValue.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/HTMLCanvasElement.h
Source/WebCore/html/HTMLVideoElement.cpp
Source/WebCore/html/HTMLVideoElement.h
Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/inspector/InspectorOverlay.cpp
Source/WebCore/page/FrameSnapshotting.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/PrintContext.cpp
Source/WebCore/page/win/FrameCGWin.cpp
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollView.h
Source/WebCore/platform/Scrollbar.cpp
Source/WebCore/platform/Scrollbar.h
Source/WebCore/platform/ScrollbarTheme.h
Source/WebCore/platform/ScrollbarThemeComposite.cpp
Source/WebCore/platform/ScrollbarThemeComposite.h
Source/WebCore/platform/Theme.cpp
Source/WebCore/platform/Theme.h
Source/WebCore/platform/Widget.h
Source/WebCore/platform/cocoa/ThemeCocoa.cpp
Source/WebCore/platform/cocoa/ThemeCocoa.h
Source/WebCore/platform/efl/WidgetEfl.cpp
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/BitmapImage.h
Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp
Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h
Source/WebCore/platform/graphics/FontCascade.cpp
Source/WebCore/platform/graphics/FontCascade.h
Source/WebCore/platform/graphics/GeneratedImage.h
Source/WebCore/platform/graphics/GradientImage.cpp
Source/WebCore/platform/graphics/GradientImage.h
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/GraphicsContext3D.h
Source/WebCore/platform/graphics/Image.cpp
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/graphics/ImageBuffer.cpp
Source/WebCore/platform/graphics/ImageBuffer.h
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/MediaPlayerPrivate.h
Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp
Source/WebCore/platform/graphics/NamedImageGeneratedImage.h
Source/WebCore/platform/graphics/ShadowBlur.cpp
Source/WebCore/platform/graphics/ShadowBlur.h
Source/WebCore/platform/graphics/TextRun.h
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm
Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp
Source/WebCore/platform/graphics/cairo/FontCairo.cpp
Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
Source/WebCore/platform/graphics/cairo/ImageCairo.cpp
Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp
Source/WebCore/platform/graphics/cairo/PlatformContextCairo.h
Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp
Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebCore/platform/graphics/cg/ImageCG.cpp
Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp
Source/WebCore/platform/graphics/cg/PDFDocumentImage.h
Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm
Source/WebCore/platform/graphics/efl/ImageBufferEfl.cpp
Source/WebCore/platform/graphics/filters/FEBlend.cpp
Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp
Source/WebCore/platform/graphics/filters/FEComposite.cpp
Source/WebCore/platform/graphics/filters/FEDropShadow.cpp
Source/WebCore/platform/graphics/filters/FEFlood.cpp
Source/WebCore/platform/graphics/filters/FEMerge.cpp
Source/WebCore/platform/graphics/filters/FEOffset.cpp
Source/WebCore/platform/graphics/filters/FETile.cpp
Source/WebCore/platform/graphics/filters/FilterEffect.cpp
Source/WebCore/platform/graphics/filters/SourceAlpha.cpp
Source/WebCore/platform/graphics/filters/SourceGraphic.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h
Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm
Source/WebCore/platform/graphics/mac/IconMac.mm
Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
Source/WebCore/platform/graphics/mac/PDFDocumentImageMac.mm
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp
Source/WebCore/platform/graphics/win/FontCGWin.cpp
Source/WebCore/platform/graphics/win/FontWin.cpp
Source/WebCore/platform/graphics/win/IconWin.cpp
Source/WebCore/platform/graphics/win/ImageCGWin.cpp
Source/WebCore/platform/graphics/win/ImageCairoWin.cpp
Source/WebCore/platform/graphics/win/LocalWindowsContext.h
Source/WebCore/platform/gtk/WidgetGtk.cpp
Source/WebCore/platform/ios/WidgetIOS.mm
Source/WebCore/platform/mac/DragImageMac.mm
Source/WebCore/platform/mac/LocalCurrentGraphicsContext.h
Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm
Source/WebCore/platform/mac/ScrollbarThemeMac.mm
Source/WebCore/platform/mac/ThemeMac.h
Source/WebCore/platform/mac/ThemeMac.mm
Source/WebCore/platform/mac/WidgetMac.mm
Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp
Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h
Source/WebCore/platform/win/PopupMenuWin.cpp
Source/WebCore/platform/win/ScrollbarThemeWin.cpp
Source/WebCore/platform/win/WebCoreTextRenderer.cpp
Source/WebCore/platform/win/WidgetWin.cpp
Source/WebCore/rendering/EllipsisBox.cpp
Source/WebCore/rendering/EllipsisBox.h
Source/WebCore/rendering/FilterEffectRenderer.cpp
Source/WebCore/rendering/FilterEffectRenderer.h
Source/WebCore/rendering/ImageQualityController.cpp
Source/WebCore/rendering/ImageQualityController.h
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/PaintInfo.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderBoxModelObject.h
Source/WebCore/rendering/RenderDetailsMarker.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderFieldset.cpp
Source/WebCore/rendering/RenderFileUploadControl.cpp
Source/WebCore/rendering/RenderFrameSet.cpp
Source/WebCore/rendering/RenderHTMLCanvas.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderImage.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderInline.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderListMarker.cpp
Source/WebCore/rendering/RenderMediaControls.cpp
Source/WebCore/rendering/RenderMultiColumnSet.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderReplica.cpp
Source/WebCore/rendering/RenderScrollbar.cpp
Source/WebCore/rendering/RenderScrollbar.h
Source/WebCore/rendering/RenderScrollbarPart.cpp
Source/WebCore/rendering/RenderScrollbarPart.h
Source/WebCore/rendering/RenderScrollbarTheme.cpp
Source/WebCore/rendering/RenderScrollbarTheme.h
Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderThemeEfl.cpp
Source/WebCore/rendering/RenderThemeGtk.cpp
Source/WebCore/rendering/RenderThemeGtk.h
Source/WebCore/rendering/RenderThemeIOS.h
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeSafari.cpp
Source/WebCore/rendering/RenderThemeWin.cpp
Source/WebCore/rendering/RenderVideo.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderWidget.cpp
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
Source/WebCore/rendering/shapes/Shape.cpp
Source/WebCore/rendering/style/NinePieceImage.cpp
Source/WebCore/rendering/style/NinePieceImage.h
Source/WebCore/rendering/svg/RenderSVGContainer.cpp
Source/WebCore/rendering/svg/RenderSVGEllipse.cpp
Source/WebCore/rendering/svg/RenderSVGEllipse.h
Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
Source/WebCore/rendering/svg/RenderSVGImage.cpp
Source/WebCore/rendering/svg/RenderSVGPath.cpp
Source/WebCore/rendering/svg/RenderSVGPath.h
Source/WebCore/rendering/svg/RenderSVGRect.cpp
Source/WebCore/rendering/svg/RenderSVGRect.h
Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
Source/WebCore/rendering/svg/RenderSVGResourceClipper.h
Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp
Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp
Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/RenderSVGShape.cpp
Source/WebCore/rendering/svg/RenderSVGShape.h
Source/WebCore/rendering/svg/RenderSVGText.cpp
Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp
Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp
Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
Source/WebCore/rendering/svg/SVGInlineTextBox.h
Source/WebCore/rendering/svg/SVGRenderingContext.cpp
Source/WebCore/rendering/svg/SVGRenderingContext.h
Source/WebCore/rendering/svg/SVGRootInlineBox.cpp
Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp
Source/WebCore/rendering/svg/SVGTextRunRenderingContext.h
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebCore/svg/graphics/SVGImage.h
Source/WebCore/svg/graphics/SVGImageForContainer.cpp
Source/WebCore/svg/graphics/SVGImageForContainer.h
Source/WebCore/svg/graphics/filters/SVGFEImage.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebKitNSStringExtras.mm
Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit2/ChangeLog
Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginNone.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.h
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit2/WebProcess/Plugins/Plugin.cpp
Source/WebKit2/WebProcess/Plugins/Plugin.h
Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
Source/WebKit2/WebProcess/Plugins/PluginProxy.h
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.h
Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/ios/FindControllerIOS.mm

index eedec16..4f06c35 100644 (file)
@@ -1,3 +1,723 @@
+2015-08-28  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Migrate GraphicsContexts from pointers to references
+        https://bugs.webkit.org/show_bug.cgi?id=148561
+
+        Reviewed by Tim Horton.
+
+        We were using GraphicsContext*s throughout our rendering code. However,
+        these contexts can't be nullptr. This patch migrates users to
+        GraphicsContext&s.
+
+        This is a purely mechanical change.
+
+        No new tests because there is no behavior change.
+
+        * css/CSSFilterImageValue.cpp:
+        (WebCore::CSSFilterImageValue::image):
+        * editing/Editor.cpp:
+        (WebCore::Editor::countMatchesForText):
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::paintCaret):
+        (WebCore::CaretBase::paintCaret):
+        (WebCore::DragCaretController::paintDragCaret):
+        * editing/FrameSelection.h:
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::paint):
+        (WebCore::HTMLCanvasElement::createImageBuffer):
+        (WebCore::HTMLCanvasElement::drawingContext):
+        * html/HTMLCanvasElement.h:
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
+        * html/HTMLVideoElement.h:
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::drawImage):
+        (WebCore::drawImageToContext):
+        (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
+        (WebCore::CanvasRenderingContext2D::drawTextInternal):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
+        * inspector/InspectorOverlay.cpp:
+        (WebCore::InspectorOverlay::paint):
+        * page/FrameSnapshotting.cpp:
+        (WebCore::snapshotFrameRect):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::paintScrollCorner):
+        (WebCore::FrameView::paintScrollbar):
+        (WebCore::FrameView::paintControlTints):
+        (WebCore::FrameView::willPaintContents):
+        (WebCore::FrameView::didPaintContents):
+        (WebCore::FrameView::paintContents):
+        (WebCore::FrameView::paintContentsForSnapshot):
+        (WebCore::FrameView::paintOverhangAreas):
+        (WebCore::FrameView::adjustPageHeightDeprecated):
+        * page/FrameView.h:
+        * page/PrintContext.cpp:
+        (WebCore::PrintContext::spoolPage):
+        (WebCore::PrintContext::spoolRect):
+        * page/win/FrameCGWin.cpp:
+        (WebCore::drawRectIntoContext):
+        (WebCore::imageFromRect):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::paintScrollCorner):
+        (WebCore::ScrollView::paintScrollbar):
+        (WebCore::ScrollView::paintScrollbars):
+        (WebCore::ScrollView::paintPanScrollIcon):
+        (WebCore::ScrollView::paint):
+        (WebCore::ScrollView::paintOverhangAreas):
+        (WebCore::ScrollView::calculateAndPaintOverhangAreas):
+        * platform/ScrollView.h:
+        * platform/Scrollbar.cpp:
+        (WebCore::Scrollbar::paint):
+        * platform/Scrollbar.h:
+        * platform/ScrollbarTheme.h:
+        (WebCore::ScrollbarTheme::paintScrollCorner):
+        (WebCore::ScrollbarTheme::defaultPaintScrollCorner):
+        (WebCore::ScrollbarTheme::paintOverhangAreas):
+        * platform/ScrollbarThemeComposite.cpp:
+        (WebCore::ScrollbarThemeComposite::paintScrollCorner):
+        (WebCore::ScrollbarThemeComposite::paintOverhangAreas):
+        * platform/ScrollbarThemeComposite.h:
+        * platform/Theme.cpp:
+        (WebCore::Theme::drawNamedImage):
+        * platform/Theme.h:
+        (WebCore::Theme::paint):
+        * platform/Widget.h:
+        * platform/cocoa/ThemeCocoa.cpp:
+        (WebCore::fitContextToBox):
+        (WebCore::ThemeCocoa::drawNamedImage):
+        * platform/cocoa/ThemeCocoa.h:
+        * platform/efl/WidgetEfl.cpp:
+        (WebCore::Widget::paint):
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::drawPattern):
+        * platform/graphics/BitmapImage.h:
+        * platform/graphics/CrossfadeGeneratedImage.cpp:
+        (WebCore::drawCrossfadeSubimage):
+        (WebCore::CrossfadeGeneratedImage::drawCrossfade):
+        (WebCore::CrossfadeGeneratedImage::draw):
+        (WebCore::CrossfadeGeneratedImage::drawPattern):
+        * platform/graphics/CrossfadeGeneratedImage.h:
+        * platform/graphics/FontCascade.cpp:
+        (WebCore::FontCascade::drawText):
+        (WebCore::FontCascade::drawEmphasisMarks):
+        (WebCore::FontCascade::drawSimpleText):
+        (WebCore::FontCascade::drawEmphasisMarksForSimpleText):
+        (WebCore::FontCascade::drawGlyphBuffer):
+        * platform/graphics/FontCascade.h:
+        * platform/graphics/GeneratedImage.h:
+        * platform/graphics/GradientImage.cpp:
+        (WebCore::GradientImage::draw):
+        (WebCore::GradientImage::drawPattern):
+        * platform/graphics/GradientImage.h:
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::drawText):
+        (WebCore::GraphicsContext::drawGlyphs):
+        (WebCore::GraphicsContext::drawEmphasisMarks):
+        (WebCore::GraphicsContext::drawBidiText):
+        (WebCore::GraphicsContext::drawImage):
+        (WebCore::GraphicsContext::drawTiledImage):
+        (WebCore::GraphicsContext::drawImageBuffer):
+        (WebCore::GraphicsContext::clipToImageBuffer):
+        (WebCore::GraphicsContext::createCompatibleBuffer):
+        (WebCore::GraphicsContext::isCompatibleWithBuffer):
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/Image.cpp:
+        (WebCore::Image::fillWithSolidColor):
+        (WebCore::Image::draw):
+        (WebCore::Image::drawTiled):
+        * platform/graphics/Image.h:
+        (WebCore::Image::drawFrameMatchingSourceSize):
+        * platform/graphics/ImageBuffer.cpp:
+        (WebCore::ImageBuffer::createCompatibleBuffer):
+        * platform/graphics/ImageBuffer.h:
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::paint):
+        (WebCore::MediaPlayer::paintCurrentFrameInContext):
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
+        * platform/graphics/NamedImageGeneratedImage.cpp:
+        (WebCore::NamedImageGeneratedImage::draw):
+        (WebCore::NamedImageGeneratedImage::drawPattern):
+        * platform/graphics/NamedImageGeneratedImage.h:
+        * platform/graphics/ShadowBlur.cpp:
+        (WebCore::ShadowBlur::adjustBlurRadius):
+        (WebCore::ShadowBlur::calculateLayerBoundingRect):
+        (WebCore::ShadowBlur::drawShadowBuffer):
+        (WebCore::ShadowBlur::drawRectShadow):
+        (WebCore::ShadowBlur::drawInsetShadow):
+        (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
+        (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
+        (WebCore::ShadowBlur::drawInsetShadowWithTiling):
+        (WebCore::ShadowBlur::drawRectShadowWithTiling):
+        (WebCore::ShadowBlur::drawLayerPieces):
+        (WebCore::ShadowBlur::blurAndColorShadowBuffer):
+        (WebCore::ShadowBlur::beginShadowLayer):
+        (WebCore::ShadowBlur::endShadowLayer):
+        * platform/graphics/ShadowBlur.h:
+        * platform/graphics/TextRun.h:
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext):
+        (WebCore::MediaPlayerPrivateAVFoundationCF::paint):
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paint):
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
+        * platform/graphics/cairo/BitmapImageCairo.cpp:
+        (WebCore::BitmapImage::draw):
+        * platform/graphics/cairo/FontCairo.cpp:
+        (WebCore::drawGlyphsToContext):
+        (WebCore::drawGlyphsShadow):
+        (WebCore::FontCascade::drawGlyphs):
+        * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
+        (WebCore::FontCascade::drawComplexText):
+        (WebCore::FontCascade::drawEmphasisMarksForComplexText):
+        * platform/graphics/cairo/GraphicsContextCairo.cpp:
+        (WebCore::drawPathShadow):
+        (WebCore::fillCurrentCairoPath):
+        (WebCore::shadowAndFillCurrentCairoPath):
+        (WebCore::shadowAndStrokeCurrentCairoPath):
+        (WebCore::GraphicsContext::fillPath):
+        (WebCore::GraphicsContext::strokePath):
+        (WebCore::GraphicsContext::fillRect):
+        (WebCore::GraphicsContext::strokeRect):
+        (WebCore::GraphicsContext::platformFillRoundedRect):
+        (WebCore::GraphicsContext::fillRectWithRoundedHole):
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::ImageBuffer::context):
+        (WebCore::ImageBuffer::clip):
+        (WebCore::ImageBuffer::draw):
+        (WebCore::ImageBuffer::drawPattern):
+        (WebCore::ImageBuffer::toDataURL):
+        * platform/graphics/cairo/ImageCairo.cpp:
+        (WebCore::Image::drawPattern):
+        * platform/graphics/cairo/PlatformContextCairo.cpp:
+        (WebCore::PlatformContextCairo::drawSurfaceToContext):
+        * platform/graphics/cairo/PlatformContextCairo.h:
+        * platform/graphics/cg/BitmapImageCG.cpp:
+        (WebCore::BitmapImage::draw):
+        * platform/graphics/cg/GraphicsContext3DCG.cpp:
+        (WebCore::GraphicsContext3D::paintToCanvas):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::fillRect):
+        (WebCore::GraphicsContext::platformFillRoundedRect):
+        (WebCore::GraphicsContext::fillRectWithRoundedHole):
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::ImageBuffer::ImageBuffer):
+        (WebCore::ImageBuffer::context):
+        (WebCore::ImageBuffer::flushContext):
+        (WebCore::ImageBuffer::copyNativeImage):
+        (WebCore::ImageBuffer::draw):
+        (WebCore::ImageBuffer::drawPattern):
+        (WebCore::ImageBuffer::clip):
+        (WebCore::ImageBuffer::getUnmultipliedImageData):
+        (WebCore::ImageBuffer::getPremultipliedImageData):
+        (WebCore::ImageBuffer::putByteArray):
+        (WebCore::ImageBuffer::toDataURL):
+        * platform/graphics/cg/ImageCG.cpp:
+        (WebCore::Image::drawPattern):
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        (WebCore::PDFDocumentImage::cacheParametersMatch):
+        (WebCore::transformContextForPainting):
+        (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
+        (WebCore::PDFDocumentImage::draw):
+        (WebCore::applyRotationForPainting):
+        (WebCore::PDFDocumentImage::drawPDFPage):
+        * platform/graphics/cg/PDFDocumentImage.h:
+        * platform/graphics/cocoa/FontCascadeCocoa.mm:
+        (WebCore::showLetterpressedGlyphsWithAdvances):
+        (WebCore::showGlyphsWithAdvances):
+        (WebCore::FontCascade::drawGlyphs):
+        (WebCore::FontCascade::drawComplexText):
+        (WebCore::FontCascade::drawEmphasisMarksForComplexText):
+        * platform/graphics/efl/ImageBufferEfl.cpp:
+        (WebCore::ImageBuffer::toDataURL):
+        * platform/graphics/filters/FEBlend.cpp:
+        (WebCore::FEBlend::platformApplySoftware):
+        * platform/graphics/filters/FEColorMatrix.cpp:
+        (WebCore::FEColorMatrix::platformApplySoftware):
+        * platform/graphics/filters/FEComposite.cpp:
+        (WebCore::FEComposite::platformApplySoftware):
+        * platform/graphics/filters/FEDropShadow.cpp:
+        (WebCore::FEDropShadow::platformApplySoftware):
+        * platform/graphics/filters/FEFlood.cpp:
+        (WebCore::FEFlood::platformApplySoftware):
+        * platform/graphics/filters/FEMerge.cpp:
+        (WebCore::FEMerge::platformApplySoftware):
+        * platform/graphics/filters/FEOffset.cpp:
+        (WebCore::FEOffset::platformApplySoftware):
+        * platform/graphics/filters/FETile.cpp:
+        (WebCore::FETile::platformApplySoftware):
+        * platform/graphics/filters/FilterEffect.cpp:
+        (WebCore::FilterEffect::createImageBufferResult): Deleted.
+        * platform/graphics/filters/SourceAlpha.cpp:
+        (WebCore::SourceAlpha::platformApplySoftware):
+        * platform/graphics/filters/SourceGraphic.cpp:
+        (WebCore::SourceGraphic::platformApplySoftware):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::paint):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
+        * platform/graphics/mac/GraphicsContextMac.mm:
+        (WebCore::GraphicsContext::drawLineForDocumentMarker):
+        * platform/graphics/mac/IconMac.mm:
+        (WebCore::Icon::paint):
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
+        (WebCore::MediaPlayerPrivateQTKit::paint):
+        * platform/graphics/mac/PDFDocumentImageMac.mm:
+        (WebCore::PDFDocumentImage::drawPDFPage):
+        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+        (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
+        * platform/graphics/texmap/BitmapTexture.cpp:
+        (WebCore::BitmapTexture::updateContents):
+        * platform/graphics/win/FontCGWin.cpp:
+        (WebCore::FontCascade::drawGlyphs):
+        * platform/graphics/win/FontWin.cpp:
+        (WebCore::FontCascade::drawComplexText):
+        (WebCore::FontCascade::drawEmphasisMarksForComplexText):
+        * platform/graphics/win/IconWin.cpp:
+        (WebCore::Icon::paint):
+        * platform/graphics/win/ImageCGWin.cpp:
+        (WebCore::BitmapImage::getHBITMAPOfSize):
+        (WebCore::BitmapImage::drawFrameMatchingSourceSize):
+        * platform/graphics/win/ImageCairoWin.cpp:
+        (WebCore::BitmapImage::getHBITMAPOfSize):
+        (WebCore::BitmapImage::drawFrameMatchingSourceSize):
+        * platform/graphics/win/LocalWindowsContext.h:
+        (WebCore::LocalWindowsContext::LocalWindowsContext):
+        (WebCore::LocalWindowsContext::~LocalWindowsContext):
+        * platform/gtk/WidgetGtk.cpp:
+        (WebCore::Widget::paint):
+        * platform/ios/WidgetIOS.mm:
+        (WebCore::Widget::paint):
+        * platform/mac/DragImageMac.mm:
+        (WebCore::drawAtPoint):
+        * platform/mac/LocalCurrentGraphicsContext.h:
+        (WebCore::ContextContainer::ContextContainer):
+        * platform/mac/LocalCurrentGraphicsContext.mm:
+        (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
+        (WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext):
+        (WebCore::LocalCurrentGraphicsContext::cgContext):
+        * platform/mac/ScrollbarThemeMac.mm:
+        (WebCore::ScrollbarThemeMac::paint):
+        * platform/mac/ThemeMac.h:
+        * platform/mac/ThemeMac.mm:
+        (WebCore::paintToggleButton):
+        (WebCore::paintButton):
+        (WebCore::paintStepper):
+        (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
+        (WebCore::ThemeMac::paint):
+        * platform/mac/WidgetMac.mm:
+        (WebCore::Widget::paint):
+        * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
+        (WebCore::MockMediaPlayerMediaSource::paint):
+        * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
+        * platform/win/PopupMenuWin.cpp:
+        (WebCore::PopupMenuWin::paint):
+        * platform/win/ScrollbarThemeWin.cpp:
+        (WebCore::ScrollbarThemeWin::paintTrackPiece):
+        (WebCore::ScrollbarThemeWin::paintButton):
+        (WebCore::ScrollbarThemeWin::paintThumb):
+        * platform/win/WebCoreTextRenderer.cpp:
+        (WebCore::doDrawTextAtPoint):
+        * platform/win/WidgetWin.cpp:
+        (WebCore::Widget::paint):
+        * rendering/EllipsisBox.cpp:
+        (WebCore::EllipsisBox::paint):
+        (WebCore::EllipsisBox::paintSelection):
+        * rendering/EllipsisBox.h:
+        * rendering/FilterEffectRenderer.cpp:
+        (WebCore::FilterEffectRenderer::inputContext):
+        (WebCore::FilterEffectRendererHelper::applyFilterEffect):
+        * rendering/FilterEffectRenderer.h:
+        * rendering/ImageQualityController.cpp:
+        (WebCore::ImageQualityController::shouldPaintAtLowQuality):
+        * rendering/ImageQualityController.h:
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::paintFillLayer):
+        (WebCore::InlineFlowBox::paintBoxDecorations):
+        (WebCore::InlineFlowBox::paintMask):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paint):
+        * rendering/PaintInfo.h:
+        (WebCore::PaintInfo::PaintInfo):
+        (WebCore::PaintInfo::context):
+        (WebCore::PaintInfo::setContext):
+        (WebCore::PaintInfo::applyTransform):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paint):
+        (WebCore::RenderBlock::paintCaret):
+        (WebCore::RenderBlock::paintObject):
+        (WebCore::RenderBlock::paintSelection):
+        (WebCore::clipOutPositionedObjects):
+        (WebCore::RenderBlock::blockSelectionGap):
+        (WebCore::RenderBlock::logicalLeftSelectionGap):
+        (WebCore::RenderBlock::logicalRightSelectionGap):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::paintColumnRules):
+        (WebCore::RenderBlockFlow::clipOutFloatingObjects):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::determineBackgroundBleedAvoidance):
+        (WebCore::RenderBox::paintBoxDecorations):
+        (WebCore::RenderBox::paintMask):
+        (WebCore::RenderBox::paintClippingMask):
+        (WebCore::RenderBox::paintMaskImages):
+        (WebCore::RenderBox::paintFillLayers):
+        (WebCore::RenderBox::pushContentsClip):
+        (WebCore::RenderBox::popContentsClip):
+        * rendering/RenderBox.h:
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::shouldPaintAtLowQuality):
+        (WebCore::RenderBoxModelObject::clipRoundedInnerRect):
+        (WebCore::applyBoxShadowForBackground):
+        (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+        (WebCore::RenderBoxModelObject::paintNinePieceImage):
+        (WebCore::RenderBoxModelObject::paintOneBorderSide):
+        (WebCore::RenderBoxModelObject::paintBorderSides):
+        (WebCore::RenderBoxModelObject::paintTranslucentBorderSides):
+        (WebCore::RenderBoxModelObject::paintBorder):
+        (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
+        (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
+        (WebCore::RenderBoxModelObject::clipBorderSideForComplexInnerPath):
+        (WebCore::RenderBoxModelObject::paintBoxShadow):
+        (WebCore::RenderBoxModelObject::shouldAntialiasLines):
+        * rendering/RenderBoxModelObject.h:
+        * rendering/RenderDetailsMarker.cpp:
+        (WebCore::RenderDetailsMarker::paint):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::paintFocusRing):
+        (WebCore::RenderElement::paintOutline):
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::paintSnapshotImage):
+        (WebCore::drawReplacementArrow):
+        (WebCore::RenderEmbeddedObject::paintReplaced):
+        * rendering/RenderFieldset.cpp:
+        (WebCore::RenderFieldset::paintBoxDecorations):
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::RenderFileUploadControl::paintObject):
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::paintColumnBorder):
+        (WebCore::RenderFrameSet::paintRowBorder):
+        * rendering/RenderHTMLCanvas.cpp:
+        (WebCore::RenderHTMLCanvas::paintReplaced):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::paintReplaced):
+        (WebCore::RenderImage::paintAreaElementFocusRing):
+        (WebCore::RenderImage::paintIntoRect):
+        * rendering/RenderImage.h:
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::paintOutline):
+        (WebCore::RenderInline::paintOutlineForLine):
+        * rendering/RenderInline.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::beginTransparencyLayers):
+        (WebCore::RenderLayer::paintOverflowControls):
+        (WebCore::RenderLayer::paintScrollCorner):
+        (WebCore::RenderLayer::drawPlatformResizerImage):
+        (WebCore::RenderLayer::paintResizer):
+        (WebCore::RenderLayer::paint):
+        (WebCore::RenderLayer::paintOverlayScrollbars):
+        (WebCore::RenderLayer::clipToRect):
+        (WebCore::RenderLayer::restoreClip):
+        (WebCore::RenderLayer::paintLayer):
+        (WebCore::RenderLayer::paintLayerContentsAndReflection):
+        (WebCore::RenderLayer::setupFontSubpixelQuantization):
+        (WebCore::RenderLayer::setupClipPath):
+        (WebCore::RenderLayer::hasFilterThatIsPainting):
+        (WebCore::RenderLayer::setupFilters):
+        (WebCore::RenderLayer::applyFilters):
+        (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
+        (WebCore::RenderLayer::paintLayerContents):
+        (WebCore::RenderLayer::paintLayerByApplyingTransform):
+        (WebCore::RenderLayer::paintList):
+        (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
+        (WebCore::RenderLayer::paintBackgroundForFragments):
+        (WebCore::RenderLayer::paintForegroundForFragments):
+        (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
+        (WebCore::RenderLayer::paintOutlineForFragments):
+        (WebCore::RenderLayer::paintMaskForFragments):
+        (WebCore::RenderLayer::paintChildClippingMaskForFragments):
+        (WebCore::RenderLayer::paintOverflowControlsForFragments):
+        (WebCore::RenderLayer::calculateClipRects):
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::paintIntoLayer):
+        (WebCore::RenderLayerBacking::paintContents):
+        * rendering/RenderLayerBacking.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::paintScrollbar):
+        (WebCore::RenderLayerCompositor::paintContents):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::paintScrollbar):
+        (WebCore::RenderListBox::paintItemForeground):
+        (WebCore::RenderListBox::paintItemBackground):
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::paint):
+        * rendering/RenderMediaControls.cpp:
+        (WebCore::getUnzoomedRectAndAdjustCurrentContext):
+        (WebCore::RenderMediaControls::paintMediaControlsPart):
+        * rendering/RenderMultiColumnSet.cpp:
+        (WebCore::RenderMultiColumnSet::paintColumnRules):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::addPDFURLRect):
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::paint):
+        * rendering/RenderReplica.cpp:
+        (WebCore::RenderReplica::paint):
+        * rendering/RenderScrollbar.cpp:
+        (WebCore::RenderScrollbar::paint):
+        (WebCore::RenderScrollbar::paintPart):
+        * rendering/RenderScrollbar.h:
+        * rendering/RenderScrollbarPart.cpp:
+        (WebCore::RenderScrollbarPart::paintIntoRect):
+        * rendering/RenderScrollbarPart.h:
+        * rendering/RenderScrollbarTheme.cpp:
+        (WebCore::RenderScrollbarTheme::paintScrollCorner):
+        (WebCore::RenderScrollbarTheme::paintScrollbarBackground):
+        (WebCore::RenderScrollbarTheme::paintTrackBackground):
+        (WebCore::RenderScrollbarTheme::paintTrackPiece):
+        (WebCore::RenderScrollbarTheme::paintButton):
+        (WebCore::RenderScrollbarTheme::paintThumb):
+        * rendering/RenderScrollbarTheme.h:
+        * rendering/RenderSnapshottedPlugIn.cpp:
+        (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::paintBoxDecorations):
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::paintCollapsedBorders):
+        (WebCore::RenderTableCell::paintBackgroundsBehindCell):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::paintRowGroupBorder):
+        (WebCore::RenderTableSection::paintRowGroupBorderIfRequired):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::paint):
+        (WebCore::RenderTheme::paintBorderOnly):
+        (WebCore::RenderTheme::paintDecorations):
+        (WebCore::RenderTheme::paintSliderTicks):
+        * rendering/RenderThemeEfl.cpp:
+        (WebCore::RenderThemeEfl::paintThemePart):
+        * rendering/RenderThemeGtk.cpp:
+        (WebCore::paintToggle):
+        (WebCore::renderButton):
+        (WebCore::RenderThemeGtk::paintMenuList):
+        (WebCore::RenderThemeGtk::paintTextField):
+        (WebCore::paintGdkPixbuf):
+        (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
+        (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
+        (WebCore::RenderThemeGtk::paintCapsLockIndicator):
+        (WebCore::RenderThemeGtk::paintSliderTrack):
+        (WebCore::RenderThemeGtk::paintSliderThumb):
+        (WebCore::RenderThemeGtk::paintProgressBar):
+        (WebCore::paintSpinArrowButton):
+        (WebCore::RenderThemeGtk::paintMediaButton):
+        (WebCore::RenderThemeGtk::paintMediaFullscreenButton):
+        (WebCore::RenderThemeGtk::paintMediaMuteButton):
+        (WebCore::RenderThemeGtk::paintMediaPlayButton):
+        (WebCore::RenderThemeGtk::paintMediaSeekBackButton):
+        (WebCore::RenderThemeGtk::paintMediaSeekForwardButton):
+        (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
+        (WebCore::RenderThemeGtk::paintMediaSliderTrack):
+        (WebCore::RenderThemeGtk::paintMediaSliderThumb):
+        (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
+        * rendering/RenderThemeGtk.h:
+        * rendering/RenderThemeIOS.h:
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::RenderThemeIOS::addRoundedBorderClip):
+        (WebCore::RenderThemeIOS::paintCheckboxDecorations):
+        (WebCore::RenderThemeIOS::paintRadioDecorations):
+        (WebCore::RenderThemeIOS::paintTextFieldDecorations):
+        (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
+        (WebCore::RenderThemeIOS::paintSliderTrack):
+        (WebCore::RenderThemeIOS::paintSliderThumbDecorations):
+        (WebCore::RenderThemeIOS::paintProgressBar):
+        (WebCore::RenderThemeIOS::paintPushButtonDecorations):
+        (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintTextField):
+        (WebCore::RenderThemeMac::paintTextArea):
+        (WebCore::RenderThemeMac::paintMenuList):
+        (WebCore::RenderThemeMac::paintMeter):
+        (WebCore::RenderThemeMac::paintProgressBar):
+        (WebCore::RenderThemeMac::paintMenuListButtonGradients):
+        (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
+        (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
+        (WebCore::RenderThemeMac::paintSliderTrack):
+        (WebCore::RenderThemeMac::paintSliderThumb):
+        (WebCore::RenderThemeMac::paintSearchField):
+        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
+        (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
+        (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
+        (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
+        (WebCore::RenderThemeMac::paintImageControlsButton):
+        (WebCore::RenderThemeMac::paintAttachment):
+        * rendering/RenderThemeSafari.cpp:
+        (WebCore::RenderThemeSafari::paintCheckbox):
+        (WebCore::RenderThemeSafari::paintRadio):
+        (WebCore::RenderThemeSafari::paintButton):
+        (WebCore::RenderThemeSafari::paintTextField):
+        (WebCore::RenderThemeSafari::paintCapsLockIndicator):
+        (WebCore::RenderThemeSafari::paintTextArea):
+        (WebCore::RenderThemeSafari::paintMenuList):
+        (WebCore::RenderThemeSafari::paintMenuListButtonGradients):
+        (WebCore::RenderThemeSafari::paintMenuListButtonDecorations):
+        (WebCore::RenderThemeSafari::paintSliderTrack):
+        (WebCore::RenderThemeSafari::paintSliderThumb):
+        (WebCore::RenderThemeSafari::paintSearchField):
+        (WebCore::RenderThemeSafari::paintSearchFieldCancelButton):
+        (WebCore::RenderThemeSafari::paintSearchFieldResultsDecorationPart):
+        (WebCore::RenderThemeSafari::paintSearchFieldResultsButton):
+        * rendering/RenderThemeWin.cpp:
+        (WebCore::drawControl):
+        (WebCore::RenderThemeWin::paintButton):
+        (WebCore::RenderThemeWin::paintInnerSpinButton):
+        (WebCore::RenderThemeWin::paintTextField):
+        (WebCore::RenderThemeWin::paintMenuList):
+        (WebCore::RenderThemeWin::paintMenuListButtonDecorations):
+        (WebCore::RenderThemeWin::paintSliderTrack):
+        (WebCore::RenderThemeWin::paintSliderThumb):
+        (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
+        (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
+        (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
+        (WebCore::RenderThemeWin::paintMeter):
+        * rendering/RenderVideo.cpp:
+        (WebCore::RenderVideo::paintReplaced):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::paint):
+        (WebCore::RenderView::paintBoxDecorations):
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::paintContents):
+        (WebCore::RenderWidget::paint):
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::lineSelectionGap):
+        * rendering/SimpleLineLayoutFunctions.cpp:
+        (WebCore::SimpleLineLayout::paintFlow):
+        * rendering/mathml/RenderMathMLBlock.cpp:
+        (WebCore::RenderMathMLBlock::paint):
+        * rendering/mathml/RenderMathMLFraction.cpp:
+        (WebCore::RenderMathMLFraction::paint):
+        * rendering/mathml/RenderMathMLMenclose.cpp:
+        (WebCore::RenderMathMLMenclose::paint):
+        * rendering/mathml/RenderMathMLOperator.cpp:
+        (WebCore::RenderMathMLOperator::paintGlyph):
+        (WebCore::RenderMathMLOperator::fillWithVerticalExtensionGlyph):
+        (WebCore::RenderMathMLOperator::fillWithHorizontalExtensionGlyph):
+        (WebCore::RenderMathMLOperator::paint):
+        * rendering/mathml/RenderMathMLRadicalOperator.cpp:
+        (WebCore::RenderMathMLRadicalOperator::paint):
+        * rendering/mathml/RenderMathMLRoot.cpp:
+        (WebCore::RenderMathMLRoot::paint):
+        * rendering/shapes/Shape.cpp:
+        (WebCore::Shape::createRasterShape):
+        * rendering/style/NinePieceImage.cpp:
+        (WebCore::NinePieceImage::paint):
+        * rendering/style/NinePieceImage.h:
+        * rendering/svg/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::paint):
+        * rendering/svg/RenderSVGEllipse.cpp:
+        (WebCore::RenderSVGEllipse::fillShape):
+        (WebCore::RenderSVGEllipse::strokeShape):
+        * rendering/svg/RenderSVGEllipse.h:
+        * rendering/svg/RenderSVGForeignObject.cpp:
+        (WebCore::RenderSVGForeignObject::paint):
+        * rendering/svg/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::paint):
+        (WebCore::RenderSVGImage::paintForeground):
+        * rendering/svg/RenderSVGPath.cpp:
+        (WebCore::useStrokeStyleToFill):
+        (WebCore::RenderSVGPath::strokeShape):
+        * rendering/svg/RenderSVGPath.h:
+        * rendering/svg/RenderSVGRect.cpp:
+        (WebCore::RenderSVGRect::fillShape):
+        (WebCore::RenderSVGRect::strokeShape):
+        * rendering/svg/RenderSVGRect.h:
+        * rendering/svg/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::applyResource):
+        (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
+        (WebCore::RenderSVGResourceClipper::applyClippingToContext):
+        (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
+        * rendering/svg/RenderSVGResourceClipper.h:
+        * rendering/svg/RenderSVGResourceFilter.cpp:
+        (WebCore::RenderSVGResourceFilter::applyResource):
+        * rendering/svg/RenderSVGResourceGradient.cpp:
+        (WebCore::createMaskAndSwapContextForTextGradient):
+        (WebCore::clipToTextMask):
+        (WebCore::RenderSVGResourceGradient::applyResource):
+        * rendering/svg/RenderSVGResourceMarker.cpp:
+        (WebCore::RenderSVGResourceMarker::applyViewportClip):
+        (WebCore::RenderSVGResourceMarker::draw):
+        * rendering/svg/RenderSVGResourceMasker.cpp:
+        (WebCore::RenderSVGResourceMasker::applyResource):
+        (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
+        * rendering/svg/RenderSVGResourcePattern.cpp:
+        (WebCore::RenderSVGResourcePattern::postApplyResource):
+        (WebCore::RenderSVGResourcePattern::createTileImage):
+        * rendering/svg/RenderSVGResourceSolidColor.cpp:
+        (WebCore::RenderSVGResourceSolidColor::postApplyResource):
+        * rendering/svg/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::paintReplaced):
+        * rendering/svg/RenderSVGShape.cpp:
+        (WebCore::RenderSVGShape::fillShape):
+        (WebCore::RenderSVGShape::strokeShape):
+        (WebCore::RenderSVGShape::fillStrokeMarkers):
+        (WebCore::RenderSVGShape::paint):
+        * rendering/svg/RenderSVGShape.h:
+        * rendering/svg/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::paint):
+        * rendering/svg/RenderSVGViewportContainer.cpp:
+        (WebCore::RenderSVGViewportContainer::applyViewportClip):
+        * rendering/svg/SVGInlineFlowBox.cpp:
+        (WebCore::SVGInlineFlowBox::paintSelectionBackground):
+        (WebCore::SVGInlineFlowBox::paint):
+        * rendering/svg/SVGInlineTextBox.cpp:
+        (WebCore::SVGInlineTextBox::paintSelectionBackground):
+        (WebCore::SVGInlineTextBox::paint):
+        (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
+        (WebCore::SVGInlineTextBox::paintDecoration):
+        (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
+        (WebCore::SVGInlineTextBox::paintTextWithShadows):
+        (WebCore::SVGInlineTextBox::paintText):
+        * rendering/svg/SVGInlineTextBox.h:
+        * rendering/svg/SVGRenderingContext.cpp:
+        (WebCore::SVGRenderingContext::~SVGRenderingContext):
+        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
+        (WebCore::SVGRenderingContext::createImageBuffer):
+        (WebCore::SVGRenderingContext::clipToImageBuffer):
+        (WebCore::SVGRenderingContext::bufferForeground):
+        (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Deleted.
+        * rendering/svg/SVGRenderingContext.h:
+        * rendering/svg/SVGRootInlineBox.cpp:
+        (WebCore::SVGRootInlineBox::paint):
+        * rendering/svg/SVGTextRunRenderingContext.cpp:
+        (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
+        * rendering/svg/SVGTextRunRenderingContext.h:
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::drawForContainer):
+        (WebCore::SVGImage::drawPatternForContainer):
+        (WebCore::SVGImage::draw):
+        * svg/graphics/SVGImage.h:
+        * svg/graphics/SVGImageForContainer.cpp:
+        (WebCore::SVGImageForContainer::draw):
+        (WebCore::SVGImageForContainer::drawPattern):
+        * svg/graphics/SVGImageForContainer.h:
+        * svg/graphics/filters/SVGFEImage.cpp:
+        (WebCore::FEImage::platformApplySoftware):
+
 2015-08-28  Alexey Proskuryakov  <ap@apple.com>
 
         Update bindings test results after
index 1733a37..90f55d4 100644 (file)
@@ -124,7 +124,7 @@ RefPtr<Image> CSSFilterImageValue::image(RenderElement* renderer, const FloatSiz
     if (!texture)
         return Image::nullImage();
     FloatRect imageRect = FloatRect(FloatPoint(), size);
-    texture->context()->drawImage(image, ColorSpaceDeviceRGB, imageRect);
+    texture->context().drawImage(image, ColorSpaceDeviceRGB, imageRect);
 
     RefPtr<FilterEffectRenderer> filterRenderer = FilterEffectRenderer::create();
     filterRenderer->setSourceImage(WTF::move(texture));
index 19c4fa9..277d429 100644 (file)
@@ -3248,7 +3248,7 @@ unsigned Editor::countMatchesForText(const String& target, Range* range, FindOpt
 
                 PaintBehavior oldBehavior = m_frame.view()->paintBehavior();
                 m_frame.view()->setPaintBehavior(oldBehavior | PaintBehaviorFlattenCompositingLayers);
-                m_frame.view()->paintContents(&context, enclosingIntRect(visibleRect));
+                m_frame.view()->paintContents(context, enclosingIntRect(visibleRect));
                 m_frame.view()->setPaintBehavior(oldBehavior);
             }
         }
index e8d368e..cc13c4a 100644 (file)
@@ -1542,7 +1542,7 @@ void CaretBase::invalidateCaretRect(Node* node, bool caretRectChanged)
     }
 }
 
-void FrameSelection::paintCaret(GraphicsContext* context, const LayoutPoint& paintOffset, const LayoutRect& clipRect)
+void FrameSelection::paintCaret(GraphicsContext& context, const LayoutPoint& paintOffset, const LayoutRect& clipRect)
 {
     if (m_selection.isCaret() && m_caretPaint)
         CaretBase::paintCaret(m_selection.start().deprecatedNode(), context, paintOffset, clipRect);
@@ -1555,7 +1555,7 @@ static inline bool disappearsIntoBackground(Color foreground, Color background)
 }
 #endif
 
-void CaretBase::paintCaret(Node* node, GraphicsContext* context, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const
+void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const
 {
 #if ENABLE(TEXT_CARET)
     if (m_caretVisibility == Hidden)
@@ -1593,7 +1593,7 @@ void CaretBase::paintCaret(Node* node, GraphicsContext* context, const LayoutPoi
         }
     }
 
-    context->fillRect(caret, caretColor, colorSpace);
+    context.fillRect(caret, caretColor, colorSpace);
 #else
     UNUSED_PARAM(node);
     UNUSED_PARAM(context);
@@ -2031,7 +2031,7 @@ void FrameSelection::setFocusedElementIfNeeded()
         m_frame->page()->focusController().setFocusedElement(0, m_frame);
 }
 
-void DragCaretController::paintDragCaret(Frame* frame, GraphicsContext* p, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const
+void DragCaretController::paintDragCaret(Frame* frame, GraphicsContext& p, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const
 {
 #if ENABLE(TEXT_CARET)
     if (m_position.deepEquivalent().deprecatedNode()->document().frame() == frame)
index df777c9..9ca2970 100644 (file)
@@ -71,7 +71,7 @@ protected:
     void clearCaretRect();
     bool updateCaretRect(Document*, const VisiblePosition& caretPosition);
     bool shouldRepaintCaret(const RenderView*, bool isContentEditable) const;
-    void paintCaret(Node*, GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect) const;
+    void paintCaret(Node*, GraphicsContext&, const LayoutPoint&, const LayoutRect& clipRect) const;
 
     const LayoutRect& localCaretRectWithoutUpdate() const { return m_caretLocalRect; }
 
@@ -95,7 +95,7 @@ public:
     DragCaretController();
 
     RenderBlock* caretRenderer() const;
-    void paintDragCaret(Frame*, GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect) const;
+    void paintDragCaret(Frame*, GraphicsContext&, const LayoutPoint&, const LayoutRect& clipRect) const;
 
     bool isContentEditable() const { return m_position.rootEditableElement(); }
     bool isContentRichlyEditable() const;
@@ -193,7 +193,7 @@ public:
     void textWasReplaced(CharacterData*, unsigned offset, unsigned oldLength, unsigned newLength);
 
     void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisible ? Visible : Hidden); }
-    void paintCaret(GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect);
+    void paintCaret(GraphicsContext&, const LayoutPoint&, const LayoutRect& clipRect);
 
     // Used to suspend caret blinking while the mouse is down.
     void setCaretBlinkingSuspended(bool suspended) { m_isCaretBlinkingSuspended = suspended; }
index ce5d7b2..bbff762 100644 (file)
@@ -366,12 +366,12 @@ bool HTMLCanvasElement::paintsIntoCanvasBuffer() const
 }
 
 
-void HTMLCanvasElement::paint(GraphicsContext* context, const LayoutRect& r, bool useLowQualityScale)
+void HTMLCanvasElement::paint(GraphicsContext& context, const LayoutRect& r, bool useLowQualityScale)
 {
     // Clear the dirty rect
     m_dirtyRect = FloatRect();
 
-    if (context->paintingDisabled())
+    if (context.paintingDisabled())
         return;
     
     if (m_context) {
@@ -388,9 +388,9 @@ void HTMLCanvasElement::paint(GraphicsContext* context, const LayoutRect& r, boo
 #if ENABLE(CSS_IMAGE_ORIENTATION)
                 orientationDescription.setImageOrientationEnum(renderer()->style().imageOrientation());
 #endif 
-                context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB, snappedIntRect(r), ImagePaintingOptions(orientationDescription, useLowQualityScale));
+                context.drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB, snappedIntRect(r), ImagePaintingOptions(orientationDescription, useLowQualityScale));
             } else
-                context->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, snappedIntRect(r), useLowQualityScale);
+                context.drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, snappedIntRect(r), useLowQualityScale);
         }
     }
 
@@ -580,12 +580,12 @@ void HTMLCanvasElement::createImageBuffer() const
     m_imageBuffer = ImageBuffer::create(size(), 1, ColorSpaceDeviceRGB, renderingMode);
     if (!m_imageBuffer)
         return;
-    m_imageBuffer->context()->setShadowsIgnoreTransforms(true);
-    m_imageBuffer->context()->setImageInterpolationQuality(DefaultInterpolationQuality);
+    m_imageBuffer->context().setShadowsIgnoreTransforms(true);
+    m_imageBuffer->context().setImageInterpolationQuality(DefaultInterpolationQuality);
     if (document().settings() && !document().settings()->antialiased2dCanvasEnabled())
-        m_imageBuffer->context()->setShouldAntialias(false);
-    m_imageBuffer->context()->setStrokeThickness(1);
-    m_contextStateSaver = std::make_unique<GraphicsContextStateSaver>(*m_imageBuffer->context());
+        m_imageBuffer->context().setShouldAntialias(false);
+    m_imageBuffer->context().setStrokeThickness(1);
+    m_contextStateSaver = std::make_unique<GraphicsContextStateSaver>(m_imageBuffer->context());
 
     JSC::JSLockHolder lock(scriptExecutionContext()->vm());
     scriptExecutionContext()->vm().heap.reportExtraMemoryAllocated(memoryCost());
@@ -599,7 +599,7 @@ void HTMLCanvasElement::createImageBuffer() const
 
 GraphicsContext* HTMLCanvasElement::drawingContext() const
 {
-    return buffer() ? m_imageBuffer->context() : nullptr;
+    return buffer() ? &m_imageBuffer->context() : nullptr;
 }
 
 GraphicsContext* HTMLCanvasElement::existingDrawingContext() const
index 8ef0eee..edc1911 100644 (file)
@@ -105,7 +105,7 @@ public:
     void didDraw(const FloatRect&);
     void notifyObserversCanvasChanged(const FloatRect&);
 
-    void paint(GraphicsContext*, const LayoutRect&, bool useLowQualityScale = false);
+    void paint(GraphicsContext&, const LayoutRect&, bool useLowQualityScale = false);
 
     GraphicsContext* drawingContext() const;
     GraphicsContext* existingDrawingContext() const;
index c4ece4e..bd30675 100644 (file)
@@ -234,7 +234,7 @@ void HTMLVideoElement::updateDisplayState()
         setDisplayMode(Poster);
 }
 
-void HTMLVideoElement::paintCurrentFrameInContext(GraphicsContext* context, const FloatRect& destRect)
+void HTMLVideoElement::paintCurrentFrameInContext(GraphicsContext& context, const FloatRect& destRect)
 {
     MediaPlayer* player = HTMLMediaElement::player();
     if (!player)
index aea6ba8..334a6a0 100644 (file)
@@ -65,7 +65,7 @@ public:
 #endif
 
     // Used by canvas to gain raw pixel access
-    void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&);
+    void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&);
 
     PassNativeImagePtr nativeImageForCurrentTime();
 
index 767c62c..53c9e44 100644 (file)
@@ -1554,7 +1554,7 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec
     c->translate(dstRect.x(), dstRect.y());
     c->scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()));
     c->translate(-srcRect.x(), -srcRect.y());
-    video->paintCurrentFrameInContext(c, FloatRect(FloatPoint(), size(video)));
+    video->paintCurrentFrameInContext(*c, FloatRect(FloatPoint(), size(video)));
     stateSaver.restore();
     didDraw(dstRect);
 }
@@ -1658,14 +1658,14 @@ void CanvasRenderingContext2D::compositeBuffer(ImageBuffer* buffer, const IntRec
     c->restore();
 }
 
-static void drawImageToContext(Image* image, GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
+static void drawImageToContext(Image* image, GraphicsContext& context, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
 {
-    context->drawImage(image, styleColorSpace, dest, src, op);
+    context.drawImage(image, styleColorSpace, dest, src, op);
 }
 
-static void drawImageToContext(ImageBuffer* imageBuffer, GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
+static void drawImageToContext(ImageBuffer* imageBuffer, GraphicsContext& context, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
 {
-    context->drawImageBuffer(imageBuffer, styleColorSpace, dest, src, op);
+    context.drawImageBuffer(imageBuffer, styleColorSpace, dest, src, op);
 }
 
 template<class T> void  CanvasRenderingContext2D::fullCanvasCompositedDrawImage(T* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
@@ -1691,9 +1691,9 @@ template<class T> void  CanvasRenderingContext2D::fullCanvasCompositedDrawImage(
     adjustedDest.setLocation(FloatPoint(0, 0));
     AffineTransform effectiveTransform = c->getCTM();
     IntRect transformedAdjustedRect = enclosingIntRect(effectiveTransform.mapRect(adjustedDest));
-    buffer->context()->translate(-transformedAdjustedRect.location().x(), -transformedAdjustedRect.location().y());
-    buffer->context()->translate(croppedOffset.width(), croppedOffset.height());
-    buffer->context()->concatCTM(effectiveTransform);
+    buffer->context().translate(-transformedAdjustedRect.location().x(), -transformedAdjustedRect.location().y());
+    buffer->context().translate(croppedOffset.width(), croppedOffset.height());
+    buffer->context().concatCTM(effectiveTransform);
     drawImageToContext(image, buffer->context(), styleColorSpace, adjustedDest, src, CompositeSourceOver);
 
     compositeBuffer(buffer.get(), bufferRect, op);
@@ -2393,25 +2393,25 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
 
         std::unique_ptr<ImageBuffer> maskImage = c->createCompatibleBuffer(maskRect.size());
 
-        GraphicsContext* maskImageContext = maskImage->context();
+        GraphicsContext& maskImageContext = maskImage->context();
 
         if (fill)
-            maskImageContext->setFillColor(Color::black, ColorSpaceDeviceRGB);
+            maskImageContext.setFillColor(Color::black, ColorSpaceDeviceRGB);
         else {
-            maskImageContext->setStrokeColor(Color::black, ColorSpaceDeviceRGB);
-            maskImageContext->setStrokeThickness(c->strokeThickness());
+            maskImageContext.setStrokeColor(Color::black, ColorSpaceDeviceRGB);
+            maskImageContext.setStrokeThickness(c->strokeThickness());
         }
 
-        maskImageContext->setTextDrawingMode(fill ? TextModeFill : TextModeStroke);
+        maskImageContext.setTextDrawingMode(fill ? TextModeFill : TextModeStroke);
 
         if (useMaxWidth) {
-            maskImageContext->translate(location.x() - maskRect.x(), location.y() - maskRect.y());
+            maskImageContext.translate(location.x() - maskRect.x(), location.y() - maskRect.y());
             // We draw when fontWidth is 0 so compositing operations (eg, a "copy" op) still work.
-            maskImageContext->scale(FloatSize((fontWidth > 0 ? (width / fontWidth) : 0), 1));
-            maskImageContext->drawBidiText(font, textRun, FloatPoint(0, 0), FontCascade::UseFallbackIfFontNotReady);
+            maskImageContext.scale(FloatSize((fontWidth > 0 ? (width / fontWidth) : 0), 1));
+            maskImageContext.drawBidiText(font, textRun, FloatPoint(0, 0), FontCascade::UseFallbackIfFontNotReady);
         } else {
-            maskImageContext->translate(-maskRect.x(), -maskRect.y());
-            maskImageContext->drawBidiText(font, textRun, location, FontCascade::UseFallbackIfFontNotReady);
+            maskImageContext.translate(-maskRect.x(), -maskRect.y());
+            maskImageContext.drawBidiText(font, textRun, location, FontCascade::UseFallbackIfFontNotReady);
         }
 
         GraphicsContextStateSaver stateSaver(*c);
index 40539d6..5e61436 100644 (file)
@@ -3185,7 +3185,7 @@ PassRefPtr<Image> WebGLRenderingContextBase::drawImageIntoBuffer(Image* image, i
 
     FloatRect srcRect(FloatPoint(), image->size());
     FloatRect destRect(FloatPoint(), size);
-    buf->context()->drawImage(image, ColorSpaceDeviceRGB, destRect, srcRect);
+    buf->context().drawImage(image, ColorSpaceDeviceRGB, destRect, srcRect);
     return buf->copyImage(ImageBuffer::fastCopyImageMode());
 }
 
index 4193de9..27abcc0 100644 (file)
@@ -221,7 +221,7 @@ void InspectorOverlay::paint(GraphicsContext& context)
     GraphicsContextStateSaver stateSaver(context);
     FrameView* view = overlayPage()->mainFrame().view();
     view->updateLayoutAndStyleIfNeededRecursive();
-    view->paint(&context, IntRect(0, 0, view->width(), view->height()));
+    view->paint(context, IntRect(0, 0, view->width(), view->height()));
 }
 
 void InspectorOverlay::getHighlight(Highlight& highlight, InspectorOverlay::CoordinateSystem coordinateSystem) const
index 6bfce12..d85147d 100644 (file)
@@ -102,7 +102,7 @@ std::unique_ptr<ImageBuffer> snapshotFrameRect(Frame& frame, const IntRect& imag
     std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(imageRect.size(), scaleFactor, ColorSpaceDeviceRGB);
     if (!buffer)
         return nullptr;
-    buffer->context()->translate(-imageRect.x(), -imageRect.y());
+    buffer->context().translate(-imageRect.x(), -imageRect.y());
 
     frame.view()->paintContentsForSnapshot(buffer->context(), imageRect, shouldIncludeSelection, coordinateSpace);
     return buffer;
index 7d7353f..49fb729 100644 (file)
@@ -3717,16 +3717,16 @@ void FrameView::updateScrollCorner()
     ScrollView::updateScrollCorner();
 }
 
-void FrameView::paintScrollCorner(GraphicsContext* context, const IntRect& cornerRect)
+void FrameView::paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect)
 {
-    if (context->updatingControlTints()) {
+    if (context.updatingControlTints()) {
         updateScrollCorner();
         return;
     }
 
     if (m_scrollCorner) {
         if (frame().isMainFrame())
-            context->fillRect(cornerRect, baseBackgroundColor(), ColorSpaceDeviceRGB);
+            context.fillRect(cornerRect, baseBackgroundColor(), ColorSpaceDeviceRGB);
         m_scrollCorner->paintIntoRect(context, cornerRect.location(), cornerRect);
         return;
     }
@@ -3734,12 +3734,12 @@ void FrameView::paintScrollCorner(GraphicsContext* context, const IntRect& corne
     ScrollView::paintScrollCorner(context, cornerRect);
 }
 
-void FrameView::paintScrollbar(GraphicsContext* context, Scrollbar* bar, const IntRect& rect)
+void FrameView::paintScrollbar(GraphicsContext& context, Scrollbar& bar, const IntRect& rect)
 {
-    if (bar->isCustomScrollbar() && frame().isMainFrame()) {
-        IntRect toFill = bar->frameRect();
+    if (bar.isCustomScrollbar() && frame().isMainFrame()) {
+        IntRect toFill = bar.frameRect();
         toFill.intersect(rect);
-        context->fillRect(toFill, baseBackgroundColor(), ColorSpaceDeviceRGB);
+        context.fillRect(toFill, baseBackgroundColor(), ColorSpaceDeviceRGB);
     }
 
     ScrollView::paintScrollbar(context, bar, rect);
@@ -3897,9 +3897,9 @@ void FrameView::paintControlTints()
     context.setUpdatingControlTints(true);
     if (platformWidget()) {
         // FIXME: consult paintsEntireContents().
-        paintContents(&context, visibleContentRect(LegacyIOSDocumentVisibleRect));
+        paintContents(context, visibleContentRect(LegacyIOSDocumentVisibleRect));
     } else
-        paint(&context, frameRect());
+        paint(context, frameRect());
 }
 
 bool FrameView::wasScrolledByUser() const
@@ -3920,11 +3920,11 @@ void FrameView::setWasScrolledByUser(bool wasScrolledByUser)
     adjustTiledBackingCoverage();
 }
 
-void FrameView::willPaintContents(GraphicsContext* context, const IntRect& dirtyRect, PaintingState& paintingState)
+void FrameView::willPaintContents(GraphicsContext& context, const IntRect& dirtyRect, PaintingState& paintingState)
 {
     Document* document = frame().document();
 
-    if (!context->paintingDisabled())
+    if (!context.paintingDisabled())
         InspectorInstrumentation::willPaint(renderView());
 
     paintingState.isTopLevelPainter = !sCurrentPaintTimeStamp;
@@ -3961,7 +3961,7 @@ void FrameView::willPaintContents(GraphicsContext* context, const IntRect& dirty
     m_isPainting = true;
 }
 
-void FrameView::didPaintContents(GraphicsContext* context, const IntRect& dirtyRect, PaintingState& paintingState)
+void FrameView::didPaintContents(GraphicsContext& context, const IntRect& dirtyRect, PaintingState& paintingState)
 {
     m_isPainting = false;
 
@@ -3985,14 +3985,14 @@ void FrameView::didPaintContents(GraphicsContext* context, const IntRect& dirtyR
     if (paintingState.isTopLevelPainter)
         sCurrentPaintTimeStamp = 0;
 
-    if (!context->paintingDisabled()) {
+    if (!context.paintingDisabled()) {
         InspectorInstrumentation::didPaint(renderView(), dirtyRect);
         // FIXME: should probably not fire milestones for snapshot painting. https://bugs.webkit.org/show_bug.cgi?id=117623
         firePaintRelatedMilestonesIfNeeded();
     }
 }
 
-void FrameView::paintContents(GraphicsContext* context, const IntRect& dirtyRect)
+void FrameView::paintContents(GraphicsContext& context, const IntRect& dirtyRect)
 {
 #ifndef NDEBUG
     bool fillWithRed;
@@ -4010,7 +4010,7 @@ void FrameView::paintContents(GraphicsContext* context, const IntRect& dirtyRect
         fillWithRed = true;
     
     if (fillWithRed)
-        context->fillRect(dirtyRect, Color(0xFF, 0, 0), ColorSpaceDeviceRGB);
+        context.fillRect(dirtyRect, Color(0xFF, 0, 0), ColorSpaceDeviceRGB);
 #endif
 
     if (m_layoutPhase == InViewSizeAdjust)
@@ -4072,7 +4072,7 @@ void FrameView::setNodeToDraw(Node* node)
     m_nodeToDraw = node;
 }
 
-void FrameView::paintContentsForSnapshot(GraphicsContext* context, const IntRect& imageRect, SelectionInSnapshot shouldPaintSelection, CoordinateSpaceForSnapshot coordinateSpace)
+void FrameView::paintContentsForSnapshot(GraphicsContext& context, const IntRect& imageRect, SelectionInSnapshot shouldPaintSelection, CoordinateSpaceForSnapshot coordinateSpace)
 {
     updateLayoutAndStyleIfNeededRecursive();
 
@@ -4108,9 +4108,9 @@ void FrameView::paintContentsForSnapshot(GraphicsContext* context, const IntRect
     setPaintBehavior(oldBehavior);
 }
 
-void FrameView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect)
+void FrameView::paintOverhangAreas(GraphicsContext& context, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect)
 {
-    if (context->paintingDisabled())
+    if (context.paintingDisabled())
         return;
 
     if (frame().document()->printing())
@@ -4301,7 +4301,7 @@ void FrameView::adjustPageHeightDeprecated(float *newBottom, float oldTop, float
     renderView->setTruncatedAt(static_cast<int>(floorf(oldBottom)));
     IntRect dirtyRect(0, static_cast<int>(floorf(oldTop)), renderView->layoutOverflowRect().maxX(), static_cast<int>(ceilf(oldBottom - oldTop)));
     renderView->setPrintRect(dirtyRect);
-    renderView->layer()->paint(&context, dirtyRect);
+    renderView->layer()->paint(context, dirtyRect);
     *newBottom = renderView->bestTruncatedAt();
     if (!*newBottom)
         *newBottom = oldBottom;
index 43801c8..ce896ba 100644 (file)
@@ -323,7 +323,7 @@ public:
     void addEmbeddedObjectToUpdate(RenderEmbeddedObject&);
     void removeEmbeddedObjectToUpdate(RenderEmbeddedObject&);
 
-    WEBCORE_EXPORT virtual void paintContents(GraphicsContext*, const IntRect& dirtyRect) override;
+    WEBCORE_EXPORT virtual void paintContents(GraphicsContext&, const IntRect& dirtyRect) override;
 
     struct PaintingState {
         PaintBehavior paintBehavior;
@@ -337,8 +337,8 @@ public:
         }
     };
 
-    void willPaintContents(GraphicsContext*, const IntRect& dirtyRect, PaintingState&);
-    void didPaintContents(GraphicsContext*, const IntRect& dirtyRect, PaintingState&);
+    void willPaintContents(GraphicsContext&, const IntRect& dirtyRect, PaintingState&);
+    void didPaintContents(GraphicsContext&, const IntRect& dirtyRect, PaintingState&);
 
 #if PLATFORM(IOS)
     WEBCORE_EXPORT void didReplaceMultipartContent();
@@ -353,11 +353,11 @@ public:
 
     enum SelectionInSnapshot { IncludeSelection, ExcludeSelection };
     enum CoordinateSpaceForSnapshot { DocumentCoordinates, ViewCoordinates };
-    WEBCORE_EXPORT void paintContentsForSnapshot(GraphicsContext*, const IntRect& imageRect, SelectionInSnapshot shouldPaintSelection, CoordinateSpaceForSnapshot);
+    WEBCORE_EXPORT void paintContentsForSnapshot(GraphicsContext&, const IntRect& imageRect, SelectionInSnapshot shouldPaintSelection, CoordinateSpaceForSnapshot);
 
-    virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) override;
-    virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect) override;
-    virtual void paintScrollbar(GraphicsContext*, Scrollbar*, const IntRect&) override;
+    virtual void paintOverhangAreas(GraphicsContext&, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) override;
+    virtual void paintScrollCorner(GraphicsContext&, const IntRect& cornerRect) override;
+    virtual void paintScrollbar(GraphicsContext&, Scrollbar&, const IntRect&) override;
 
     WEBCORE_EXPORT Color documentBackgroundColor() const;
 
index f48285e..f62dfa6 100644 (file)
@@ -201,7 +201,7 @@ void PrintContext::spoolPage(GraphicsContext& ctx, int pageNumber, float width)
     ctx.scale(FloatSize(scale, scale));
     ctx.translate(-pageRect.x(), -pageRect.y());
     ctx.clip(pageRect);
-    m_frame->view()->paintContents(&ctx, pageRect);
+    m_frame->view()->paintContents(ctx, pageRect);
     ctx.restore();
 }
 
@@ -211,7 +211,7 @@ void PrintContext::spoolRect(GraphicsContext& ctx, const IntRect& rect)
     ctx.save();
     ctx.translate(-rect.x(), -rect.y());
     ctx.clip(rect);
-    m_frame->view()->paintContents(&ctx, rect);
+    m_frame->view()->paintContents(ctx, rect);
     ctx.restore();
 }
 
index 4c0f921..e3bd46f 100644 (file)
 
 namespace WebCore {
 
-static void drawRectIntoContext(IntRect rect, FrameView* view, GraphicsContext* gc)
+static void drawRectIntoContext(IntRect rect, FrameView* view, GraphicsContext& gc)
 {
     IntSize offset = view->scrollOffset();
     rect.move(-offset.width(), -offset.height());
     rect = view->convertToContainingWindow(rect);
 
-    gc->concatCTM(AffineTransform().translate(-rect.x(), -rect.y()));
+    gc.concatCTM(AffineTransform().translate(-rect.x(), -rect.y()));
 
     view->paint(gc, rect);
 }
@@ -72,7 +72,7 @@ GDIObject<HBITMAP> imageFromRect(const Frame* frame, IntRect& ir)
 
     GraphicsContext gc(context);
 
-    drawRectIntoContext(ir, frame->view(), &gc);
+    drawRectIntoContext(ir, frame->view(), gc);
 
     CGContextRelease(context);
     SelectObject(hdc.get(), hbmpOld);
index fb0372a..60f3708 100644 (file)
@@ -1147,14 +1147,14 @@ void ScrollView::updateScrollCorner()
 {
 }
 
-void ScrollView::paintScrollCorner(GraphicsContext* context, const IntRect& cornerRect)
+void ScrollView::paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect)
 {
     ScrollbarTheme::theme()->paintScrollCorner(this, context, cornerRect);
 }
 
-void ScrollView::paintScrollbar(GraphicsContext* context, Scrollbar* bar, const IntRect& rect)
+void ScrollView::paintScrollbar(GraphicsContext& context, Scrollbar& bar, const IntRect& rect)
 {
-    bar->paint(context, rect);
+    bar.paint(context, rect);
 }
 
 void ScrollView::invalidateScrollCornerRect(const IntRect& rect)
@@ -1162,12 +1162,12 @@ void ScrollView::invalidateScrollCornerRect(const IntRect& rect)
     invalidateRect(rect);
 }
 
-void ScrollView::paintScrollbars(GraphicsContext* context, const IntRect& rect)
+void ScrollView::paintScrollbars(GraphicsContext& context, const IntRect& rect)
 {
     if (m_horizontalScrollbar && !layerForHorizontalScrollbar())
-        paintScrollbar(context, m_horizontalScrollbar.get(), rect);
+        paintScrollbar(context, *m_horizontalScrollbar.get(), rect);
     if (m_verticalScrollbar && !layerForVerticalScrollbar())
-        paintScrollbar(context, m_verticalScrollbar.get(), rect);
+        paintScrollbar(context, *m_verticalScrollbar.get(), rect);
 
     if (layerForScrollCorner())
         return;
@@ -1175,23 +1175,23 @@ void ScrollView::paintScrollbars(GraphicsContext* context, const IntRect& rect)
     paintScrollCorner(context, scrollCornerRect());
 }
 
-void ScrollView::paintPanScrollIcon(GraphicsContext* context)
+void ScrollView::paintPanScrollIcon(GraphicsContext& context)
 {
     static Image* panScrollIcon = Image::loadPlatformResource("panIcon").leakRef();
     IntPoint iconGCPoint = m_panScrollIconPoint;
     if (parent())
         iconGCPoint = parent()->windowToContents(iconGCPoint);
-    context->drawImage(panScrollIcon, ColorSpaceDeviceRGB, iconGCPoint);
+    context.drawImage(panScrollIcon, ColorSpaceDeviceRGB, iconGCPoint);
 }
 
-void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
+void ScrollView::paint(GraphicsContext& context, const IntRect& rect)
 {
     if (platformWidget()) {
         Widget::paint(context, rect);
         return;
     }
 
-    if (context->paintingDisabled() && !context->updatingControlTints())
+    if (context.paintingDisabled() && !context.updatingControlTints())
         return;
 
     notifyPageThatContentAreaWillPaint();
@@ -1203,16 +1203,16 @@ void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
     }
 
     if (!documentDirtyRect.isEmpty()) {
-        GraphicsContextStateSaver stateSaver(*context);
+        GraphicsContextStateSaver stateSaver(context);
 
-        context->translate(x(), y());
+        context.translate(x(), y());
         documentDirtyRect.moveBy(-location());
 
         if (!paintsEntireContents()) {
-            context->translate(-scrollX(), -scrollY());
+            context.translate(-scrollX(), -scrollY());
             documentDirtyRect.moveBy(scrollPosition());
 
-            context->clip(visibleContentRect(LegacyIOSDocumentVisibleRect));
+            context.clip(visibleContentRect(LegacyIOSDocumentVisibleRect));
         }
 
         paintContents(context, documentDirtyRect);
@@ -1227,13 +1227,13 @@ void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
 
     // Now paint the scrollbars.
     if (!m_scrollbarsSuppressed && (m_horizontalScrollbar || m_verticalScrollbar)) {
-        GraphicsContextStateSaver stateSaver(*context);
+        GraphicsContextStateSaver stateSaver(context);
         IntRect scrollViewDirtyRect = rect;
         IntRect visibleAreaWithScrollbars(location(), unobscuredContentRectIncludingScrollbars().size());
         scrollViewDirtyRect.intersect(visibleAreaWithScrollbars);
-        context->translate(x(), y());
+        context.translate(x(), y());
         scrollViewDirtyRect.moveBy(-location());
-        context->clip(IntRect(IntPoint(), visibleAreaWithScrollbars.size()));
+        context.clip(IntRect(IntPoint(), visibleAreaWithScrollbars.size()));
 
         paintScrollbars(context, scrollViewDirtyRect);
     }
@@ -1299,12 +1299,12 @@ void ScrollView::updateOverhangAreas()
         window->invalidateContentsAndRootView(verticalOverhangRect);
 }
 
-void ScrollView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
+void ScrollView::paintOverhangAreas(GraphicsContext& context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
 {
-    ScrollbarTheme::theme()->paintOverhangAreas(this, context, horizontalOverhangRect, verticalOverhangRect, dirtyRect);
+    ScrollbarTheme::theme()->paintOverhangAreas(*this, context, horizontalOverhangRect, verticalOverhangRect, dirtyRect);
 }
 
-void ScrollView::calculateAndPaintOverhangAreas(GraphicsContext* context, const IntRect& dirtyRect)
+void ScrollView::calculateAndPaintOverhangAreas(GraphicsContext& context, const IntRect& dirtyRect)
 {
     IntRect horizontalOverhangRect;
     IntRect verticalOverhangRect;
index d08f5dd..21c8539 100644 (file)
@@ -343,8 +343,8 @@ public:
     }
 
     // Widget override. Handles painting of the contents of the view as well as the scrollbars.
-    WEBCORE_EXPORT virtual void paint(GraphicsContext*, const IntRect&) override;
-    void paintScrollbars(GraphicsContext*, const IntRect&);
+    WEBCORE_EXPORT virtual void paint(GraphicsContext&, const IntRect&) override;
+    void paintScrollbars(GraphicsContext&, const IntRect&);
 
     // Widget overrides to ensure that our children's visibility status is kept up to date when we get shown and hidden.
     WEBCORE_EXPORT virtual void show() override;
@@ -355,20 +355,20 @@ public:
     static const int noPanScrollRadius = 15;
     void addPanScrollIcon(const IntPoint&);
     void removePanScrollIcon();
-    void paintPanScrollIcon(GraphicsContext*);
+    void paintPanScrollIcon(GraphicsContext&);
 
     virtual bool isPointInScrollbarCorner(const IntPoint&);
     virtual bool scrollbarCornerPresent() const;
     virtual IntRect scrollCornerRect() const override;
-    virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
-    virtual void paintScrollbar(GraphicsContext*, Scrollbar*, const IntRect&);
+    virtual void paintScrollCorner(GraphicsContext&, const IntRect& cornerRect);
+    virtual void paintScrollbar(GraphicsContext&, Scrollbar&, const IntRect&);
 
     virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect&) const override;
     virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect&) const override;
     virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoint&) const override;
     virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const override;
 
-    void calculateAndPaintOverhangAreas(GraphicsContext*, const IntRect& dirtyRect);
+    void calculateAndPaintOverhangAreas(GraphicsContext&, const IntRect& dirtyRect);
 
     virtual bool isScrollView() const override { return true; }
 
@@ -378,9 +378,9 @@ protected:
     ScrollView();
 
     virtual void repaintContentRectangle(const IntRect&);
-    virtual void paintContents(GraphicsContext*, const IntRect& damageRect) = 0;
+    virtual void paintContents(GraphicsContext&, const IntRect& damageRect) = 0;
 
-    virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
+    virtual void paintOverhangAreas(GraphicsContext&, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
 
     virtual void availableContentSizeChanged(AvailableSizeChangeReason) override;
     virtual void addedOrRemovedScrollbar() = 0;
index c4e1c55..3151149 100644 (file)
@@ -151,17 +151,17 @@ void Scrollbar::updateThumbProportion()
     updateThumb();
 }
 
-void Scrollbar::paint(GraphicsContext* context, const IntRect& damageRect)
+void Scrollbar::paint(GraphicsContext& context, const IntRect& damageRect)
 {
-    if (context->updatingControlTints() && theme()->supportsControlTints()) {
+    if (context.updatingControlTints() && theme()->supportsControlTints()) {
         invalidate();
         return;
     }
 
-    if (context->paintingDisabled() || !frameRect().intersects(damageRect))
+    if (context.paintingDisabled() || !frameRect().intersects(damageRect))
         return;
 
-    if (!theme()->paint(*this, *context, damageRect))
+    if (!theme()->paint(*this, context, damageRect))
         Widget::paint(context, damageRect);
 }
 
index bb517eb..9c00eee 100644 (file)
@@ -83,7 +83,7 @@ public:
     WEBCORE_EXPORT void setProportion(int visibleSize, int totalSize);
     void setPressedPos(int p) { m_pressedPos = p; }
 
-    virtual void paint(GraphicsContext*, const IntRect& damageRect) override;
+    virtual void paint(GraphicsContext&, const IntRect& damageRect) override;
 
     bool enabled() const { return m_enabled; }
     virtual void setEnabled(bool);
index fa8af0e..16bb252 100644 (file)
@@ -84,11 +84,11 @@ public:
 
     virtual void invalidatePart(Scrollbar&, ScrollbarPart) { }
 
-    virtual void paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect) { defaultPaintScrollCorner(context, cornerRect); }
-    static void defaultPaintScrollCorner(GraphicsContext* context, const IntRect& cornerRect) { context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB); }
+    virtual void paintScrollCorner(ScrollView*, GraphicsContext& context, const IntRect& cornerRect) { defaultPaintScrollCorner(context, cornerRect); }
+    static void defaultPaintScrollCorner(GraphicsContext& context, const IntRect& cornerRect) { context.fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB); }
 
     virtual void paintTickmarks(GraphicsContext&, Scrollbar&, const IntRect&) { }
-    virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect&, const IntRect&, const IntRect&) { }
+    virtual void paintOverhangAreas(ScrollView&, GraphicsContext&, const IntRect&, const IntRect&, const IntRect&) { }
 
 #if ENABLE(RUBBER_BANDING)
     virtual void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) { }
index 8e2f835..72f2a63 100644 (file)
@@ -260,9 +260,9 @@ int ScrollbarThemeComposite::trackLength(Scrollbar& scrollbar)
     return (scrollbar.orientation() == HorizontalScrollbar) ? constrainedTrackRect.width() : constrainedTrackRect.height();
 }
 
-void ScrollbarThemeComposite::paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect)
+void ScrollbarThemeComposite::paintScrollCorner(ScrollView*, GraphicsContext& context, const IntRect& cornerRect)
 {
-    context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB);
+    context.fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB);
 }
 
 IntRect ScrollbarThemeComposite::thumbRect(Scrollbar& scrollbar)
@@ -279,15 +279,15 @@ IntRect ScrollbarThemeComposite::thumbRect(Scrollbar& scrollbar)
     return thumbRect;
 }
 
-void ScrollbarThemeComposite::paintOverhangAreas(ScrollView*, GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
+void ScrollbarThemeComposite::paintOverhangAreas(ScrollView&, GraphicsContext& context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
 {    
-    context->setFillColor(Color::white, ColorSpaceDeviceRGB);
+    context.setFillColor(Color::white, ColorSpaceDeviceRGB);
     if (!horizontalOverhangRect.isEmpty())
-        context->fillRect(intersection(horizontalOverhangRect, dirtyRect));
+        context.fillRect(intersection(horizontalOverhangRect, dirtyRect));
 
-    context->setFillColor(Color::white, ColorSpaceDeviceRGB);
+    context.setFillColor(Color::white, ColorSpaceDeviceRGB);
     if (!verticalOverhangRect.isEmpty())
-        context->fillRect(intersection(verticalOverhangRect, dirtyRect));
+        context.fillRect(intersection(verticalOverhangRect, dirtyRect));
 }
 
 }
index 70a79ef..7ca664f 100644 (file)
@@ -46,8 +46,8 @@ public:
     virtual int thumbLength(Scrollbar&) override;
     virtual int trackPosition(Scrollbar&) override;
     virtual int trackLength(Scrollbar&) override;
-    virtual void paintScrollCorner(ScrollView*, GraphicsContext*, const IntRect& cornerRect) override;
-    virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) override;
+    virtual void paintScrollCorner(ScrollView*, GraphicsContext&, const IntRect& cornerRect) override;
+    virtual void paintOverhangAreas(ScrollView&, GraphicsContext&, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) override;
 
     virtual bool hasButtons(Scrollbar&) = 0;
     virtual bool hasThumb(Scrollbar&) = 0;
index eac7352..3906342 100644 (file)
@@ -57,19 +57,19 @@ LengthBox Theme::controlPadding(ControlPart part, const FontCascade&, const Leng
     }
 }
 
-void Theme::drawNamedImage(const String& name, GraphicsContext* context, const FloatRect& rect) const
+void Theme::drawNamedImage(const String& name, GraphicsContext& context, const FloatRect& rect) const
 {
     // We only handle one icon at the moment.
     if (name != "wireless-playback")
         return;
 
-    GraphicsContextStateSaver stateSaver(*context);
-    context->setFillColor(Color::black, ColorSpaceDeviceRGB);
+    GraphicsContextStateSaver stateSaver(context);
+    context.setFillColor(Color::black, ColorSpaceDeviceRGB);
 
     // Draw a generic Wireless Playback icon.
 
-    context->scale(FloatSize(rect.size().width() / 100, rect.size().height() / 100));
-    context->translate(8, 1);
+    context.scale(FloatSize(rect.size().width() / 100, rect.size().height() / 100));
+    context.translate(8, 1);
 
     Path outline;
     outline.moveTo(FloatPoint(59, 58.7));
@@ -110,7 +110,7 @@ void Theme::drawNamedImage(const String& name, GraphicsContext* context, const F
     outline.addLineTo(FloatPoint(83.6, 41.6));
     outline.closeSubpath();
 
-    context->fillPath(outline);
+    context.fillPath(outline);
 }
 
 }
index eefb928..e95746b 100644 (file)
@@ -100,7 +100,7 @@ public:
     virtual bool controlRequiresPreWhiteSpace(ControlPart) const { return false; }
 
     // Method for painting a control. The rect is in zoomed coordinates.
-    virtual void paint(ControlPart, ControlStates&, GraphicsContext*, const FloatRect& /*zoomedRect*/, float /*zoomFactor*/, ScrollView*, float /*deviceScaleFactor*/, float /*pageScaleFactor*/) { }
+    virtual void paint(ControlPart, ControlStates&, GraphicsContext&, const FloatRect& /*zoomedRect*/, float /*zoomFactor*/, ScrollView*, float /*deviceScaleFactor*/, float /*pageScaleFactor*/) { }
 
     // Some controls may spill out of their containers (e.g., the check on an OS X checkbox).  When these controls repaint,
     // the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control.
@@ -108,7 +108,7 @@ public:
     // amount is also scaled by the zoomFactor.
     virtual void inflateControlPaintRect(ControlPart, const ControlStates&, FloatRect& /*zoomedRect*/, float /*zoomFactor*/) const { }
 
-    virtual void drawNamedImage(const String&, GraphicsContext*, const FloatRect&) const;
+    virtual void drawNamedImage(const String&, GraphicsContext&, const FloatRect&) const;
 
     // This method is called once, from RenderTheme::adjustDefaultStyleSheet(), to let each platform adjust
     // the default CSS rules in html.css.
index 138cadf..07e42c8 100644 (file)
@@ -117,7 +117,7 @@ public:
     void move(int x, int y) { setFrameRect(IntRect(x, y, width(), height())); }
     void move(const IntPoint& p) { setFrameRect(IntRect(p, size())); }
 
-    WEBCORE_EXPORT virtual void paint(GraphicsContext*, const IntRect&);
+    WEBCORE_EXPORT virtual void paint(GraphicsContext&, const IntRect&);
     void invalidate() { invalidateRect(boundsRect()); }
     virtual void invalidateRect(const IntRect&) = 0;
 
index da87928..8fccdc5 100644 (file)
@@ -30,7 +30,7 @@
 
 namespace WebCore {
 
-static void fitContextToBox(GraphicsContext* context, const FloatSize& srcImageSize, const FloatSize& dstSize)
+static void fitContextToBox(GraphicsContext& context, const FloatSize& srcImageSize, const FloatSize& dstSize)
 {
     float srcRatio = srcImageSize.aspectRatio();
     float dstRatio = dstSize.aspectRatio();
@@ -45,11 +45,11 @@ static void fitContextToBox(GraphicsContext* context, const FloatSize& srcImageS
         scale = dstSize.height() / srcImageSize.height();
         translationX = (dstSize.width() - scale * srcImageSize.width()) / 2;
     }
-    context->translate(translationX, translationY);
-    context->scale(FloatSize(scale, scale));
+    context.translate(translationX, translationY);
+    context.scale(FloatSize(scale, scale));
 }
 
-void ThemeCocoa::drawNamedImage(const String& name, GraphicsContext* context, const FloatRect& rect) const
+void ThemeCocoa::drawNamedImage(const String& name, GraphicsContext& context, const FloatRect& rect) const
 {
     // We only handle one icon at the moment.
     if (name != "wireless-playback") {
@@ -57,8 +57,8 @@ void ThemeCocoa::drawNamedImage(const String& name, GraphicsContext* context, co
         return;
     }
 
-    GraphicsContextStateSaver stateSaver(*context);
-    context->setFillColor(Color::black, ColorSpaceDeviceRGB);
+    GraphicsContextStateSaver stateSaver(context);
+    context.setFillColor(Color::black, ColorSpaceDeviceRGB);
 
     FloatSize wirelessPlaybackSrcSize(32, 24.016);
     fitContextToBox(context, wirelessPlaybackSrcSize, rect.size());
@@ -84,7 +84,7 @@ void ThemeCocoa::drawNamedImage(const String& name, GraphicsContext* context, co
     outline.addLineTo(FloatPoint(26.917, 24.016));
     outline.closeSubpath();
     
-    context->fillPath(outline);
+    context.fillPath(outline);
 }
 
 }
index 1d6b693..6ba0236 100644 (file)
@@ -35,7 +35,7 @@ public:
     ThemeCocoa() { }
     virtual ~ThemeCocoa() { }
 
-    virtual void drawNamedImage(const String&, GraphicsContext*, const FloatRect&) const override;
+    virtual void drawNamedImage(const String&, GraphicsContext&, const FloatRect&) const override;
 };
 
 } // namespace WebCore
index 0222635..de32389 100644 (file)
@@ -95,7 +95,7 @@ void Widget::hide()
     notImplemented();
 }
 
-void Widget::paint(GraphicsContext*, const IntRect&)
+void Widget::paint(GraphicsContext&, const IntRect&)
 {
     notImplemented();
 }
index d8894fb..9422f94 100644 (file)
@@ -605,13 +605,13 @@ void BitmapImage::resetAnimation()
     destroyDecodedDataIfNecessary(true);
 }
 
-void BitmapImage::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const AffineTransform& transform,
+void BitmapImage::drawPattern(GraphicsContext& ctxt, const FloatRect& tileRect, const AffineTransform& transform,
     const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
 {
     if (tileRect.isEmpty())
         return;
 
-    if (!ctxt->drawLuminanceMask()) {
+    if (!ctxt.drawLuminanceMask()) {
         Image::drawPattern(ctxt, tileRect, transform, phase, styleColorSpace, op, destRect, blendMode);
         return;
     }
@@ -638,7 +638,7 @@ void BitmapImage::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect,
         m_cachedImage->setSpaceSize(spaceSize());
     }
 
-    ctxt->setDrawLuminanceMask(false);
+    ctxt.setDrawLuminanceMask(false);
     m_cachedImage->drawPattern(ctxt, tileRect, transform, phase, styleColorSpace, op, destRect, blendMode);
 }
 
index 2c71cfc..0508d55 100644 (file)
@@ -142,7 +142,7 @@ public:
     virtual void stopAnimation() override;
     virtual void resetAnimation() override;
 
-    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
+    virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform,
         const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal) override;
 
     // Accessors for native image formats.
@@ -201,12 +201,12 @@ protected:
     WEBCORE_EXPORT BitmapImage(ImageObserver* = 0);
 
 #if PLATFORM(WIN)
-    virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator) override;
+    virtual void drawFrameMatchingSourceSize(GraphicsContext&, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator) override;
 #endif
-    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
 
 #if USE(WINGDI)
-    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
+    virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform,
         const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);
 #endif
 
index d7746a9..d2e5215 100644 (file)
@@ -41,68 +41,68 @@ CrossfadeGeneratedImage::CrossfadeGeneratedImage(Image* fromImage, Image* toImag
     setContainerSize(size);
 }
 
-static void drawCrossfadeSubimage(GraphicsContext* context, Image* image, CompositeOperator operation, float opacity, const FloatSize& targetSize)
+static void drawCrossfadeSubimage(GraphicsContext& context, Image* image, CompositeOperator operation, float opacity, const FloatSize& targetSize)
 {
     FloatSize imageSize = image->size();
 
     // SVGImage resets the opacity when painting, so we have to use transparency layers to accurately paint one at a given opacity.
     bool useTransparencyLayer = image->isSVGImage();
 
-    GraphicsContextStateSaver stateSaver(*context);
+    GraphicsContextStateSaver stateSaver(context);
 
-    context->setCompositeOperation(operation);
+    context.setCompositeOperation(operation);
 
     if (useTransparencyLayer)
-        context->beginTransparencyLayer(opacity);
+        context.beginTransparencyLayer(opacity);
     else
-        context->setAlpha(opacity);
+        context.setAlpha(opacity);
 
     if (targetSize != imageSize)
-        context->scale(FloatSize(targetSize.width() / imageSize.width(), targetSize.height() / imageSize.height()));
-    context->drawImage(image, ColorSpaceDeviceRGB, IntPoint());
+        context.scale(FloatSize(targetSize.width() / imageSize.width(), targetSize.height() / imageSize.height()));
+    context.drawImage(image, ColorSpaceDeviceRGB, IntPoint());
 
     if (useTransparencyLayer)
-        context->endTransparencyLayer();
+        context.endTransparencyLayer();
 }
 
-void CrossfadeGeneratedImage::drawCrossfade(GraphicsContext* context)
+void CrossfadeGeneratedImage::drawCrossfade(GraphicsContext& context)
 {
     // Draw nothing if either of the images hasn't loaded yet.
     if (m_fromImage == Image::nullImage() || m_toImage == Image::nullImage())
         return;
 
-    GraphicsContextStateSaver stateSaver(*context);
+    GraphicsContextStateSaver stateSaver(context);
 
-    context->clip(FloatRect(FloatPoint(), m_crossfadeSize));
-    context->beginTransparencyLayer(1);
+    context.clip(FloatRect(FloatPoint(), m_crossfadeSize));
+    context.beginTransparencyLayer(1);
 
     drawCrossfadeSubimage(context, m_fromImage, CompositeSourceOver, 1 - m_percentage, m_crossfadeSize);
     drawCrossfadeSubimage(context, m_toImage, CompositePlusLighter, m_percentage, m_crossfadeSize);
 
-    context->endTransparencyLayer();
+    context.endTransparencyLayer();
 }
 
-void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
+void CrossfadeGeneratedImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
 {
-    GraphicsContextStateSaver stateSaver(*context);
-    context->setCompositeOperation(compositeOp, blendMode);
-    context->clip(dstRect);
-    context->translate(dstRect.x(), dstRect.y());
+    GraphicsContextStateSaver stateSaver(context);
+    context.setCompositeOperation(compositeOp, blendMode);
+    context.clip(dstRect);
+    context.translate(dstRect.x(), dstRect.y());
     if (dstRect.size() != srcRect.size())
-        context->scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()));
-    context->translate(-srcRect.x(), -srcRect.y());
+        context.scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()));
+    context.translate(-srcRect.x(), -srcRect.y());
     
     drawCrossfade(context);
 }
 
-void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
+void CrossfadeGeneratedImage::drawPattern(GraphicsContext& context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
 {
-    std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(size(), 1, ColorSpaceDeviceRGB, context->isAcceleratedContext() ? Accelerated : Unaccelerated);
+    std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(size(), 1, ColorSpaceDeviceRGB, context.isAcceleratedContext() ? Accelerated : Unaccelerated);
     if (!imageBuffer)
         return;
 
     // Fill with the cross-faded image.
-    GraphicsContext* graphicsContext = imageBuffer->context();
+    GraphicsContext& graphicsContext = imageBuffer->context();
     drawCrossfade(graphicsContext);
 
     // Tile the image buffer into the context.
index 56a9875..d3be146 100644 (file)
@@ -49,13 +49,13 @@ public:
     virtual FloatSize size() const override { return m_crossfadeSize; }
 
 protected:
-    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
-    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override;
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
+    virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override;
 
     CrossfadeGeneratedImage(Image* fromImage, Image* toImage, float percentage, const FloatSize& crossfadeSize, const FloatSize&);
 
 private:
-    void drawCrossfade(GraphicsContext*);
+    void drawCrossfade(GraphicsContext&);
 
     Image* m_fromImage;
     Image* m_toImage;
index 3695942..69ab074 100644 (file)
@@ -301,7 +301,7 @@ void FontCascade::update(RefPtr<FontSelector>&& fontSelector) const
     m_typesettingFeatures = computeTypesettingFeatures();
 }
 
-float FontCascade::drawText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to, CustomFontNotReadyAction customFontNotReadyAction) const
+float FontCascade::drawText(GraphicsContext& context, const TextRun& run, const FloatPoint& point, int from, int to, CustomFontNotReadyAction customFontNotReadyAction) const
 {
     // Don't draw anything while we are using custom fonts that are in the process of loading,
     // except if the 'force' argument is set to true (in which case it will use a fallback
@@ -322,7 +322,7 @@ float FontCascade::drawText(GraphicsContext* context, const TextRun& run, const
     return drawComplexText(context, run, point, from, to);
 }
 
-void FontCascade::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
+void FontCascade::drawEmphasisMarks(GraphicsContext& context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
 {
     if (isLoadingCustomFonts())
         return;
@@ -1298,7 +1298,7 @@ float FontCascade::getGlyphsAndAdvancesForSimpleText(const TextRun& run, int fro
     return initialAdvance;
 }
 
-float FontCascade::drawSimpleText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
+float FontCascade::drawSimpleText(GraphicsContext& context, const TextRun& run, const FloatPoint& point, int from, int to) const
 {
     // This glyph buffer holds our glyphs+advances+font data for each glyph.
     GlyphBuffer glyphBuffer;
@@ -1314,7 +1314,7 @@ float FontCascade::drawSimpleText(GraphicsContext* context, const TextRun& run,
     return startPoint.x() - startX;
 }
 
-void FontCascade::drawEmphasisMarksForSimpleText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
+void FontCascade::drawEmphasisMarksForSimpleText(GraphicsContext& context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
 {
     GlyphBuffer glyphBuffer;
     float initialAdvance = getGlyphsAndAdvancesForSimpleText(run, from, to, glyphBuffer, ForTextEmphasis);
@@ -1325,7 +1325,7 @@ void FontCascade::drawEmphasisMarksForSimpleText(GraphicsContext* context, const
     drawEmphasisMarks(context, run, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
 }
 
-void FontCascade::drawGlyphBuffer(GraphicsContext* context, const TextRun& run, const GlyphBuffer& glyphBuffer, FloatPoint& point) const
+void FontCascade::drawGlyphBuffer(GraphicsContext& context, const TextRun& run, const GlyphBuffer& glyphBuffer, FloatPoint& point) const
 {
 #if !ENABLE(SVG_FONTS)
     UNUSED_PARAM(run);
@@ -1349,10 +1349,10 @@ void FontCascade::drawGlyphBuffer(GraphicsContext* context, const TextRun& run,
         if (nextFontData != fontData || nextOffset != offset) {
 #if ENABLE(SVG_FONTS)
             if (renderingContext && fontData->isSVGFont())
-                renderingContext->drawSVGGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
+                renderingContext->drawSVGGlyphs(context, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
             else
 #endif
-                drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
+                drawGlyphs(context, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
 
             lastFrom = nextGlyph;
             fontData = nextFontData;
@@ -1367,11 +1367,11 @@ void FontCascade::drawGlyphBuffer(GraphicsContext* context, const TextRun& run,
 
 #if ENABLE(SVG_FONTS)
     if (renderingContext && fontData->isSVGFont())
-        renderingContext->drawSVGGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
+        renderingContext->drawSVGGlyphs(context, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
     else
 #endif
     {
-        drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
+        drawGlyphs(context, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
         point.setX(nextX);
     }
 }
@@ -1391,7 +1391,7 @@ inline static float offsetToMiddleOfGlyphAtIndex(const GlyphBuffer& glyphBuffer,
     return offsetToMiddleOfGlyph(glyphBuffer.fontAt(i), glyphBuffer.glyphAt(i));
 }
 
-void FontCascade::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const GlyphBuffer& glyphBuffer, const AtomicString& mark, const FloatPoint& point) const
+void FontCascade::drawEmphasisMarks(GraphicsContext& context, const TextRun& run, const GlyphBuffer& glyphBuffer, const AtomicString& mark, const FloatPoint& point) const
 {
     GlyphData markGlyphData;
     if (!getEmphasisMarkGlyphData(mark, markGlyphData))
index 65e5906..166b90e 100644 (file)
@@ -133,9 +133,9 @@ public:
     void update(RefPtr<FontSelector>&&) const;
 
     enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontNotReady };
-    WEBCORE_EXPORT float drawText(GraphicsContext*, const TextRun&, const FloatPoint&, int from = 0, int to = -1, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;
-    void drawGlyphs(GraphicsContext*, const Font*, const GlyphBuffer&, int from, int numGlyphs, const FloatPoint&) const;
-    void drawEmphasisMarks(GraphicsContext*, const TextRun&, const AtomicString& mark, const FloatPoint&, int from = 0, int to = -1) const;
+    WEBCORE_EXPORT float drawText(GraphicsContext&, const TextRun&, const FloatPoint&, int from = 0, int to = -1, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;
+    void drawGlyphs(GraphicsContext&, const Font&, const GlyphBuffer&, int from, int numGlyphs, const FloatPoint&) const;
+    void drawEmphasisMarks(GraphicsContext&, const TextRun&, const AtomicString& mark, const FloatPoint&, int from = 0, int to = -1) const;
 
     DashArray dashesForIntersectionsWithRect(const TextRun&, const FloatPoint& textOrigin, const FloatRect& lineExtents) const;
 
@@ -223,10 +223,10 @@ private:
 
     // Returns the initial in-stream advance.
     float getGlyphsAndAdvancesForSimpleText(const TextRun&, int from, int to, GlyphBuffer&, ForTextEmphasisOrNot = NotForTextEmphasis) const;
-    float drawSimpleText(GraphicsContext*, const TextRun&, const FloatPoint&, int from, int to) const;
-    void drawEmphasisMarksForSimpleText(GraphicsContext*, const TextRun&, const AtomicString& mark, const FloatPoint&, int from, int to) const;
-    void drawGlyphBuffer(GraphicsContext*, const TextRun&, const GlyphBuffer&, FloatPoint&) const;
-    void drawEmphasisMarks(GraphicsContext*, const TextRun&, const GlyphBuffer&, const AtomicString&, const FloatPoint&) const;
+    float drawSimpleText(GraphicsContext&, const TextRun&, const FloatPoint&, int from, int to) const;
+    void drawEmphasisMarksForSimpleText(GraphicsContext&, const TextRun&, const AtomicString& mark, const FloatPoint&, int from, int to) const;
+    void drawGlyphBuffer(GraphicsContext&, const TextRun&, const GlyphBuffer&, FloatPoint&) const;
+    void drawEmphasisMarks(GraphicsContext&, const TextRun&, const GlyphBuffer&, const AtomicString&, const FloatPoint&) const;
     float floatWidthForSimpleText(const TextRun&, HashSet<const Font*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
     int offsetForPositionForSimpleText(const TextRun&, float position, bool includePartialGlyphs) const;
     void adjustSelectionRectForSimpleText(const TextRun&, LayoutRect& selectionRect, int from, int to) const;
@@ -238,8 +238,8 @@ private:
 
     // Returns the initial in-stream advance.
     float getGlyphsAndAdvancesForComplexText(const TextRun&, int from, int to, GlyphBuffer&, ForTextEmphasisOrNot = NotForTextEmphasis) const;
-    float drawComplexText(GraphicsContext*, const TextRun&, const FloatPoint&, int from, int to) const;
-    void drawEmphasisMarksForComplexText(GraphicsContext*, const TextRun&, const AtomicString& mark, const FloatPoint&, int from, int to) const;
+    float drawComplexText(GraphicsContext&, const TextRun&, const FloatPoint&, int from, int to) const;
+    void drawEmphasisMarksForComplexText(GraphicsContext&, const TextRun&, const AtomicString& mark, const FloatPoint&, int from, int to) const;
     float floatWidthForComplexText(const TextRun&, HashSet<const Font*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
     int offsetForPositionForComplexText(const TextRun&, float position, bool includePartialGlyphs) const;
     void adjustSelectionRectForComplexText(const TextRun&, LayoutRect& selectionRect, int from, int to) const;
index 92179ee..7c98aaf 100644 (file)
@@ -49,8 +49,8 @@ public:
     virtual void destroyDecodedData(bool /*destroyAll*/ = true) override { }
 
 protected:
-    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override = 0;
-    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override = 0;
+    virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform,
         const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override = 0;
 
     // FIXME: Implement this to be less conservative.
index 0527120..e6f6fb5 100644 (file)
@@ -43,19 +43,19 @@ GradientImage::~GradientImage()
 {
 }
 
-void GradientImage::draw(GraphicsContext* destContext, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
+void GradientImage::draw(GraphicsContext& destContext, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
 {
-    GraphicsContextStateSaver stateSaver(*destContext);
-    destContext->setCompositeOperation(compositeOp, blendMode);
-    destContext->clip(destRect);
-    destContext->translate(destRect.x(), destRect.y());
+    GraphicsContextStateSaver stateSaver(destContext);
+    destContext.setCompositeOperation(compositeOp, blendMode);
+    destContext.clip(destRect);
+    destContext.translate(destRect.x(), destRect.y());
     if (destRect.size() != srcRect.size())
-        destContext->scale(FloatSize(destRect.width() / srcRect.width(), destRect.height() / srcRect.height()));
-    destContext->translate(-srcRect.x(), -srcRect.y());
-    destContext->fillRect(FloatRect(FloatPoint(), size()), *m_gradient.get());
+        destContext.scale(FloatSize(destRect.width() / srcRect.width(), destRect.height() / srcRect.height()));
+    destContext.translate(-srcRect.x(), -srcRect.y());
+    destContext.fillRect(FloatRect(FloatPoint(), size()), *m_gradient.get());
 }
 
-void GradientImage::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform,
+void GradientImage::drawPattern(GraphicsContext& destContext, const FloatRect& srcRect, const AffineTransform& patternTransform,
     const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& destRect, BlendMode blendMode)
 {
     // Allow the generator to provide visually-equivalent tiling parameters for better performance.
@@ -64,7 +64,7 @@ void GradientImage::drawPattern(GraphicsContext* destContext, const FloatRect& s
     m_gradient->adjustParametersForTiledDrawing(adjustedSize, adjustedSrcRect);
 
     // Factor in the destination context's scale to generate at the best resolution
-    AffineTransform destContextCTM = destContext->getCTM(GraphicsContext::DefinitelyIncludeDeviceScale);
+    AffineTransform destContextCTM = destContext.getCTM(GraphicsContext::DefinitelyIncludeDeviceScale);
     double xScale = fabs(destContextCTM.xScale());
     double yScale = fabs(destContextCTM.yScale());
     AffineTransform adjustedPatternCTM = patternTransform;
@@ -73,23 +73,23 @@ void GradientImage::drawPattern(GraphicsContext* destContext, const FloatRect& s
 
     unsigned generatorHash = m_gradient->hash();
 
-    if (!m_cachedImageBuffer || m_cachedGeneratorHash != generatorHash || m_cachedAdjustedSize != adjustedSize || !destContext->isCompatibleWithBuffer(m_cachedImageBuffer.get())) {
-        m_cachedImageBuffer = destContext->createCompatibleBuffer(adjustedSize, m_gradient->hasAlpha());
+    if (!m_cachedImageBuffer || m_cachedGeneratorHash != generatorHash || m_cachedAdjustedSize != adjustedSize || !destContext.isCompatibleWithBuffer(m_cachedImageBuffer.get())) {
+        m_cachedImageBuffer = destContext.createCompatibleBuffer(adjustedSize, m_gradient->hasAlpha());
         if (!m_cachedImageBuffer)
             return;
 
         // Fill with the generated image.
-        m_cachedImageBuffer->context()->fillRect(FloatRect(FloatPoint(), adjustedSize), *m_gradient);
+        m_cachedImageBuffer->context().fillRect(FloatRect(FloatPoint(), adjustedSize), *m_gradient);
 
         m_cachedGeneratorHash = generatorHash;
         m_cachedAdjustedSize = adjustedSize;
 
-        if (destContext->drawLuminanceMask())
+        if (destContext.drawLuminanceMask())
             m_cachedImageBuffer->convertToLuminanceMask();
     }
 
     m_cachedImageBuffer->setSpaceSize(spaceSize());
-    destContext->setDrawLuminanceMask(false);
+    destContext.setDrawLuminanceMask(false);
 
     // Tile the image buffer into the context.
     m_cachedImageBuffer->drawPattern(destContext, adjustedSrcRect, adjustedPatternCTM, phase, styleColorSpace, compositeOp, destRect, blendMode);
index 401c5fa..6ec576e 100644 (file)
@@ -46,8 +46,8 @@ public:
     virtual ~GradientImage();
 
 protected:
-    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
-    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
+    virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform,
         const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override;
 
     GradientImage(PassRefPtr<Gradient>, const FloatSize&);
index e6b37fd..30340db 100644 (file)
@@ -315,7 +315,7 @@ float GraphicsContext::drawText(const FontCascade& font, const TextRun& run, con
     if (paintingDisabled())
         return 0;
 
-    return font.drawText(this, run, point, from, to);
+    return font.drawText(*this, run, point, from, to);
 }
 
 void GraphicsContext::drawGlyphs(const FontCascade& fontCascade, const Font& font, const GlyphBuffer& buffer, int from, int numGlyphs, const FloatPoint& point)
@@ -323,7 +323,7 @@ void GraphicsContext::drawGlyphs(const FontCascade& fontCascade, const Font& fon
     if (paintingDisabled())
         return;
 
-    fontCascade.drawGlyphs(this, &font, buffer, from, numGlyphs, point);
+    fontCascade.drawGlyphs(*this, font, buffer, from, numGlyphs, point);
 }
 
 void GraphicsContext::drawEmphasisMarks(const FontCascade& font, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to)
@@ -331,7 +331,7 @@ void GraphicsContext::drawEmphasisMarks(const FontCascade& font, const TextRun&
     if (paintingDisabled())
         return;
 
-    font.drawEmphasisMarks(this, run, mark, point, from, to);
+    font.drawEmphasisMarks(*this, run, mark, point, from, to);
 }
 
 void GraphicsContext::drawBidiText(const FontCascade& font, const TextRun& run, const FloatPoint& point, FontCascade::CustomFontNotReadyAction customFontNotReadyAction)
@@ -359,7 +359,7 @@ void GraphicsContext::drawBidiText(const FontCascade& font, const TextRun& run,
         subrun.setDirection(isRTL ? RTL : LTR);
         subrun.setDirectionalOverride(bidiRun->dirOverride(false));
 
-        float width = font.drawText(this, subrun, currPoint, 0, -1, customFontNotReadyAction);
+        float width = font.drawText(*this, subrun, currPoint, 0, -1, customFontNotReadyAction);
         currPoint.move(width, 0);
 
         bidiRun = bidiRun->next();
@@ -396,7 +396,7 @@ void GraphicsContext::drawImage(Image* image, ColorSpace colorSpace, const Float
 
     // FIXME (49002): Should be InterpolationLow
     InterpolationQualityMaintainer interpolationQualityForThisScope(*this, imagePaintingOptions.m_useLowQualityScale ? InterpolationNone : imageInterpolationQuality());
-    image->draw(this, destination, source, colorSpace, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode, imagePaintingOptions.m_orientationDescription);
+    image->draw(*this, destination, source, colorSpace, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode, imagePaintingOptions.m_orientationDescription);
 }
 
 void GraphicsContext::drawTiledImage(Image* image, ColorSpace colorSpace, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize,
@@ -406,7 +406,7 @@ void GraphicsContext::drawTiledImage(Image* image, ColorSpace colorSpace, const
         return;
 
     InterpolationQualityMaintainer interpolationQualityForThisScope(*this, imagePaintingOptions.m_useLowQualityScale ? InterpolationLow : imageInterpolationQuality());
-    image->drawTiled(this, destination, source, tileSize, colorSpace, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode);
+    image->drawTiled(*this, destination, source, tileSize, colorSpace, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode);
 }
 
 void GraphicsContext::drawTiledImage(Image* image, ColorSpace colorSpace, const FloatRect& destination, const FloatRect& source, const FloatSize& tileScaleFactor,
@@ -422,7 +422,7 @@ void GraphicsContext::drawTiledImage(Image* image, ColorSpace colorSpace, const
     }
 
     InterpolationQualityMaintainer interpolationQualityForThisScope(*this, imagePaintingOptions.m_useLowQualityScale ? InterpolationLow : imageInterpolationQuality());
-    image->drawTiled(this, destination, source, tileScaleFactor, hRule, vRule, colorSpace, imagePaintingOptions.m_compositeOperator);
+    image->drawTiled(*this, destination, source, tileScaleFactor, hRule, vRule, colorSpace, imagePaintingOptions.m_compositeOperator);
 }
 
 void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace colorSpace, const FloatPoint& destination, const ImagePaintingOptions& imagePaintingOptions)
@@ -446,7 +446,7 @@ void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace colorSpace,
 
     // FIXME (49002): Should be InterpolationLow
     InterpolationQualityMaintainer interpolationQualityForThisScope(*this, imagePaintingOptions.m_useLowQualityScale ? InterpolationNone : imageInterpolationQuality());
-    image->draw(this, colorSpace, destination, source, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode, imagePaintingOptions.m_useLowQualityScale);
+    image->draw(*this, colorSpace, destination, source, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode, imagePaintingOptions.m_useLowQualityScale);
 }
 
 void GraphicsContext::clip(const IntRect& rect)
@@ -483,7 +483,7 @@ void GraphicsContext::clipToImageBuffer(ImageBuffer* buffer, const FloatRect& re
 {
     if (paintingDisabled())
         return;
-    buffer->clip(this, rect);
+    buffer->clip(*this, rect);
 }
 
 #if !USE(CG) && !USE(CAIRO)
@@ -640,20 +640,20 @@ std::unique_ptr<ImageBuffer> GraphicsContext::createCompatibleBuffer(const Float
     AffineTransform transform = getCTM(DefinitelyIncludeDeviceScale);
     FloatSize scaledSize(static_cast<int>(ceil(size.width() * transform.xScale())), static_cast<int>(ceil(size.height() * transform.yScale())));
 
-    std::unique_ptr<ImageBuffer> buffer = ImageBuffer::createCompatibleBuffer(scaledSize, 1, ColorSpaceDeviceRGB, this, hasAlpha);
+    std::unique_ptr<ImageBuffer> buffer = ImageBuffer::createCompatibleBuffer(scaledSize, 1, ColorSpaceDeviceRGB, *this, hasAlpha);
     if (!buffer)
         return nullptr;
 
-    buffer->context()->scale(FloatSize(scaledSize.width() / size.width(), scaledSize.height() / size.height()));
+    buffer->context().scale(FloatSize(scaledSize.width() / size.width(), scaledSize.height() / size.height()));
 
     return buffer;
 }
 
 bool GraphicsContext::isCompatibleWithBuffer(ImageBuffer* buffer) const
 {
-    GraphicsContext* bufferContext = buffer->context();
+    GraphicsContext& bufferContext = buffer->context();
 
-    return scalesMatch(getCTM(), bufferContext->getCTM()) && isAcceleratedContext() == bufferContext->isAcceleratedContext();
+    return scalesMatch(getCTM(), bufferContext.getCTM()) && isAcceleratedContext() == bufferContext.isAcceleratedContext();
 }
 
 #if !USE(CG)
index d8deff0..c1a0475 100644 (file)
@@ -457,7 +457,7 @@ namespace WebCore {
         AffineTransform& affineTransform();
         void resetAffineTransform();
         void fillRect(const FloatRect&, const Gradient*);
-        void drawText(const Font*, const GlyphBuffer&, int from, int numGlyphs, const FloatPoint&);
+        void drawText(const Font&, const GlyphBuffer&, int from, int numGlyphs, const FloatPoint&);
         void drawFrameControl(const IntRect& rect, unsigned type, unsigned state);
         void drawFocusRect(const IntRect& rect);
         void paintTextField(const IntRect& rect, unsigned state);
index 558ad7c..05ab757 100644 (file)
@@ -1128,8 +1128,7 @@ public:
     void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight,
                        int canvasWidth, int canvasHeight, PlatformContextCairo* context);
 #elif USE(CG)
-    void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight,
-                       int canvasWidth, int canvasHeight, GraphicsContext*);
+    void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, int canvasWidth, int canvasHeight, GraphicsContext&);
 #endif
 
     void markContextChanged();
index 0df7e5e..e743b98 100644 (file)
@@ -78,23 +78,23 @@ bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
     return dataChanged(allDataReceived);
 }
 
-void Image::fillWithSolidColor(GraphicsContext* ctxt, const FloatRect& dstRect, const Color& color, ColorSpace styleColorSpace, CompositeOperator op)
+void Image::fillWithSolidColor(GraphicsContext& ctxt, const FloatRect& dstRect, const Color& color, ColorSpace styleColorSpace, CompositeOperator op)
 {
     if (!color.alpha())
         return;
     
-    CompositeOperator previousOperator = ctxt->compositeOperation();
-    ctxt->setCompositeOperation(!color.hasAlpha() && op == CompositeSourceOver ? CompositeCopy : op);
-    ctxt->fillRect(dstRect, color, styleColorSpace);
-    ctxt->setCompositeOperation(previousOperator);
+    CompositeOperator previousOperator = ctxt.compositeOperation();
+    ctxt.setCompositeOperation(!color.hasAlpha() && op == CompositeSourceOver ? CompositeCopy : op);
+    ctxt.fillRect(dstRect, color, styleColorSpace);
+    ctxt.setCompositeOperation(previousOperator);
 }
 
-void Image::draw(GraphicsContext* ctx, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode, ImageOrientationDescription description)
+void Image::draw(GraphicsContext& ctx, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode, ImageOrientationDescription description)
 {
     draw(ctx, dstRect, srcRect, styleColorSpace, op, blendMode, description);
 }
 
-void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
+void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
 {    
     if (mayFillWithSolidColor()) {
         fillWithSolidColor(ctxt, destRect, solidColor(), styleColorSpace, op);
@@ -123,7 +123,7 @@ void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const Fl
     oneTileRect.setSize(scaledTileSize);
     
     // Check and see if a single draw of the image can cover the entire area we are supposed to tile.
-    if (oneTileRect.contains(destRect) && !ctxt->drawLuminanceMask()) {
+    if (oneTileRect.contains(destRect) && !ctxt.drawLuminanceMask()) {
         FloatRect visibleSrcRect;
         visibleSrcRect.setX((destRect.x() - oneTileRect.x()) / scale.width());
         visibleSrcRect.setY((destRect.y() - oneTileRect.y()) / scale.height());
@@ -135,7 +135,7 @@ void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const Fl
 
 #if PLATFORM(IOS)
     // When using accelerated drawing on iOS, it's faster to stretch an image than to tile it.
-    if (ctxt->isAcceleratedContext()) {
+    if (ctxt.isAcceleratedContext()) {
         if (size().width() == 1 && intersection(oneTileRect, destRect).height() == destRect.height()) {
             FloatRect visibleSrcRect;
             visibleSrcRect.setX(0);
@@ -166,12 +166,12 @@ void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const Fl
 #else
     const float maxPatternTilePixels = 2048 * 2048;
 #endif
-    FloatRect transformedTileSize = ctxt->getCTM().mapRect(FloatRect(FloatPoint(), scaledTileSize));
+    FloatRect transformedTileSize = ctxt.getCTM().mapRect(FloatRect(FloatPoint(), scaledTileSize));
     float transformedTileSizePixels = transformedTileSize.width() * transformedTileSize.height();
     FloatRect currentTileRect = oneTileRect;
     if (transformedTileSizePixels > maxPatternTilePixels) {
-        GraphicsContextStateSaver stateSaver(*ctxt);
-        ctxt->clip(destRect);
+        GraphicsContextStateSaver stateSaver(ctxt);
+        ctxt.clip(destRect);
 
         currentTileRect.shiftYEdgeTo(destRect.y());
         float toY = currentTileRect.y();
@@ -205,7 +205,7 @@ void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const Fl
 }
 
 // FIXME: Merge with the other drawTiled eventually, since we need a combination of both for some things.
-void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect,
+void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& dstRect, const FloatRect& srcRect,
     const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, ColorSpace styleColorSpace, CompositeOperator op)
 {    
     if (mayFillWithSolidColor()) {
index 58c0d95..f69a059 100644 (file)
@@ -166,7 +166,7 @@ public:
     virtual Evas_Object* getEvasObject(Evas*) { return 0; }
 #endif
 
-    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
+    virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform,
         const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
 
 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
@@ -185,16 +185,16 @@ public:
 protected:
     Image(ImageObserver* = nullptr);
 
-    static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, const Color&, ColorSpace styleColorSpace, CompositeOperator);
+    static void fillWithSolidColor(GraphicsContext&, const FloatRect& dstRect, const Color&, ColorSpace styleColorSpace, CompositeOperator);
 
     // The ColorSpace parameter will only be used for untagged images.
 #if PLATFORM(WIN)
-    virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator) { }
+    virtual void drawFrameMatchingSourceSize(GraphicsContext&, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator) { }
 #endif
-    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription);
-    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, ColorSpace styleColorSpace,
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription);
+    void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, ColorSpace styleColorSpace,
         CompositeOperator , BlendMode);
-    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, ColorSpace styleColorSpace, CompositeOperator);
+    void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, ColorSpace styleColorSpace, CompositeOperator);
 
     // Supporting tiled drawing
     virtual bool mayFillWithSolidColor() { return false; }
index 52217d6..88b8149 100644 (file)
@@ -158,9 +158,9 @@ bool ImageBuffer::copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC
     return false;
 }
 
-std::unique_ptr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, float resolutionScale, ColorSpace colorSpace, const GraphicsContext* context, bool)
+std::unique_ptr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, float resolutionScale, ColorSpace colorSpace, const GraphicsContext& context, bool)
 {
-    return create(size, resolutionScale, colorSpace, context->isAcceleratedContext() ? Accelerated : Unaccelerated);
+    return create(size, resolutionScale, colorSpace, context.isAcceleratedContext() ? Accelerated : Unaccelerated);
 }
 
 }
index 605c45c..b9e9a6b 100644 (file)
@@ -84,7 +84,7 @@ public:
         return buffer;
     }
 
-    static std::unique_ptr<ImageBuffer> createCompatibleBuffer(const FloatSize&, float resolutionScale, ColorSpace, const GraphicsContext*, bool hasAlpha);
+    static std::unique_ptr<ImageBuffer> createCompatibleBuffer(const FloatSize&, float resolutionScale, ColorSpace, const GraphicsContext&, bool hasAlpha);
 
     WEBCORE_EXPORT ~ImageBuffer();
 
@@ -94,7 +94,7 @@ public:
 
     float resolutionScale() const { return m_resolutionScale; }
 
-    WEBCORE_EXPORT GraphicsContext* context() const;
+    WEBCORE_EXPORT GraphicsContext& context() const;
 
     WEBCORE_EXPORT RefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavior = Scaled) const;
     // Give hints on the faster copyImage Mode, return DontCopyBackingStore if it supports the DontCopyBackingStore behavior
@@ -141,10 +141,10 @@ private:
     RetainPtr<CGImageRef> copyNativeImage(BackingStoreCopy = CopyBackingStore) const;
     void flushContext() const;
 #endif
-    void clip(GraphicsContext*, const FloatRect&) const;
+    void clip(GraphicsContext&, const FloatRect&) const;
 
-    void draw(GraphicsContext*, ColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
-    void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
+    void draw(GraphicsContext&, ColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
+    void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
 
     inline void genericConvertToLuminanceMask();
 
index 9a4ca65..8021129 100644 (file)
@@ -138,7 +138,7 @@ public:
 
     void setSize(const IntSize&) override { }
 
-    void paint(GraphicsContext*, const FloatRect&) override { }
+    void paint(GraphicsContext&, const FloatRect&) override { }
 
     bool canLoadPoster() const override { return false; }
     void setPoster(const String&) override { }
@@ -779,12 +779,12 @@ void MediaPlayer::setPreload(MediaPlayer::Preload preload)
     m_private->setPreload(preload);
 }
 
-void MediaPlayer::paint(GraphicsContext* p, const FloatRect& r)
+void MediaPlayer::paint(GraphicsContext& p, const FloatRect& r)
 {
     m_private->paint(p, r);
 }
 
-void MediaPlayer::paintCurrentFrameInContext(GraphicsContext* p, const FloatRect& r)
+void MediaPlayer::paintCurrentFrameInContext(GraphicsContext& p, const FloatRect& r)
 {
     m_private->paintCurrentFrameInContext(p, r);
 }
index b4fc643..8036418 100644 (file)
@@ -418,8 +418,8 @@ public:
     bool autoplay() const;
     void setAutoplay(bool);
 
-    void paint(GraphicsContext*, const FloatRect&);
-    void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&);
+    void paint(GraphicsContext&, const FloatRect&);
+    void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&);
 
     // copyVideoTextureToPlatformTexture() is used to do the GPU-GPU textures copy without a readback to system memory.
     // The first five parameters denote the corresponding GraphicsContext, destination texture, requested level, requested type and the required internalFormat for destination texture.
index 363724e..960a2c3 100644 (file)
@@ -144,9 +144,9 @@ public:
 
     virtual void setSize(const IntSize&) = 0;
 
-    virtual void paint(GraphicsContext*, const FloatRect&) = 0;
+    virtual void paint(GraphicsContext&, const FloatRect&) = 0;
 
-    virtual void paintCurrentFrameInContext(GraphicsContext* c, const FloatRect& r) { paint(c, r); }
+    virtual void paintCurrentFrameInContext(GraphicsContext& c, const FloatRect& r) { paint(c, r); }
     virtual bool copyVideoTextureToPlatformTexture(GraphicsContext3D*, Platform3DObject, GC3Dint, GC3Denum, GC3Denum, bool, bool) { return false; }
     virtual PassNativeImagePtr nativeImageForCurrentTime() { return nullptr; }
 
index 9ba9bf0..24e37c6 100644 (file)
@@ -39,16 +39,16 @@ NamedImageGeneratedImage::NamedImageGeneratedImage(String name, const FloatSize&
     setContainerSize(size);
 }
 
-void NamedImageGeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
+void NamedImageGeneratedImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
 {
 #if USE(NEW_THEME)
-    GraphicsContextStateSaver stateSaver(*context);
-    context->setCompositeOperation(compositeOp, blendMode);
-    context->clip(dstRect);
-    context->translate(dstRect.x(), dstRect.y());
+    GraphicsContextStateSaver stateSaver(context);
+    context.setCompositeOperation(compositeOp, blendMode);
+    context.clip(dstRect);
+    context.translate(dstRect.x(), dstRect.y());
     if (dstRect.size() != srcRect.size())
-        context->scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()));
-    context->translate(-srcRect.x(), -srcRect.y());
+        context.scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()));
+    context.translate(-srcRect.x(), -srcRect.y());
 
     platformTheme()->drawNamedImage(m_name, context, dstRect);
 #else
@@ -60,15 +60,15 @@ void NamedImageGeneratedImage::draw(GraphicsContext* context, const FloatRect& d
 #endif
 }
 
-void NamedImageGeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
+void NamedImageGeneratedImage::drawPattern(GraphicsContext& context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
 {
 #if USE(NEW_THEME)
 //    std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(size(), 1, ColorSpaceDeviceRGB, context->isAcceleratedContext() ? Accelerated : Unaccelerated);
-    std::unique_ptr<ImageBuffer> imageBuffer = context->createCompatibleBuffer(size(), true);
+    std::unique_ptr<ImageBuffer> imageBuffer = context.createCompatibleBuffer(size(), true);
     if (!imageBuffer)
         return;
 
-    GraphicsContext* graphicsContext = imageBuffer->context();
+    GraphicsContext& graphicsContext = imageBuffer->context();
     platformTheme()->drawNamedImage(m_name, graphicsContext, FloatRect(0, 0, size().width(), size().height()));
 
     // Tile the image buffer into the context.
index 01778eb..1484220 100644 (file)
@@ -41,8 +41,8 @@ public:
     }
 
 protected:
-    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
-    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override;
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
+    virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override;
 
     NamedImageGeneratedImage(String name, const FloatSize&);
 
index d70865a..623e9cc 100644 (file)
@@ -368,12 +368,12 @@ void ShadowBlur::blurLayerImage(unsigned char* imageData, const IntSize& size, i
     }
 }
 
-void ShadowBlur::adjustBlurRadius(GraphicsContext* context)
+void ShadowBlur::adjustBlurRadius(GraphicsContext& context)
 {
     if (!m_shadowsIgnoreTransforms)
         return;
 
-    AffineTransform transform = context->getCTM();
+    AffineTransform transform = context.getCTM();
     m_blurRadius.scale(1 / static_cast<float>(transform.xScale()), 1 / static_cast<float>(transform.yScale()));
 }
 
@@ -391,7 +391,7 @@ IntSize ShadowBlur::blurredEdgeSize() const
     return edgeSize;
 }
 
-IntRect ShadowBlur::calculateLayerBoundingRect(GraphicsContext* context, const FloatRect& shadowedRect, const IntRect& clipRect)
+IntRect ShadowBlur::calculateLayerBoundingRect(GraphicsContext& context, const FloatRect& shadowedRect, const IntRect& clipRect)
 {
     IntSize edgeSize = blurredEdgeSize();
 
@@ -399,7 +399,7 @@ IntRect ShadowBlur::calculateLayerBoundingRect(GraphicsContext* context, const F
     FloatRect layerRect;
     IntSize inflation;
 
-    const AffineTransform transform = context->getCTM();
+    const AffineTransform transform = context.getCTM();
     if (m_shadowsIgnoreTransforms && !transform.isIdentity()) {
         FloatQuad transformedPolygon = transform.mapQuad(FloatQuad(shadowedRect));
         transformedPolygon.move(m_offset);
@@ -457,24 +457,24 @@ IntRect ShadowBlur::calculateLayerBoundingRect(GraphicsContext* context, const F
     return enclosingIntRect(layerRect);
 }
 
-void ShadowBlur::drawShadowBuffer(GraphicsContext* graphicsContext)
+void ShadowBlur::drawShadowBuffer(GraphicsContext& graphicsContext)
 {
     if (!m_layerImage)
         return;
 
-    GraphicsContextStateSaver stateSaver(*graphicsContext);
+    GraphicsContextStateSaver stateSaver(graphicsContext);
 
     IntSize bufferSize = m_layerImage->internalSize();
     if (bufferSize != m_layerSize) {
         // The rect passed to clipToImageBuffer() has to be the size of the entire buffer,
         // but we may not have cleared it all, so clip to the filled part first.
-        graphicsContext->clip(FloatRect(m_layerOrigin, m_layerSize));
+        graphicsContext.clip(FloatRect(m_layerOrigin, m_layerSize));
     }
-    graphicsContext->clipToImageBuffer(m_layerImage, FloatRect(m_layerOrigin, bufferSize));
-    graphicsContext->setFillColor(m_color, m_colorSpace);
+    graphicsContext.clipToImageBuffer(m_layerImage, FloatRect(m_layerOrigin, bufferSize));
+    graphicsContext.setFillColor(m_color, m_colorSpace);
 
-    graphicsContext->clearShadow();
-    graphicsContext->fillRect(FloatRect(m_layerOrigin, m_sourceRect.size()));
+    graphicsContext.clearShadow();
+    graphicsContext.fillRect(FloatRect(m_layerOrigin, m_sourceRect.size()));
 }
 
 static void computeSliceSizesFromRadii(const IntSize& twiceRadius, const FloatRoundedRect::Radii& radii, int& leftSlice, int& rightSlice, int& topSlice, int& bottomSlice)
@@ -504,9 +504,9 @@ IntSize ShadowBlur::templateSize(const IntSize& radiusPadding, const FloatRounde
                    templateSideLength + topSlice + bottomSlice);
 }
 
-void ShadowBlur::drawRectShadow(GraphicsContext* graphicsContext, const FloatRoundedRect& shadowedRect)
+void ShadowBlur::drawRectShadow(GraphicsContext& graphicsContext, const FloatRoundedRect& shadowedRect)
 {
-    IntRect layerRect = calculateLayerBoundingRect(graphicsContext, shadowedRect.rect(), graphicsContext->clipBounds());
+    IntRect layerRect = calculateLayerBoundingRect(graphicsContext, shadowedRect.rect(), graphicsContext.clipBounds());
     if (layerRect.isEmpty())
         return;
 
@@ -514,7 +514,7 @@ void ShadowBlur::drawRectShadow(GraphicsContext* graphicsContext, const FloatRou
 
     // drawRectShadowWithTiling does not work with rotations.
     // https://bugs.webkit.org/show_bug.cgi?id=45042
-    if (!graphicsContext->getCTM().preservesAxisAlignment() || m_type != BlurShadow) {
+    if (!graphicsContext.getCTM().preservesAxisAlignment() || m_type != BlurShadow) {
         drawRectShadowWithoutTiling(graphicsContext, shadowedRect, layerRect);
         return;
     }
@@ -532,9 +532,9 @@ void ShadowBlur::drawRectShadow(GraphicsContext* graphicsContext, const FloatRou
     drawRectShadowWithTiling(graphicsContext, shadowedRect, templateSize, edgeSize);
 }
 
-void ShadowBlur::drawInsetShadow(GraphicsContext* graphicsContext, const FloatRect& rect, const FloatRoundedRect& holeRect)
+void ShadowBlur::drawInsetShadow(GraphicsContext& graphicsContext, const FloatRect& rect, const FloatRoundedRect& holeRect)
 {
-    IntRect layerRect = calculateLayerBoundingRect(graphicsContext, rect, graphicsContext->clipBounds());
+    IntRect layerRect = calculateLayerBoundingRect(graphicsContext, rect, graphicsContext.clipBounds());
     if (layerRect.isEmpty())
         return;
 
@@ -542,7 +542,7 @@ void ShadowBlur::drawInsetShadow(GraphicsContext* graphicsContext, const FloatRe
 
     // drawInsetShadowWithTiling does not work with rotations.
     // https://bugs.webkit.org/show_bug.cgi?id=45042
-    if (!graphicsContext->getCTM().preservesAxisAlignment() || m_type != BlurShadow) {
+    if (!graphicsContext.getCTM().preservesAxisAlignment() || m_type != BlurShadow) {
         drawInsetShadowWithoutTiling(graphicsContext, rect, holeRect, layerRect);
         return;
     }
@@ -560,7 +560,7 @@ void ShadowBlur::drawInsetShadow(GraphicsContext* graphicsContext, const FloatRe
     drawInsetShadowWithTiling(graphicsContext, rect, holeRect, templateSize, edgeSize);
 }
 
-void ShadowBlur::drawRectShadowWithoutTiling(GraphicsContext* graphicsContext, const FloatRoundedRect& shadowedRect, const IntRect& layerRect)
+void ShadowBlur::drawRectShadowWithoutTiling(GraphicsContext& graphicsContext, const FloatRoundedRect& shadowedRect, const IntRect& layerRect)
 {
     m_layerImage = ScratchBuffer::singleton().getScratchBuffer(layerRect.size());
     if (!m_layerImage)
@@ -572,19 +572,19 @@ void ShadowBlur::drawRectShadowWithoutTiling(GraphicsContext* graphicsContext, c
     // Only redraw in the scratch buffer if its cached contents don't match our needs
     bool redrawNeeded = ScratchBuffer::singleton().setCachedShadowValues(m_blurRadius, Color::black, ColorSpaceDeviceRGB, bufferRelativeShadowedRect, shadowedRect.radii(), m_layerSize);
     if (redrawNeeded) {
-        GraphicsContext* shadowContext = m_layerImage->context();
-        GraphicsContextStateSaver stateSaver(*shadowContext);
+        GraphicsContext& shadowContext = m_layerImage->context();
+        GraphicsContextStateSaver stateSaver(shadowContext);
 
         // Add a pixel to avoid later edge aliasing when rotated.
-        shadowContext->clearRect(FloatRect(0, 0, m_layerSize.width() + 1, m_layerSize.height() + 1));
-        shadowContext->translate(m_layerContextTranslation);
-        shadowContext->setFillColor(Color::black, ColorSpaceDeviceRGB);
+        shadowContext.clearRect(FloatRect(0, 0, m_layerSize.width() + 1, m_layerSize.height() + 1));
+        shadowContext.translate(m_layerContextTranslation);
+        shadowContext.setFillColor(Color::black, ColorSpaceDeviceRGB);
         if (shadowedRect.radii().isZero())
-            shadowContext->fillRect(shadowedRect.rect());
+            shadowContext.fillRect(shadowedRect.rect());
         else {
             Path path;
             path.addRoundedRect(shadowedRect);
-            shadowContext->fillPath(path);
+            shadowContext.fillPath(path);
         }
 
         blurShadowBuffer(expandedIntSize(m_layerSize));
@@ -595,7 +595,7 @@ void ShadowBlur::drawRectShadowWithoutTiling(GraphicsContext* graphicsContext, c
     ScratchBuffer::singleton().scheduleScratchBufferPurge();
 }
 
-void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext* graphicsContext, const FloatRect& rect, const FloatRoundedRect& holeRect, const IntRect& layerRect)
+void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext& graphicsContext, const FloatRect& rect, const FloatRoundedRect& holeRect, const IntRect& layerRect)
 {
     m_layerImage = ScratchBuffer::singleton().getScratchBuffer(layerRect.size());
     if (!m_layerImage)
@@ -610,12 +610,12 @@ void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext* graphicsContext,
     // Only redraw in the scratch buffer if its cached contents don't match our needs
     bool redrawNeeded = ScratchBuffer::singleton().setCachedInsetShadowValues(m_blurRadius, Color::black, ColorSpaceDeviceRGB, bufferRelativeRect, bufferRelativeHoleRect, holeRect.radii());
     if (redrawNeeded) {
-        GraphicsContext* shadowContext = m_layerImage->context();
-        GraphicsContextStateSaver stateSaver(*shadowContext);
+        GraphicsContext& shadowContext = m_layerImage->context();
+        GraphicsContextStateSaver stateSaver(shadowContext);
 
         // Add a pixel to avoid later edge aliasing when rotated.
-        shadowContext->clearRect(FloatRect(0, 0, m_layerSize.width() + 1, m_layerSize.height() + 1));
-        shadowContext->translate(m_layerContextTranslation);
+        shadowContext.clearRect(FloatRect(0, 0, m_layerSize.width() + 1, m_layerSize.height() + 1));
+        shadowContext.translate(m_layerContextTranslation);
 
         Path path;
         path.addRect(rect);
@@ -624,9 +624,9 @@ void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext* graphicsContext,
         else
             path.addRoundedRect(holeRect);
 
-        shadowContext->setFillRule(RULE_EVENODD);
-        shadowContext->setFillColor(Color::black, ColorSpaceDeviceRGB);
-        shadowContext->fillPath(path);
+        shadowContext.setFillRule(RULE_EVENODD);
+        shadowContext.setFillColor(Color::black, ColorSpaceDeviceRGB);
+        shadowContext.fillPath(path);
 
         blurShadowBuffer(expandedIntSize(m_layerSize));
     }
@@ -668,7 +668,7 @@ void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext* graphicsContext,
      the shadow.
  */
 
-void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext* graphicsContext, const FloatRect& rect, const FloatRoundedRect& holeRect, const IntSize& templateSize, const IntSize& edgeSize)
+void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext& graphicsContext, const FloatRect& rect, const FloatRoundedRect& holeRect, const IntSize& templateSize, const IntSize& edgeSize)
 {
     m_layerImage = ScratchBuffer::singleton().getScratchBuffer(templateSize);
     if (!m_layerImage)
@@ -682,11 +682,11 @@ void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext* graphicsContext, con
     bool redrawNeeded = ScratchBuffer::singleton().setCachedInsetShadowValues(m_blurRadius, m_color, m_colorSpace, templateBounds, templateHole, holeRect.radii());
     if (redrawNeeded) {
         // Draw shadow into a new ImageBuffer.
-        GraphicsContext* shadowContext = m_layerImage->context();
-        GraphicsContextStateSaver shadowStateSaver(*shadowContext);
-        shadowContext->clearRect(templateBounds);
-        shadowContext->setFillRule(RULE_EVENODD);
-        shadowContext->setFillColor(Color::black, ColorSpaceDeviceRGB);
+        GraphicsContext& shadowContext = m_layerImage->context();
+        GraphicsContextStateSaver shadowStateSaver(shadowContext);
+        shadowContext.clearRect(templateBounds);
+        shadowContext.setFillRule(RULE_EVENODD);
+        shadowContext.setFillColor(Color::black, ColorSpaceDeviceRGB);
 
         Path path;
         path.addRect(templateBounds);
@@ -695,13 +695,13 @@ void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext* graphicsContext, con
         else
             path.addRoundedRect(FloatRoundedRect(templateHole, holeRect.radii()));
 
-        shadowContext->fillPath(path);
+        shadowContext.fillPath(path);
 
         blurAndColorShadowBuffer(templateSize);
     }
     FloatSize offset = m_offset;
     if (shadowsIgnoreTransforms()) {
-        AffineTransform transform = graphicsContext->getCTM();
+        AffineTransform transform = graphicsContext.getCTM();
         offset.scale(1 / transform.xScale(), 1 / transform.yScale());
     }
 
@@ -720,11 +720,11 @@ void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext* graphicsContext, con
     exteriorPath.addRect(destHoleBounds);
 
     {
-        GraphicsContextStateSaver fillStateSaver(*graphicsContext);
-        graphicsContext->setFillRule(RULE_EVENODD);
-        graphicsContext->setFillColor(m_color, m_colorSpace);
-        graphicsContext->clearShadow();
-        graphicsContext->fillPath(exteriorPath);
+        GraphicsContextStateSaver fillStateSaver(graphicsContext);
+        graphicsContext.setFillRule(RULE_EVENODD);
+        graphicsContext.setFillColor(m_color, m_colorSpace);
+        graphicsContext.clearShadow();
+        graphicsContext.fillPath(exteriorPath);
     }
     
     drawLayerPieces(graphicsContext, destHoleBounds, holeRect.radii(), edgeSize, templateSize, InnerShadow);
@@ -733,7 +733,7 @@ void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext* graphicsContext, con
     ScratchBuffer::singleton().scheduleScratchBufferPurge();
 }
 
-void ShadowBlur::drawRectShadowWithTiling(GraphicsContext* graphicsContext, const FloatRoundedRect& shadowedRect, const IntSize& templateSize, const IntSize& edgeSize)
+void ShadowBlur::drawRectShadowWithTiling(GraphicsContext& graphicsContext, const FloatRoundedRect& shadowedRect, const IntSize& templateSize, const IntSize& edgeSize)
 {
     auto& scratchBuffer = ScratchBuffer::singleton();
     m_layerImage = scratchBuffer.getScratchBuffer(templateSize);
@@ -746,25 +746,25 @@ void ShadowBlur::drawRectShadowWithTiling(GraphicsContext* graphicsContext, cons
     bool redrawNeeded = scratchBuffer.setCachedShadowValues(m_blurRadius, m_color, m_colorSpace, templateShadow, shadowedRect.radii(), m_layerSize);
     if (redrawNeeded) {
         // Draw shadow into the ImageBuffer.
-        GraphicsContext* shadowContext = m_layerImage->context();
-        GraphicsContextStateSaver shadowStateSaver(*shadowContext);
+        GraphicsContext& shadowContext = m_layerImage->context();
+        GraphicsContextStateSaver shadowStateSaver(shadowContext);
 
-        shadowContext->clearRect(FloatRect(0, 0, templateSize.width(), templateSize.height()));
-        shadowContext->setFillColor(Color::black, ColorSpaceDeviceRGB);
+        shadowContext.clearRect(FloatRect(0, 0, templateSize.width(), templateSize.height()));
+        shadowContext.setFillColor(Color::black, ColorSpaceDeviceRGB);
         
         if (shadowedRect.radii().isZero())
-            shadowContext->fillRect(templateShadow);
+            shadowContext.fillRect(templateShadow);
         else {
             Path path;
             path.addRoundedRect(FloatRoundedRect(templateShadow, shadowedRect.radii()));
-            shadowContext->fillPath(path);
+            shadowContext.fillPath(path);
         }
 
         blurAndColorShadowBuffer(templateSize);
     }
     FloatSize offset = m_offset;
     if (shadowsIgnoreTransforms()) {
-        AffineTransform transform = graphicsContext->getCTM();
+        AffineTransform transform = graphicsContext.getCTM();
         offset.scale(1 / transform.xScale(), 1 / transform.yScale());
     }
 
@@ -779,7 +779,7 @@ void ShadowBlur::drawRectShadowWithTiling(GraphicsContext* graphicsContext, cons
     ScratchBuffer::singleton().scheduleScratchBufferPurge();
 }
 
-void ShadowBlur::drawLayerPieces(GraphicsContext* graphicsContext, const FloatRect& shadowBounds, const FloatRoundedRect::Radii& radii, const IntSize& bufferPadding, const IntSize& templateSize, ShadowDirection direction)
+void ShadowBlur::drawLayerPieces(GraphicsContext& graphicsContext, const FloatRect& shadowBounds, const FloatRoundedRect::Radii& radii, const IntSize& bufferPadding, const IntSize& templateSize, ShadowDirection direction)
 {
     const IntSize twiceRadius = IntSize(bufferPadding.width() * 2, bufferPadding.height() * 2);
 
@@ -795,65 +795,65 @@ void ShadowBlur::drawLayerPieces(GraphicsContext* graphicsContext, const FloatRe
     if (direction == OuterShadow) {
         FloatRect shadowInterior(shadowBounds.x() + leftSlice, shadowBounds.y() + topSlice, centerWidth, centerHeight);
         if (!shadowInterior.isEmpty()) {
-            GraphicsContextStateSaver stateSaver(*graphicsContext);
-            graphicsContext->setFillColor(m_color, m_colorSpace);
-            graphicsContext->clearShadow();
-            graphicsContext->fillRect(shadowInterior);
+            GraphicsContextStateSaver stateSaver(graphicsContext);
+            graphicsContext.setFillColor(m_color, m_colorSpace);
+            graphicsContext.clearShadow();
+            graphicsContext.fillRect(shadowInterior);
         }
     }
 
-    GraphicsContextStateSaver stateSaver(*graphicsContext);
-    graphicsContext->setFillColor(m_color, m_colorSpace);
-    graphicsContext->clearShadow();
+    GraphicsContextStateSaver stateSaver(graphicsContext);
+    graphicsContext.setFillColor(m_color, m_colorSpace);
+    graphicsContext.clearShadow();
 
     // Note that drawing the ImageBuffer is faster than creating a Image and drawing that,
     // because ImageBuffer::draw() knows that it doesn't have to copy the image bits.
     FloatRect centerRect(shadowBounds.x() + leftSlice, shadowBounds.y() + topSlice, centerWidth, centerHeight);
-    centerRect = graphicsContext->roundToDevicePixels(centerRect);
+    centerRect = graphicsContext.roundToDevicePixels(centerRect);
     
     // Top side.
     FloatRect tileRect = FloatRect(leftSlice, 0, templateSideLength, topSlice);
     FloatRect destRect = FloatRect(centerRect.x(), centerRect.y() - topSlice, centerRect.width(), topSlice);
-    graphicsContext->drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
 
     // Draw the bottom side.
     tileRect.setY(templateSize.height() - bottomSlice);
     tileRect.setHeight(bottomSlice);
     destRect.setY(centerRect.maxY());
     destRect.setHeight(bottomSlice);
-    graphicsContext->drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
 
     // Left side.
     tileRect = FloatRect(0, topSlice, leftSlice, templateSideLength);
     destRect = FloatRect(centerRect.x() - leftSlice, centerRect.y(), leftSlice, centerRect.height());
-    graphicsContext->drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
 
     // Right side.
     tileRect.setX(templateSize.width() - rightSlice);
     tileRect.setWidth(rightSlice);
     destRect.setX(centerRect.maxX());
     destRect.setWidth(rightSlice);
-    graphicsContext->drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
 
     // Top left corner.
     tileRect = FloatRect(0, 0, leftSlice, topSlice);
     destRect = FloatRect(centerRect.x() - leftSlice, centerRect.y() - topSlice, leftSlice, topSlice);
-    graphicsContext->drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
 
     // Top right corner.
     tileRect = FloatRect(templateSize.width() - rightSlice, 0, rightSlice, topSlice);
     destRect = FloatRect(centerRect.maxX(), centerRect.y() - topSlice, rightSlice, topSlice);
-    graphicsContext->drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
 
     // Bottom right corner.
     tileRect = FloatRect(templateSize.width() - rightSlice, templateSize.height() - bottomSlice, rightSlice, bottomSlice);
     destRect = FloatRect(centerRect.maxX(), centerRect.maxY(), rightSlice, bottomSlice);
-    graphicsContext->drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
 
     // Bottom left corner.
     tileRect = FloatRect(0, templateSize.height() - bottomSlice, leftSlice, bottomSlice);
     destRect = FloatRect(centerRect.x() - leftSlice, centerRect.maxY(), leftSlice, bottomSlice);
-    graphicsContext->drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
 }
 
 
@@ -873,18 +873,18 @@ void ShadowBlur::blurAndColorShadowBuffer(const IntSize& templateSize)
     blurShadowBuffer(templateSize);
 
     // Mask the image with the shadow color.
-    GraphicsContext* shadowContext = m_layerImage->context();
-    GraphicsContextStateSaver stateSaver(*shadowContext);
-    shadowContext->setCompositeOperation(CompositeSourceIn);
-    shadowContext->setFillColor(m_color, m_colorSpace);
-    shadowContext->fillRect(FloatRect(0, 0, templateSize.width(), templateSize.height()));
+    GraphicsContext& shadowContext = m_layerImage->context();
+    GraphicsContextStateSaver stateSaver(shadowContext);
+    shadowContext.setCompositeOperation(CompositeSourceIn);
+    shadowContext.setFillColor(m_color, m_colorSpace);
+    shadowContext.fillRect(FloatRect(0, 0, templateSize.width(), templateSize.height()));
 }
 
-GraphicsContext* ShadowBlur::beginShadowLayer(GraphicsContext *context, const FloatRect& layerArea)
+GraphicsContext* ShadowBlur::beginShadowLayer(GraphicsContextcontext, const FloatRect& layerArea)
 {
     adjustBlurRadius(context);
 
-    IntRect layerRect = calculateLayerBoundingRect(context, layerArea, context->clipBounds());
+    IntRect layerRect = calculateLayerBoundingRect(context, layerArea, context.clipBounds());
 
     if (layerRect.isEmpty())
         return nullptr;
@@ -895,25 +895,25 @@ GraphicsContext* ShadowBlur::beginShadowLayer(GraphicsContext *context, const Fl
     scratchBuffer.setCachedShadowValues(FloatSize(), Color::black, ColorSpaceDeviceRGB, IntRect(), FloatRoundedRect::Radii(), m_layerSize);
     m_layerImage = scratchBuffer.getScratchBuffer(layerRect.size());
 
-    GraphicsContext* shadowContext = m_layerImage->context();
-    shadowContext->save();
+    GraphicsContext& shadowContext = m_layerImage->context();
+    shadowContext.save();
 
     // Add a pixel to avoid later edge aliasing when rotated.
-    shadowContext->clearRect(FloatRect(0, 0, m_layerSize.width() + 1, m_layerSize.height() + 1));
+    shadowContext.clearRect(FloatRect(0, 0, m_layerSize.width() + 1, m_layerSize.height() + 1));
 
-    shadowContext->translate(m_layerContextTranslation);
-    return shadowContext;
+    shadowContext.translate(m_layerContextTranslation);
+    return &shadowContext;
 }
 
-void ShadowBlur::endShadowLayer(GraphicsContext* context)
+void ShadowBlur::endShadowLayer(GraphicsContext& context)
 {
-    m_layerImage->context()->restore();
+    m_layerImage->context().restore();
 
     blurAndColorShadowBuffer(expandedIntSize(m_layerSize));
-    GraphicsContextStateSaver stateSave(*context);
+    GraphicsContextStateSaver stateSave(context);
 
-    context->clearShadow();
-    context->drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, FloatRect(roundedIntPoint(m_layerOrigin), m_layerSize), FloatRect(FloatPoint(), m_layerSize), context->compositeOperation());
+    context.clearShadow();
+    context.drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, FloatRect(roundedIntPoint(m_layerOrigin), m_layerSize), FloatRect(FloatPoint(), m_layerSize), context.compositeOperation());
 
     m_layerImage = 0;
     ScratchBuffer::singleton().scheduleScratchBufferPurge();
index e626b07..2050ab9 100644 (file)
@@ -60,11 +60,11 @@ public:
     void setShadowsIgnoreTransforms(bool ignoreTransforms) { m_shadowsIgnoreTransforms = ignoreTransforms; }
     bool shadowsIgnoreTransforms() const { return m_shadowsIgnoreTransforms; }
 
-    GraphicsContext* beginShadowLayer(GraphicsContext*, const FloatRect& layerArea);
-    void endShadowLayer(GraphicsContext*);
+    GraphicsContext* beginShadowLayer(GraphicsContext&, const FloatRect& layerArea);
+    void endShadowLayer(GraphicsContext&);
 
-    void drawRectShadow(GraphicsContext*, const FloatRoundedRect&);
-    void drawInsetShadow(GraphicsContext*, const FloatRect&, const FloatRoundedRect& holeRect);
+    void drawRectShadow(GraphicsContext&, const FloatRoundedRect&);
+    void drawInsetShadow(GraphicsContext&, const FloatRect&, const FloatRoundedRect& holeRect);
 
     void blurLayerImage(unsigned char*, const IntSize&, int stride);
 
@@ -75,25 +75,25 @@ public:
 private:
     void updateShadowBlurValues();
 
-    void drawShadowBuffer(GraphicsContext*);
+    void drawShadowBuffer(GraphicsContext&);
 
-    void adjustBlurRadius(GraphicsContext*);
+    void adjustBlurRadius(GraphicsContext&);
     
     enum ShadowDirection {
         OuterShadow,
         InnerShadow
     };
     
-    IntRect calculateLayerBoundingRect(GraphicsContext*, const FloatRect& layerArea, const IntRect& clipRect);
+    IntRect calculateLayerBoundingRect(GraphicsContext&, const FloatRect& layerArea, const IntRect& clipRect);
     IntSize templateSize(const IntSize& blurredEdgeSize, const FloatRoundedRect::Radii&) const;
 
-    void drawRectShadowWithoutTiling(GraphicsContext*, const FloatRoundedRect&, const IntRect& layerRect);
-    void drawRectShadowWithTiling(GraphicsContext*, const FloatRoundedRect&, const IntSize& shadowTemplateSize, const IntSize& blurredEdgeSize);
+    void drawRectShadowWithoutTiling(GraphicsContext&, const FloatRoundedRect&, const IntRect& layerRect);
+    void drawRectShadowWithTiling(GraphicsContext&, const FloatRoundedRect&, const IntSize& shadowTemplateSize, const IntSize& blurredEdgeSize);
 
-    void drawInsetShadowWithoutTiling(GraphicsContext*, const FloatRect&, const FloatRoundedRect& holeRect, const IntRect& layerRect);
-    void drawInsetShadowWithTiling(GraphicsContext*, const FloatRect&, const FloatRoundedRect& holeRect, const IntSize& shadowTemplateSize, const IntSize& blurredEdgeSize);
+    void drawInsetShadowWithoutTiling(GraphicsContext&, const FloatRect&, const FloatRoundedRect& holeRect, const IntRect& layerRect);
+    void drawInsetShadowWithTiling(GraphicsContext&, const FloatRect&, const FloatRoundedRect& holeRect, const IntSize& shadowTemplateSize, const IntSize& blurredEdgeSize);
     
-    void drawLayerPieces(GraphicsContext*, const FloatRect& shadowBounds, const FloatRoundedRect::Radii&, const IntSize& roundedRadius, const IntSize& templateSize, ShadowDirection);
+    void drawLayerPieces(GraphicsContext&, const FloatRect& shadowBounds, const FloatRoundedRect::Radii&, const IntSize& roundedRadius, const IntSize& templateSize, ShadowDirection);
     
     void blurShadowBuffer(const IntSize& templateSize);
     void blurAndColorShadowBuffer(const IntSize& templateSize);
index c4773d9..49ee6e8 100644 (file)
@@ -135,7 +135,7 @@ public:
 
 #if ENABLE(SVG_FONTS)
         virtual GlyphData glyphDataForCharacter(const FontCascade&, WidthIterator&, UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength, String& normalizedSpacesStringCache) = 0;
-        virtual void drawSVGGlyphs(GraphicsContext*, const Font*, const GlyphBuffer&, int from, int to, const FloatPoint&) const = 0;
+        virtual void drawSVGGlyphs(GraphicsContext&, const Font&, const GlyphBuffer&, int from, int to, const FloatPoint&) const = 0;
         virtual float floatWidthUsingSVGFont(const FontCascade&, const TextRun&, int& charsConsumed, String& glyphName) const = 0;
         virtual bool applySVGKerning(const Font*, WidthIterator&, GlyphBuffer*, int from) const = 0;
         virtual std::unique_ptr<GlyphToPathTranslator> createGlyphToPathTranslator(const Font&, const TextRun*, const GlyphBuffer&, int from, int numGlyphs, const FloatPoint&) const = 0;
index e190de5..d09418f 100644 (file)
@@ -185,8 +185,8 @@ protected:
     virtual std::unique_ptr<PlatformTimeRanges> buffered() const override;
     virtual bool didLoadingProgress() const override;
     virtual void setSize(const IntSize&) override;
-    virtual void paint(GraphicsContext*, const FloatRect&) override = 0;
-    virtual void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&) override = 0;
+    virtual void paint(GraphicsContext&, const FloatRect&) override = 0;
+    virtual void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&) override = 0;
     virtual void setPreload(MediaPlayer::Preload) override;
     virtual PlatformLayer* platformLayer() const override { return 0; }
     virtual bool supportsAcceleratedRendering() const override = 0;
index f4c66c7..27f6b31 100644 (file)
@@ -832,10 +832,10 @@ MediaPlayerPrivateAVFoundation::AssetStatus MediaPlayerPrivateAVFoundationCF::as
     return MediaPlayerAVAssetStatusLoaded;
 }
 
-void MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext(GraphicsContext* context, const FloatRect& rect)
+void MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext(GraphicsContext& context, const FloatRect& rect)
 {
     ASSERT(isMainThread());
-    if (!metaDataAvailable() || context->paintingDisabled())
+    if (!metaDataAvailable() || context.paintingDisabled())
         return;
 
     if (currentRenderingMode() == MediaRenderingToLayer && !imageGenerator(m_avfWrapper)) {
@@ -847,10 +847,10 @@ void MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext(GraphicsContex
     paint(context, rect);
 }
 
-void MediaPlayerPrivateAVFoundationCF::paint(GraphicsContext* context, const FloatRect& rect)
+void MediaPlayerPrivateAVFoundationCF::paint(GraphicsContext& context, const FloatRect& rect)
 {
     ASSERT(isMainThread());
-    if (!metaDataAvailable() || context->paintingDisabled() || !imageGenerator(m_avfWrapper))
+    if (!metaDataAvailable() || context.paintingDisabled() || !imageGenerator(m_avfWrapper))
         return;
 
     LOG(Media, "MediaPlayerPrivateAVFoundationCF::paint(%p)", this);
@@ -858,13 +858,13 @@ void MediaPlayerPrivateAVFoundationCF::paint(GraphicsContext* context, const Flo
     setDelayCallbacks(true);
     RetainPtr<CGImageRef> image = m_avfWrapper->createImageForTimeInRect(currentMediaTime(), rect);
     if (image) {
-        context->save();
-        context->translate(rect.x(), rect.y() + rect.height());
-        context->scale(FloatSize(1.0f, -1.0f));
-        context->setImageInterpolationQuality(InterpolationLow);
+        context.save();
+        context.translate(rect.x(), rect.y() + rect.height());
+        context.scale(FloatSize(1.0f, -1.0f));
+        context.setImageInterpolationQuality(InterpolationLow);
         FloatRect paintRect(FloatPoint(), rect.size());
-        CGContextDrawImage(context->platformContext(), CGRectMake(0, 0, paintRect.width(), paintRect.height()), image.get());
-        context->restore();
+        CGContextDrawImage(context.platformContext(), CGRectMake(0, 0, paintRect.width(), paintRect.height()), image.get());
+        context.restore();
         image = 0;
     }
     setDelayCallbacks(false);
index 6cc9a55..e3db8d5 100644 (file)
@@ -75,8 +75,8 @@ private:
     virtual MediaTime currentMediaTime() const override;
     virtual void setVolume(float);
     virtual void setClosedCaptionsVisible(bool);
-    virtual void paint(GraphicsContext*, const FloatRect&);
-    virtual void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&);
+    virtual void paint(GraphicsContext&, const FloatRect&);
+    virtual void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&);
     virtual PlatformLayer* platformLayer() const;
     virtual bool supportsAcceleratedRendering() const { return true; }
     virtual MediaTime mediaTimeForTimeValue(const MediaTime&) const;
index 9f581ed..f8baddd 100644 (file)
@@ -152,8 +152,8 @@ private:
     virtual MediaTime currentMediaTime() const override;
     virtual void setVolume(float) override;
     virtual void setClosedCaptionsVisible(bool) override;
-    virtual void paint(GraphicsContext*, const FloatRect&) override;
-    virtual void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&) override;
+    virtual void paint(GraphicsContext&, const FloatRect&) override;
+    virtual void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&) override;
     virtual PlatformLayer* platformLayer() const override;
 #if PLATFORM(IOS)
     virtual void setVideoFullscreenLayer(PlatformLayer*) override;
@@ -224,7 +224,7 @@ private:
     void createImageGenerator();
     void destroyImageGenerator();
     RetainPtr<CGImageRef> createImageForTimeInRect(float, const FloatRect&);
-    void paintWithImageGenerator(GraphicsContext*, const FloatRect&);
+    void paintWithImageGenerator(GraphicsContext&, const FloatRect&);
 
 #if HAVE(AVFOUNDATION_VIDEO_OUTPUT)
     void createVideoOutput();
@@ -232,7 +232,7 @@ private:
     RetainPtr<CVPixelBufferRef> createPixelBuffer();
     void updateLastImage();
     bool videoOutputHasAvailableFrame();
-    void paintWithVideoOutput(GraphicsContext*, const FloatRect&);
+    void paintWithVideoOutput(GraphicsContext&, const FloatRect&);
     virtual PassNativeImagePtr nativeImageForCurrentTime() override;
     void waitForVideoOutputMediaDataWillChange();
 #endif
index 65fb4d2..503c4fb 100644 (file)
@@ -1494,9 +1494,9 @@ long MediaPlayerPrivateAVFoundationObjC::assetErrorCode() const
     return [error code];
 }
 
-void MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext(GraphicsContext* context, const FloatRect& rect)
+void MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext(GraphicsContext& context, const FloatRect& rect)
 {
-    if (!metaDataAvailable() || context->paintingDisabled())
+    if (!metaDataAvailable() || context.paintingDisabled())
         return;
 
     setDelayCallbacks(true);
@@ -1515,9 +1515,9 @@ void MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext(GraphicsCont
     m_videoFrameHasDrawn = true;
 }
 
-void MediaPlayerPrivateAVFoundationObjC::paint(GraphicsContext* context, const FloatRect& rect)
+void MediaPlayerPrivateAVFoundationObjC::paint(GraphicsContext& context, const FloatRect& rect)
 {
-    if (!metaDataAvailable() || context->paintingDisabled())
+    if (!metaDataAvailable() || context.paintingDisabled())
         return;
 
     // We can ignore the request if we are already rendering to a layer.
@@ -1531,18 +1531,18 @@ void MediaPlayerPrivateAVFoundationObjC::paint(GraphicsContext* context, const F
     paintCurrentFrameInContext(context, rect);
 }
 
-void MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator(GraphicsContext* context, const FloatRect& rect)
+void MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator(GraphicsContext& context, const FloatRect& rect)
 {
     LOG(Media, "MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator(%p)", this);
 
     RetainPtr<CGImageRef> image = createImageForTimeInRect(currentTime(), rect);
     if (image) {
-        GraphicsContextStateSaver stateSaver(*context);
-        context->translate(rect.x(), rect.y() + rect.height());
-        context->scale(FloatSize(1.0f, -1.0f));
-        context->setImageInterpolationQuality(InterpolationLow);
+        GraphicsContextStateSaver stateSaver(context);
+        context.translate(rect.x(), rect.y() + rect.height());
+        context.scale(FloatSize(1.0f, -1.0f));
+        context.setImageInterpolationQuality(InterpolationLow);
         IntRect paintRect(IntPoint(0, 0), IntSize(rect.width(), rect.height()));
-        CGContextDrawImage(context->platformContext(), CGRectMake(0, 0, paintRect.width(), paintRect.height()), image.get());
+        CGContextDrawImage(context.platformContext(), CGRectMake(0, 0, paintRect.width(), paintRect.height()), image.get());
         image = 0;
     }
 }
@@ -2323,7 +2323,7 @@ void MediaPlayerPrivateAVFoundationObjC::updateLastImage()
         m_lastImage = createImageFromPixelBuffer(pixelBuffer.get());
 }
 
-void MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput(GraphicsContext* context, const FloatRect& outputRect)
+void MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput(GraphicsContext& context, const FloatRect& outputRect)
 {
 #if (!defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000)
     if (m_videoOutput && !m_lastImage && !videoOutputHasAvailableFrame())
@@ -2341,13 +2341,13 @@ void MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput(GraphicsContext* c
 
     LOG(Media, "MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput(%p)", this);
 
-    GraphicsContextStateSaver stateSaver(*context);
+    GraphicsContextStateSaver stateSaver(context);
     FloatRect imageRect(0, 0, CGImageGetWidth(m_lastImage.get()), CGImageGetHeight(m_lastImage.get()));
     AffineTransform videoTransform = [firstEnabledVideoTrack preferredTransform];
     FloatRect transformedOutputRect = videoTransform.inverse().mapRect(outputRect);
 
-    context->concatCTM(videoTransform);
-    context->drawNativeImage(m_lastImage.get(), imageRect.size(), ColorSpaceDeviceRGB, transformedOutputRect, imageRect);
+    context.concatCTM(videoTransform);
+    context.drawNativeImage(m_lastImage.get(), imageRect.size(), ColorSpaceDeviceRGB, transformedOutputRect, imageRect);
 
     // If we have created an AVAssetImageGenerator in the past due to m_videoOutput not having an available
     // video frame, destroy it now that it is no longer needed.
index a57534f..5371d66 100644 (file)
@@ -147,8 +147,8 @@ private:
 
     virtual void setSize(const IntSize&) override;
 
-    virtual void paint(GraphicsContext*, const FloatRect&) override;
-    virtual void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&) override;
+    virtual void paint(GraphicsContext&, const FloatRect&) override;
+    virtual void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&) override;
 
     virtual bool hasAvailableVideoFrame() const override;
 
index c805b3b..d777828 100644 (file)
@@ -524,12 +524,12 @@ void MediaPlayerPrivateMediaSourceAVFObjC::setSize(const IntSize&)
     // No-op.
 }
 
-void MediaPlayerPrivateMediaSourceAVFObjC::paint(GraphicsContext*, const FloatRect&)
+void MediaPlayerPrivateMediaSourceAVFObjC::paint(GraphicsContext&, const FloatRect&)
 {
     // FIXME(125157): Implement painting.
 }
 
-void MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext(GraphicsContext*, const FloatRect&)
+void MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext(GraphicsContext&, const FloatRect&)
 {
     // FIXME(125157): Implement painting.
 }
index 5ae5b55..5a0012e 100644 (file)
@@ -128,8 +128,8 @@ private:
 
     void setSize(const IntSize&) override;
 
-    void paint(GraphicsContext*, const FloatRect&) override;
-    void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&) override;
+    void paint(GraphicsContext&, const FloatRect&) override;
+    void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&) override;
 
     bool supportsAcceleratedRendering() const override;
 
index c26b335..01ff22c 100644 (file)
@@ -362,12 +362,12 @@ RetainPtr<CGImageRef> MediaPlayerPrivateMediaStreamAVFObjC::createImageFromSampl
     return quartzImage;
 }
 
-void MediaPlayerPrivateMediaStreamAVFObjC::paint(GraphicsContext* context, const FloatRect& rect)
+void MediaPlayerPrivateMediaStreamAVFObjC::paint(GraphicsContext& context, const FloatRect& rect)
 {
     paintCurrentFrameInContext(context, rect);
 }
 
-void MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext(GraphicsContext*, const FloatRect&)
+void MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext(GraphicsContext&, const FloatRect&)
 {
     // FIXME(125157): Implement painting.
 }
index f0d3a7a..f5e3de0 100644 (file)
@@ -64,7 +64,7 @@ BitmapImage::BitmapImage(PassRefPtr<cairo_surface_t> nativeImage, ImageObserver*
     checkForSolidColor();
 }
 
-void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op,
+void BitmapImage::draw(GraphicsContext& context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op,
     BlendMode blendMode, ImageOrientationDescription description)
 {
     if (!dst.width() || !dst.height() || !src.width() || !src.height())
@@ -81,13 +81,13 @@ void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const Flo
         return;
     }
 
-    context->save();
+    context.save();
 
     // Set the compositing operation.
     if (op == CompositeSourceOver && blendMode == BlendModeNormal && !frameHasAlphaAtIndex(m_currentFrame))
-        context->setCompositeOperation(CompositeCopy);
+        context.setCompositeOperation(CompositeCopy);
     else
-        context->setCompositeOperation(op, blendMode);
+        context.setCompositeOperation(op, blendMode);
 
 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
     IntSize scaledSize = cairoSurfaceSize(surface.get());
@@ -104,9 +104,9 @@ void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const Flo
 
     if (frameOrientation != DefaultImageOrientation) {
         // ImageOrientation expects the origin to be at (0, 0).
-        context->translate(dstRect.x(), dstRect.y());
+        context.translate(dstRect.x(), dstRect.y());
         dstRect.setLocation(FloatPoint());
-        context->concatCTM(frameOrientation.transformFromDefault(dstRect.size()));
+        context.concatCTM(frameOrientation.transformFromDefault(dstRect.size()));
         if (frameOrientation.usesWidthAsHeight()) {
             // The destination rectangle will have it's width and height already reversed for the orientation of
             // the image, as it was needed for page layout, so we need to reverse it back here.
@@ -114,9 +114,9 @@ void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const Flo
         }
     }
 
-    context->platformContext()->drawSurfaceToContext(surface.get(), dstRect, adjustedSrcRect, context);
+    context.platformContext()->drawSurfaceToContext(surface.get(), dstRect, adjustedSrcRect, context);
 
-    context->restore();
+    context.restore();
 
     if (imageObserver())
         imageObserver()->didDraw(this);
index aa10c65..fc5032b 100644 (file)
 
 namespace WebCore {
 
-static void drawGlyphsToContext(cairo_t* context, const Font* font, GlyphBufferGlyph* glyphs, int numGlyphs)
+static void drawGlyphsToContext(cairo_t* context, const Font& font, GlyphBufferGlyph* glyphs, int numGlyphs)
 {
     cairo_matrix_t originalTransform;
-    float syntheticBoldOffset = font->syntheticBoldOffset();
+    float syntheticBoldOffset = font.syntheticBoldOffset();
     if (syntheticBoldOffset)
         cairo_get_matrix(context, &originalTransform);
 
-    cairo_set_scaled_font(context, font->platformData().scaledFont());
+    cairo_set_scaled_font(context, font.platformData().scaledFont());
     cairo_show_glyphs(context, glyphs, numGlyphs);
 
     if (syntheticBoldOffset) {
@@ -66,21 +66,21 @@ static void drawGlyphsToContext(cairo_t* context, const Font* font, GlyphBufferG
         cairo_set_matrix(context, &originalTransform);
 }
 
-static void drawGlyphsShadow(GraphicsContext* graphicsContext, const FloatPoint& point, const Font* font, GlyphBufferGlyph* glyphs, int numGlyphs)
+static void drawGlyphsShadow(GraphicsContext& graphicsContext, const FloatPoint& point, const Font& font, GlyphBufferGlyph* glyphs, int numGlyphs)
 {
-    ShadowBlur& shadow = graphicsContext->platformContext()->shadowBlur();
+    ShadowBlur& shadow = graphicsContext.platformContext()->shadowBlur();
 
-    if (!(graphicsContext->textDrawingMode() & TextModeFill) || shadow.type() == ShadowBlur::NoShadow)
+    if (!(graphicsContext.textDrawingMode() & TextModeFill) || shadow.type() == ShadowBlur::NoShadow)
         return;
 
-    if (!graphicsContext->mustUseShadowBlur()) {
+    if (!graphicsContext.mustUseShadowBlur()) {
         // Optimize non-blurry shadows, by just drawing text without the ShadowBlur.
-        cairo_t* context = graphicsContext->platformContext()->cr();
+        cairo_t* context = graphicsContext.platformContext()->cr();
         cairo_save(context);
 
-        FloatSize shadowOffset(graphicsContext->state().shadowOffset);
+        FloatSize shadowOffset(graphicsContext.state().shadowOffset);
         cairo_translate(context, shadowOffset.width(), shadowOffset.height());
-        setSourceRGBAFromColor(context, graphicsContext->state().shadowColor);
+        setSourceRGBAFromColor(context, graphicsContext.state().shadowColor);
         drawGlyphsToContext(context, font, glyphs, numGlyphs);
 
         cairo_restore(context);
@@ -88,7 +88,7 @@ static void drawGlyphsShadow(GraphicsContext* graphicsContext, const FloatPoint&
     }
 
     cairo_text_extents_t extents;
-    cairo_scaled_font_glyph_extents(font->platformData().scaledFont(), glyphs, numGlyphs, &extents);
+    cairo_scaled_font_glyph_extents(font.platformData().scaledFont(), glyphs, numGlyphs, &extents);
     FloatRect fontExtentsRect(point.x() + extents.x_bearing, point.y() + extents.y_bearing, extents.width, extents.height);
 
     if (GraphicsContext* shadowContext = shadow.beginShadowLayer(graphicsContext, fontExtentsRect)) {
@@ -97,10 +97,10 @@ static void drawGlyphsShadow(GraphicsContext* graphicsContext, const FloatPoint&
     }
 }
 
-void FontCascade::drawGlyphs(GraphicsContext* context, const Font* font, const GlyphBuffer& glyphBuffer,
+void FontCascade::drawGlyphs(GraphicsContext& context, const Font& font, const GlyphBuffer& glyphBuffer,
     int from, int numGlyphs, const FloatPoint& point) const
 {
-    if (!font->platformData().size())
+    if (!font.platformData().size())
         return;
 
     GlyphBufferGlyph* glyphs = const_cast<GlyphBufferGlyph*>(glyphBuffer.glyphs(from));
@@ -112,14 +112,14 @@ void FontCascade::drawGlyphs(GraphicsContext* context, const Font* font, const G
         offset += glyphBuffer.advanceAt(from + i).width();
     }
 
-    PlatformContextCairo* platformContext = context->platformContext();
+    PlatformContextCairo* platformContext = context.platformContext();
     drawGlyphsShadow(context, point, font, glyphs, numGlyphs);
 
     cairo_t* cr = platformContext->cr();
     cairo_save(cr);
 
-    if (context->textDrawingMode() & TextModeFill) {
-        platformContext->prepareForFilling(context->state(), PlatformContextCairo::AdjustPatternForGlobalAlpha);
+    if (context.textDrawingMode() & TextModeFill) {
+        platformContext->prepareForFilling(context.state(), PlatformContextCairo::AdjustPatternForGlobalAlpha);
         drawGlyphsToContext(cr, font, glyphs, numGlyphs);
     }
 
@@ -127,12 +127,12 @@ void FontCascade::drawGlyphs(GraphicsContext* context, const Font* font, const G
     // twice the size of the width of the text we will not ask cairo to stroke
     // the text as even one single stroke would cover the full wdth of the text.
     //  See https://bugs.webkit.org/show_bug.cgi?id=33759.
-    if (context->textDrawingMode() & TextModeStroke && context->strokeThickness() < 2 * offset) {
-        platformContext->prepareForStroking(context->state());
-        cairo_set_line_width(cr, context->strokeThickness());
+    if (context.textDrawingMode() & TextModeStroke && context.strokeThickness() < 2 * offset) {
+        platformContext->prepareForStroking(context.state());
+        cairo_set_line_width(cr, context.strokeThickness());
 
         // This may disturb the CTM, but we are going to call cairo_restore soon after.
-        cairo_set_scaled_font(cr, font->platformData().scaledFont());
+        cairo_set_scaled_font(cr, font.platformData().scaledFont());
         cairo_glyph_path(cr, glyphs, numGlyphs);
         cairo_stroke(cr);
     }
index 67840c5..4fec1aa 100644 (file)
@@ -52,7 +52,7 @@ float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, int, i
     return 0;
 }
 
-float FontCascade::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
+float FontCascade::drawComplexText(GraphicsContext& context, const TextRun& run, const FloatPoint& point, int from, int to) const
 {
     // This glyph buffer holds our glyphs + advances + font data for each glyph.
     GlyphBuffer glyphBuffer;
@@ -70,7 +70,7 @@ float FontCascade::drawComplexText(GraphicsContext* context, const TextRun& run,
     return startPoint.x() - startX;
 }
 
-void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const
+void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext& /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const
 {
     notImplemented();
 }
index f8c7c96..2ec0fb9 100644 (file)
@@ -89,14 +89,14 @@ enum PathDrawingStyle {
     FillAndStroke = Fill + Stroke
 };
 
-static inline void drawPathShadow(GraphicsContext* context, PathDrawingStyle drawingStyle)
+static inline void drawPathShadow(GraphicsContext& context, PathDrawingStyle drawingStyle)
 {
-    ShadowBlur& shadow = context->platformContext()->shadowBlur();
+    ShadowBlur& shadow = context.platformContext()->shadowBlur();
     if (shadow.type() == ShadowBlur::NoShadow)
         return;
 
     // Calculate the extents of the rendered solid paths.
-    cairo_t* cairoContext = context->platformContext()->cr();
+    cairo_t* cairoContext = context.platformContext()->cr();
     std::unique_ptr<cairo_path_t, void(*)(cairo_path_t*)> path(cairo_copy_path(cairoContext), [](cairo_path_t* path) {
         cairo_path_destroy(path);
     });
@@ -129,14 +129,14 @@ static inline void drawPathShadow(GraphicsContext* context, PathDrawingStyle dra
     if (drawingStyle & Fill) {
         cairo_save(cairoShadowContext);
         cairo_append_path(cairoShadowContext, path.get());
-        shadowContext->platformContext()->prepareForFilling(context->state(), PlatformContextCairo::NoAdjustment);
+        shadowContext->platformContext()->prepareForFilling(context.state(), PlatformContextCairo::NoAdjustment);
         cairo_fill(cairoShadowContext);
         cairo_restore(cairoShadowContext);
     }
 
     if (drawingStyle & Stroke) {
         cairo_append_path(cairoShadowContext, path.get());
-        shadowContext->platformContext()->prepareForStroking(context->state(), PlatformContextCairo::DoNotPreserveAlpha);
+        shadowContext->platformContext()->prepareForStroking(context.state(), PlatformContextCairo::DoNotPreserveAlpha);
         cairo_stroke(cairoShadowContext);
     }
 
@@ -149,28 +149,28 @@ static inline void drawPathShadow(GraphicsContext* context, PathDrawingStyle dra
     cairo_append_path(cairoContext, path.get());
 }
 
-static inline void fillCurrentCairoPath(GraphicsContext* context)
+static inline void fillCurrentCairoPath(GraphicsContext& context)
 {
-    cairo_t* cr = context->platformContext()->cr();
+    cairo_t* cr = context.platformContext()->cr();
     cairo_save(cr);
 
-    context->platformContext()->prepareForFilling(context->state(), PlatformContextCairo::AdjustPatternForGlobalAlpha);
+    context.platformContext()->prepareForFilling(context.state(), PlatformContextCairo::AdjustPatternForGlobalAlpha);
     cairo_fill(cr);
 
     cairo_restore(cr);
 }
 
-static inline void shadowAndFillCurrentCairoPath(GraphicsContext* context)
+static inline void shadowAndFillCurrentCairoPath(GraphicsContext& context)
 {
     drawPathShadow(context, Fill);
     fillCurrentCairoPath(context);
 }
 
-static inline void shadowAndStrokeCurrentCairoPath(GraphicsContext* context)
+static inline void shadowAndStrokeCurrentCairoPath(GraphicsContext& context)
 {
     drawPathShadow(context, Stroke);
-    context->platformContext()->prepareForStroking(context->state());
-    cairo_stroke(context->platformContext()->cr());
+    context.platformContext()->prepareForStroking(context.state());
+    cairo_stroke(context.platformContext()->cr());
 }
 
 GraphicsContext::GraphicsContext(cairo_t* cr)
@@ -430,7 +430,7 @@ void GraphicsContext::fillPath(const Path& path)
 
     cairo_t* cr = platformContext()->cr();
     setPathOnCairoContext(cr, path.platformPath()->context());
-    shadowAndFillCurrentCairoPath(this);
+    shadowAndFillCurrentCairoPath(*this);
 }
 
 void GraphicsContext::strokePath(const Path& path)
@@ -440,7 +440,7 @@ void GraphicsContext::strokePath(const Path& path)
 
     cairo_t* cr = platformContext()->cr();
     setPathOnCairoContext(cr, path.platformPath()->context());
-    shadowAndStrokeCurrentCairoPath(this);
+    shadowAndStrokeCurrentCairoPath(*this);
 }
 
 void GraphicsContext::fillRect(const FloatRect& rect)
@@ -450,7 +450,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
 
     cairo_t* cr = platformContext()->cr();
     cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
-    shadowAndFillCurrentCairoPath(this);
+    shadowAndFillCurrentCairoPath(*this);
 }
 
 void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace)
@@ -459,7 +459,7 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorS
         return;
 
     if (hasShadow())
-        platformContext()->shadowBlur().drawRectShadow(this, FloatRoundedRect(rect));
+        platformContext()->shadowBlur().drawRectShadow(*this, FloatRoundedRect(rect));
 
     fillRectWithColor(platformContext()->cr(), rect, color);
 }
@@ -872,7 +872,7 @@ void GraphicsContext::strokeRect(const FloatRect& rect, float width)
     cairo_save(cr);
     cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
     cairo_set_line_width(cr, width);
-    shadowAndStrokeCurrentCairoPath(this);
+    shadowAndStrokeCurrentCairoPath(*this);
     cairo_restore(cr);
 }
 
@@ -1043,7 +1043,7 @@ void GraphicsContext::platformFillRoundedRect(const FloatRoundedRect& rect, cons
         return;
 
     if (hasShadow())
-        platformContext()->shadowBlur().drawRectShadow(this, rect);
+        platformContext()->shadowBlur().drawRectShadow(*this, rect);
 
     cairo_t* cr = platformContext()->cr();
     cairo_save(cr);
@@ -1061,7 +1061,7 @@ void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const Float
         return;
 
     if (this->mustUseShadowBlur())
-        platformContext()->shadowBlur().drawInsetShadow(this, rect, roundedHoleRect);
+        platformContext()->shadowBlur().drawInsetShadow(*this, rect, roundedHoleRect);
 
     Path path;
     path.addRect(rect);
@@ -1073,7 +1073,7 @@ void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const Float
     cairo_t* cr = platformContext()->cr();
     cairo_save(cr);
     setPathOnCairoContext(platformContext()->cr(), path.platformPath()->context());
-    fillCurrentCairoPath(this);
+    fillCurrentCairoPath(*this);
     cairo_restore(cr);
 }
 
index 415f9dc..c20f92d 100644 (file)
@@ -141,9 +141,9 @@ ImageBuffer::~ImageBuffer()
 {
 }
 
-GraphicsContext* ImageBuffer::context() const
+GraphicsContext& ImageBuffer::context() const
 {
-    return m_data.m_context.get();
+    return *m_data.m_context;
 }
 
 RefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBehavior) const
@@ -160,20 +160,20 @@ BackingStoreCopy ImageBuffer::fastCopyImageMode()
     return DontCopyBackingStore;
 }
 
-void ImageBuffer::clip(GraphicsContext* context, const FloatRect& maskRect) const
+void ImageBuffer::clip(GraphicsContext& context, const FloatRect& maskRect) const
 {
-    context->platformContext()->pushImageMask(m_data.m_surface.get(), maskRect);
+    context.platformContext()->pushImageMask(m_data.m_surface.get(), maskRect);
 }
 
-void ImageBuffer::draw(GraphicsContext* destinationContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
+void ImageBuffer::draw(GraphicsContext& destinationContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
     CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
 {
-    BackingStoreCopy copyMode = destinationContext == context() ? CopyBackingStore : DontCopyBackingStore;
+    BackingStoreCopy copyMode = &destinationContext == &context() ? CopyBackingStore : DontCopyBackingStore;
     RefPtr<Image> image = copyImage(copyMode);
-    destinationContext->drawImage(image.get(), styleColorSpace, destRect, srcRect, ImagePaintingOptions(op, blendMode, ImageOrientationDescription(), useLowQualityScale));
+    destinationContext.drawImage(image.get(), styleColorSpace, destRect, srcRect, ImagePaintingOptions(op, blendMode, ImageOrientationDescription(), useLowQualityScale));
 }
 
-void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
+void ImageBuffer::drawPattern(GraphicsContext& context, const FloatRect& srcRect, const AffineTransform& patternTransform,
     const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode)
 {
     if (RefPtr<Image> image = copyImage(DontCopyBackingStore))
@@ -395,7 +395,7 @@ String ImageBuffer::toDataURL(const String& mimeType, const double*, CoordinateS
 {
     ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
 
-    cairo_surface_t* image = cairo_get_target(context()->platformContext()->cr());
+    cairo_surface_t* image = cairo_get_target(context().platformContext()->cr());
 
     Vector<char> encodedImage;
     if (!image || !encodeImage(image, mimeType, &encodedImage))
index 7f358a5..25c376b 100644 (file)
 
 namespace WebCore {
 
-void Image::drawPattern(GraphicsContext* context, const FloatRect& tileRect, const AffineTransform& patternTransform,
+void Image::drawPattern(GraphicsContext& context, const FloatRect& tileRect, const AffineTransform& patternTransform,
     const FloatPoint& phase, ColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode)
 {
     RefPtr<cairo_surface_t> surface = nativeImageForCurrentFrame();
     if (!surface) // If it's too early we won't have an image yet.
         return;
 
-    cairo_t* cr = context->platformContext()->cr();
+    cairo_t* cr = context.platformContext()->cr();
     drawPatternToCairoContext(cr, surface.get(), IntSize(size()), tileRect, patternTransform, phase, toCairoOperator(op), destRect);
 
     if (imageObserver())
index 599e59d..a0e7ff8 100644 (file)
@@ -155,7 +155,7 @@ static void drawPatternToCairoContext(cairo_t* cr, cairo_pattern_t* pattern, con
         cairo_fill(cr);
 }
 
-void PlatformContextCairo::drawSurfaceToContext(cairo_surface_t* surface, const FloatRect& destRect, const FloatRect& originalSrcRect, GraphicsContext* context)
+void PlatformContextCairo::drawSurfaceToContext(cairo_surface_t* surface, const FloatRect& destRect, const FloatRect& originalSrcRect, GraphicsContext& context)
 {
     // Avoid invalid cairo matrix with small values.
     if (std::fabs(destRect.width()) < 0.5f || std::fabs(destRect.height()) < 0.5f)
@@ -216,7 +216,7 @@ void PlatformContextCairo::drawSurfaceToContext(cairo_surface_t* surface, const
     cairo_matrix_t matrix = { scaleX, 0, 0, scaleY, leftPadding, topPadding };
     cairo_pattern_set_matrix(pattern.get(), &matrix);
 
-    ShadowBlur& shadow = context->platformContext()->shadowBlur();
+    ShadowBlur& shadow = context.platformContext()->shadowBlur();
     if (shadow.type() != ShadowBlur::NoShadow) {
         if (GraphicsContext* shadowContext = shadow.beginShadowLayer(context, destRect)) {
             drawPatternToCairoContext(shadowContext->platformContext()->cr(), pattern.get(), destRect, 1);
index 9355e13..642a305 100644 (file)
@@ -58,7 +58,7 @@ public:
     float globalAlpha() const;
 
     void pushImageMask(cairo_surface_t*, const FloatRect&);
-    void drawSurfaceToContext(cairo_surface_t*, const FloatRect& destRect, const FloatRect& srcRect, GraphicsContext*);
+    void drawSurfaceToContext(cairo_surface_t*, const FloatRect& destRect, const FloatRect& srcRect, GraphicsContext&);
 
     void setImageInterpolationQuality(InterpolationQuality);
     InterpolationQuality imageInterpolationQuality() const;
index b3f21ef..59a8cdb 100644 (file)
@@ -203,7 +203,7 @@ RetainPtr<CFArrayRef> BitmapImage::getCGImageArray()
     return adoptCF(array);
 }
 
-void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription description)
+void BitmapImage::draw(GraphicsContext& ctxt, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription description)
 {
 #if PLATFORM(IOS)
     startAnimation(DoNotCatchUp);
@@ -213,10 +213,10 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& destRect, const F
 
     RetainPtr<CGImageRef> image;
     // Never use subsampled images for drawing into PDF contexts.
-    if (wkCGContextIsPDFContext(ctxt->platformContext()))
+    if (wkCGContextIsPDFContext(ctxt.platformContext()))
         image = adoptCF(copyUnscaledFrameAtIndex(m_currentFrame));
     else {
-        CGRect transformedDestinationRect = CGRectApplyAffineTransform(destRect, CGContextGetCTM(ctxt->platformContext()));
+        CGRect transformedDestinationRect = CGRectApplyAffineTransform(destRect, CGContextGetCTM(ctxt.platformContext()));
         float subsamplingScale = std::min<float>(1, std::max(transformedDestinationRect.size.width / srcRect.width(), transformedDestinationRect.size.height / srcRect.height()));
 
         image = frameAtIndex(m_currentFrame, subsamplingScale);
@@ -245,7 +245,7 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& destRect, const F
     if (description.respectImageOrientation() == RespectImageOrientation)
         orientation = frameOrientationAtIndex(m_currentFrame);
 
-    ctxt->drawNativeImage(image.get(), imageSize, styleColorSpace, destRect, scaledSrcRect, compositeOp, blendMode, orientation);
+    ctxt.drawNativeImage(image.get(), imageSize, styleColorSpace, destRect, scaledSrcRect, compositeOp, blendMode, orientation);
 
     if (imageObserver())
         imageObserver()->didDraw(this);
index 8935e80..94aaaa9 100644 (file)
@@ -503,14 +503,14 @@ static void releaseImageData(void*, const void* data, size_t)
     fastFree(const_cast<void*>(data));
 }
 
-void GraphicsContext3D::paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, int canvasWidth, int canvasHeight, GraphicsContext* context)
+void GraphicsContext3D::paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, int canvasWidth, int canvasHeight, GraphicsContext& context)
 {
-    if (!imagePixels || imageWidth <= 0 || imageHeight <= 0 || canvasWidth <= 0 || canvasHeight <= 0 || !context)
+    if (!imagePixels || imageWidth <= 0 || imageHeight <= 0 || canvasWidth <= 0 || canvasHeight <= 0)
         return;
     int rowBytes = imageWidth * 4;
     RetainPtr<CGDataProviderRef> dataProvider;
 
-    if (context->isAcceleratedContext()) {
+    if (context.isAcceleratedContext()) {
         unsigned char* copiedPixels;
 
         if (!tryFastCalloc(imageHeight, rowBytes).getValue(copiedPixels))
@@ -532,11 +532,11 @@ void GraphicsContext3D::paintToCanvas(const unsigned char* imagePixels, int imag
     // We want to completely overwrite the previous frame's
     // rendering results.
 
-    GraphicsContextStateSaver stateSaver(*context);
-    context->scale(FloatSize(1, -1));
-    context->translate(0, -imageHeight);
-    context->setImageInterpolationQuality(InterpolationNone);
-    context->drawNativeImage(cgImage.get(), imageSize, ColorSpaceDeviceRGB, canvasRect, FloatRect(FloatPoint(), imageSize), CompositeCopy);
+    GraphicsContextStateSaver stateSaver(context);
+    context.scale(FloatSize(1, -1));
+    context.translate(0, -imageHeight);
+    context.setImageInterpolationQuality(InterpolationNone);
+    context.drawNativeImage(cgImage.get(), imageSize, ColorSpaceDeviceRGB, canvasRect, FloatRect(FloatPoint(), imageSize), CompositeCopy);
 }
 
 } // namespace WebCore
index 080f72f..c526d54 100644 (file)
@@ -712,7 +712,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
         CGContextSetShadowWithColor(platformContext(), CGSizeZero, 0, 0);
 
         ShadowBlur contextShadow(m_state);
-        contextShadow.drawRectShadow(this, FloatRoundedRect(rect));
+        contextShadow.drawRectShadow(*this, FloatRoundedRect(rect));
     }
 
     CGContextFillRect(context, rect);
@@ -740,7 +740,7 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorS
         CGContextSetShadowWithColor(platformContext(), CGSizeZero, 0, 0);
 
         ShadowBlur contextShadow(m_state);
-        contextShadow.drawRectShadow(this, FloatRoundedRect(rect));
+        contextShadow.drawRectShadow(*this, FloatRoundedRect(rect));
     }
 
     CGContextFillRect(context, rect);
@@ -771,7 +771,7 @@ void GraphicsContext::platformFillRoundedRect(const FloatRoundedRect& rect, cons
         CGContextSetShadowWithColor(platformContext(), CGSizeZero, 0, 0);
 
         ShadowBlur contextShadow(m_state);
-        contextShadow.drawRectShadow(this, rect);
+        contextShadow.drawRectShadow(*this, rect);
     }
 
     const FloatRect& r = rect.rect();
@@ -824,7 +824,7 @@ void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const Float
         CGContextSetShadowWithColor(platformContext(), CGSizeZero, 0, 0);
 
         ShadowBlur contextShadow(m_state);
-        contextShadow.drawInsetShadow(this, rect, roundedHoleRect);
+        contextShadow.drawInsetShadow(*this, rect, roundedHoleRect);
     }
 
     fillPath(path);
index bb9deeb..a093014 100644 (file)
@@ -143,9 +143,9 @@ ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpac
         m_data.context = std::make_unique<GraphicsContext>(cgContext.get());
     }
 
-    context()->scale(FloatSize(1, -1));
-    context()->translate(0, -m_data.backingStoreSize.height());
-    context()->applyDeviceScaleFactor(m_resolutionScale);
+    context().scale(FloatSize(1, -1));
+    context().translate(0, -m_data.backingStoreSize.height());
+    context().applyDeviceScaleFactor(m_resolutionScale);
 
     success = true;
 }
@@ -154,18 +154,18 @@ ImageBuffer::~ImageBuffer()
 {
 }
 
-GraphicsContext* ImageBuffer::context() const
+GraphicsContext& ImageBuffer::context() const
 {
 #if USE(IOSURFACE_CANVAS_BACKING_STORE)
     if (m_data.surface)
-        return &m_data.surface->ensureGraphicsContext();
+        return m_data.surface->ensureGraphicsContext();
 #endif
-    return m_data.context.get();
+    return *m_data.context;
 }
 
 void ImageBuffer::flushContext() const
 {
-    CGContextFlush(context()->platformContext());
+    CGContextFlush(context().platformContext());
 }
 
 static RetainPtr<CGImageRef> createCroppedImageIfNecessary(CGImageRef image, const IntSize& bounds)
@@ -210,13 +210,13 @@ BackingStoreCopy ImageBuffer::fastCopyImageMode()
 RetainPtr<CGImageRef> ImageBuffer::copyNativeImage(BackingStoreCopy copyBehavior) const
 {
     RetainPtr<CGImageRef> image;
-    if (!context()->isAcceleratedContext()) {
+    if (!context().isAcceleratedContext()) {
         switch (copyBehavior) {
         case DontCopyBackingStore:
             image = adoptCF(CGImageCreate(m_data.backingStoreSize.width(), m_data.backingStoreSize.height(), 8, 32, m_data.bytesPerRow.unsafeGet(), m_data.colorSpace, m_data.bitmapInfo, m_data.dataProvider.get(), 0, true, kCGRenderingIntentDefault));
             break;
         case CopyBackingStore:
-            image = adoptCF(CGBitmapContextCreateImage(context()->platformContext()));
+            image = adoptCF(CGBitmapContextCreateImage(context().platformContext()));
             break;
         default:
             ASSERT_NOT_REACHED();
@@ -231,29 +231,29 @@ RetainPtr<CGImageRef> ImageBuffer::copyNativeImage(BackingStoreCopy copyBehavior
     return image;
 }
 
-void ImageBuffer::draw(GraphicsContext* destContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
+void ImageBuffer::draw(GraphicsContext& destContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
 {
     UNUSED_PARAM(useLowQualityScale);
-    ColorSpace colorSpace = (destContext == context()) ? ColorSpaceDeviceRGB : styleColorSpace;
+    ColorSpace colorSpace = (&destContext == &context()) ? ColorSpaceDeviceRGB : styleColorSpace;
 
     RetainPtr<CGImageRef> image;
-    if (destContext == context() || destContext->isAcceleratedContext())
+    if (&destContext == &context() || destContext.isAcceleratedContext())
         image = copyNativeImage(CopyBackingStore); // Drawing into our own buffer, need to deep copy.
     else
         image = copyNativeImage(DontCopyBackingStore);
 
     FloatRect adjustedSrcRect = srcRect;
     adjustedSrcRect.scale(m_resolutionScale, m_resolutionScale);
-    destContext->drawNativeImage(image.get(), m_data.backingStoreSize, colorSpace, destRect, adjustedSrcRect, op, blendMode);
+    destContext.drawNativeImage(image.get(), m_data.backingStoreSize, colorSpace, destRect, adjustedSrcRect, op, blendMode);
 }
 
-void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
+void ImageBuffer::drawPattern(GraphicsContext& destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
 {
     FloatRect adjustedSrcRect = srcRect;
     adjustedSrcRect.scale(m_resolutionScale, m_resolutionScale);
 
-    if (!context()->isAcceleratedContext()) {
-        if (destContext == context() || destContext->isAcceleratedContext()) {
+    if (!context().isAcceleratedContext()) {
+        if (&destContext == &context() || destContext.isAcceleratedContext()) {
             if (RefPtr<Image> copy = copyImage(CopyBackingStore)) // Drawing into our own buffer, need to deep copy.
                 copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, styleColorSpace, op, destRect, blendMode);
         } else {
@@ -266,11 +266,11 @@ void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& src
     }
 }
 
-void ImageBuffer::clip(GraphicsContext* contextToClip, const FloatRect& rect) const
+void ImageBuffer::clip(GraphicsContext& contextToClip, const FloatRect& rect) const
 {
     FloatSize backingStoreSizeInUserSpace = scaleSizeToUserSpace(rect.size(), m_data.backingStoreSize, internalSize());
 
-    CGContextRef platformContextToClip = contextToClip->platformContext();
+    CGContextRef platformContextToClip = contextToClip.platformContext();
     // FIXME: This image needs to be grayscale to be used as an alpha mask here.
     RetainPtr<CGImageRef> image = copyNativeImage(DontCopyBackingStore);
     CGContextTranslateCTM(platformContextToClip, rect.x(), rect.y() + backingStoreSizeInUserSpace.height());
@@ -283,31 +283,31 @@ void ImageBuffer::clip(GraphicsContext* contextToClip, const FloatRect& rect) co
 
 PassRefPtr<Uint8ClampedArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem coordinateSystem) const
 {
-    if (context()->isAcceleratedContext())
+    if (context().isAcceleratedContext())
         flushContext();
 
     IntRect srcRect = rect;
     if (coordinateSystem == LogicalCoordinateSystem)
         srcRect.scale(m_resolutionScale);
 
-    return m_data.getData(srcRect, internalSize(), context()->isAcceleratedContext(), true, 1);
+    return m_data.getData(srcRect, internalSize(), context().isAcceleratedContext(), true, 1);
 }
 
 PassRefPtr<Uint8ClampedArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem coordinateSystem) const
 {
-    if (context()->isAcceleratedContext())
+    if (context().isAcceleratedContext())
         flushContext();
 
     IntRect srcRect = rect;
     if (coordinateSystem == LogicalCoordinateSystem)
         srcRect.scale(m_resolutionScale);
 
-    return m_data.getData(srcRect, internalSize(), context()->isAcceleratedContext(), false, 1);
+    return m_data.getData(srcRect, internalSize(), context().isAcceleratedContext(), false, 1);
 }
 
 void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem coordinateSystem)
 {
-    if (!context()->isAcceleratedContext()) {
+    if (!context().isAcceleratedContext()) {
         IntRect scaledSourceRect = sourceRect;
         IntSize scaledSourceSize = sourceSize;
         if (coordinateSystem == LogicalCoordinateSystem) {
@@ -326,10 +326,10 @@ void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, c
     if (!sourceCopy)
         return;
 
-    sourceCopy->m_data.putData(source, sourceSize, sourceRect, IntPoint(-sourceRect.x(), -sourceRect.y()), sourceCopy->internalSize(), sourceCopy->context()->isAcceleratedContext(), multiplied == Unmultiplied, 1);
+    sourceCopy->m_data.putData(source, sourceSize, sourceRect, IntPoint(-sourceRect.x(), -sourceRect.y()), sourceCopy->internalSize(), sourceCopy->context().isAcceleratedContext(), multiplied == Unmultiplied, 1);
 
     // Set up context for using drawImage as a direct bit copy
-    CGContextRef destContext = context()->platformContext();
+    CGContextRef destContext = context().platformContext();
     CGContextSaveGState(destContext);
     if (coordinateSystem == LogicalCoordinateSystem)
         CGContextConcatCTM(destContext, AffineTransform(wkGetUserToBaseCTM(destContext)).inverse());
@@ -430,7 +430,7 @@ String ImageBuffer::toDataURL(const String& mimeType, const double* quality, Coo
 {
     ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
 
-    if (context()->isAcceleratedContext())
+    if (context().isAcceleratedContext())
         flushContext();
 
     RetainPtr<CFStringRef> uti = utiFromMIMEType(mimeType);
index bc2d7d3..20e93ad 100644 (file)
@@ -86,7 +86,7 @@ static void patternReleaseCallback(void* info)
     });
 }
 
-void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const AffineTransform& patternTransform,
+void Image::drawPattern(GraphicsContext& ctxt, const FloatRect& tileRect, const AffineTransform& patternTransform,
     const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
 {
     if (!nativeImageForCurrentFrame())
@@ -95,10 +95,10 @@ void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const
     if (!patternTransform.isInvertible())
         return;
 
-    CGContextRef context = ctxt->platformContext();
-    GraphicsContextStateSaver stateSaver(*ctxt);
+    CGContextRef context = ctxt.platformContext();
+    GraphicsContextStateSaver stateSaver(ctxt);
     CGContextClipToRect(context, destRect);
-    ctxt->setCompositeOperation(op, blendMode);
+    ctxt.setCompositeOperation(op, blendMode);
     CGContextTranslateCTM(context, destRect.x(), destRect.y() + destRect.height());
     CGContextScaleCTM(context, 1, -1);
     
index b19fb08..f4b0485 100644 (file)
@@ -98,7 +98,7 @@ bool PDFDocumentImage::dataChanged(bool allDataReceived)
     return m_document; // Return true if size is available.
 }
 
-bool PDFDocumentImage::cacheParametersMatch(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect) const
+bool PDFDocumentImage::cacheParametersMatch(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect) const
 {
     if (dstRect.size() != m_cachedDestinationSize)
         return false;
@@ -107,7 +107,7 @@ bool PDFDocumentImage::cacheParametersMatch(GraphicsContext* context, const Floa
         return false;
 
     AffineTransform::DecomposedType decomposedTransform;
-    context->getCTM(GraphicsContext::DefinitelyIncludeDeviceScale).decompose(decomposedTransform);
+    context.getCTM(GraphicsContext::DefinitelyIncludeDeviceScale).decompose(decomposedTransform);
 
     AffineTransform::DecomposedType cachedDecomposedTransform;
     m_cachedTransform.decompose(cachedDecomposedTransform);
@@ -117,7 +117,7 @@ bool PDFDocumentImage::cacheParametersMatch(GraphicsContext* context, const Floa
     return true;
 }
 
-static void transformContextForPainting(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect)
+static void transformContextForPainting(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect)
 {
     float hScale = dstRect.width() / srcRect.width();
     float vScale = dstRect.height() / srcRect.height();
@@ -135,12 +135,12 @@ static void transformContextForPainting(GraphicsContext* context, const FloatRec
         }
     }
 
-    context->translate(srcRect.x() * hScale, srcRect.y() * vScale);
-    context->scale(FloatSize(hScale, -vScale));
-    context->translate(0, -srcRect.height());
+    context.translate(srcRect.x() * hScale, srcRect.y() * vScale);
+    context.scale(FloatSize(hScale, -vScale));
+    context.translate(0, -srcRect.height());
 }
 
-void PDFDocumentImage::updateCachedImageIfNeeded(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect)
+void PDFDocumentImage::updateCachedImageIfNeeded(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect)
 {
 #if PLATFORM(IOS)
     // On iOS, some clients use low-quality image interpolation always, which throws off this optimization,
@@ -152,24 +152,20 @@ void PDFDocumentImage::updateCachedImageIfNeeded(GraphicsContext* context, const
 #else
     // If we have an existing image, reuse it if we're doing a low-quality paint, even if cache parameters don't match;
     // we'll rerender when we do the subsequent high-quality paint.
-    InterpolationQuality interpolationQuality = context->imageInterpolationQuality();
+    InterpolationQuality interpolationQuality = context.imageInterpolationQuality();
     bool repaintIfNecessary = interpolationQuality != InterpolationNone && interpolationQuality != InterpolationLow;
 #endif
 
     if (!m_cachedImageBuffer || (!cacheParametersMatch(context, dstRect, srcRect) && repaintIfNecessary)) {
-        m_cachedImageBuffer = context->createCompatibleBuffer(FloatRect(enclosingIntRect(dstRect)).size());
+        m_cachedImageBuffer = context.createCompatibleBuffer(FloatRect(enclosingIntRect(dstRect)).size());
         if (!m_cachedImageBuffer)
             return;
-        GraphicsContext* bufferContext = m_cachedImageBuffer->context();
-        if (!bufferContext) {
-            m_cachedImageBuffer = nullptr;
-            return;
-        }
+        GraphicsContext& bufferContext = m_cachedImageBuffer->context();
 
         transformContextForPainting(bufferContext, dstRect, srcRect);
         drawPDFPage(bufferContext);
 
-        m_cachedTransform = context->getCTM(GraphicsContext::DefinitelyIncludeDeviceScale);
+        m_cachedTransform = context.getCTM(GraphicsContext::DefinitelyIncludeDeviceScale);
         m_cachedDestinationSize = dstRect.size();
         m_cachedSourceRect = srcRect;
 
@@ -182,7 +178,7 @@ void PDFDocumentImage::updateCachedImageIfNeeded(GraphicsContext* context, const
     }
 }
 
-void PDFDocumentImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator op, BlendMode, ImageOrientationDescription)
+void PDFDocumentImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator op, BlendMode, ImageOrientationDescription)
 {
     if (!m_document || !m_hasPage)
         return;
@@ -190,11 +186,11 @@ void PDFDocumentImage::draw(GraphicsContext* context, const FloatRect& dstRect,
     updateCachedImageIfNeeded(context, dstRect, srcRect);
 
     {
-        GraphicsContextStateSaver stateSaver(*context);
-        context->setCompositeOperation(op);
+        GraphicsContextStateSaver stateSaver(context);
+        context.setCompositeOperation(op);
 
         if (m_cachedImageBuffer)
-            context->drawImageBuffer(m_cachedImageBuffer.get(), ColorSpaceDeviceRGB, dstRect);
+            context.drawImageBuffer(m_cachedImageBuffer.get(), ColorSpaceDeviceRGB, dstRect);
         else {
             transformContextForPainting(context, dstRect, srcRect);
             drawPDFPage(context);
@@ -244,26 +240,26 @@ unsigned PDFDocumentImage::pageCount() const
     return CGPDFDocumentGetNumberOfPages(m_document.get());
 }
 
-static void applyRotationForPainting(GraphicsContext* context, FloatSize size, int rotationDegrees)
+static void applyRotationForPainting(GraphicsContext& context, FloatSize size, int rotationDegrees)
 {
     if (rotationDegrees == 90)
-        context->translate(0, size.height());
+        context.translate(0, size.height());
     else if (rotationDegrees == 180)
-        context->translate(size.width(), size.height());
+        context.translate(size.width(), size.height());
     else if (rotationDegrees == 270)
-        context->translate(size.width(), 0);
+        context.translate(size.width(), 0);
 
-    context->rotate(-deg2rad(static_cast<float>(rotationDegrees)));
+    context.rotate(-deg2rad(static_cast<float>(rotationDegrees)));
 }
 
-void PDFDocumentImage::drawPDFPage(GraphicsContext* context)
+void PDFDocumentImage::drawPDFPage(GraphicsContext& context)
 {
     applyRotationForPainting(context, size(), m_rotationDegrees);
 
-    context->translate(-m_cropBox.x(), -m_cropBox.y());
+    context.translate(-m_cropBox.x(), -m_cropBox.y());
 
     // CGPDF pages are indexed from 1.
-    CGContextDrawPDFPage(context->platformContext(), CGPDFDocumentGetPage(m_document.get(), 1));
+    CGContextDrawPDFPage(context.platformContext(), CGPDFDocumentGetPage(m_document.get(), 1));
 }
 
 #endif // !USE(PDFKIT_FOR_PDFDOCUMENTIMAGE)
index 1b29c93..217acd0 100644 (file)
@@ -69,7 +69,7 @@ private:
     virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) override;
     virtual FloatSize size() const override;
 
-    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
 
     // FIXME: Implement this to be less conservative.
     virtual bool currentFrameKnownToBeOpaque() override { return false; }
@@ -77,10 +77,10 @@ private:
     void createPDFDocument();
     void computeBoundsForCurrentPage();
     unsigned pageCount() const;
-    void drawPDFPage(GraphicsContext*);
+    void drawPDFPage(GraphicsContext&);
 
-    void updateCachedImageIfNeeded(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect);
-    bool cacheParametersMatch(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect) const;
+    void updateCachedImageIfNeeded(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect);
+    bool cacheParametersMatch(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect) const;
 
 #if USE(PDFKIT_FOR_PDFDOCUMENTIMAGE)
     RetainPtr<PDFDocument> m_document;
index 2079ff6..44faae1 100644 (file)
@@ -91,13 +91,13 @@ static inline bool shouldUseLetterpressEffect(const GraphicsContext& context)
 #endif
 }
 
-static void showLetterpressedGlyphsWithAdvances(const FloatPoint& point, const Font* font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
+static void showLetterpressedGlyphsWithAdvances(const FloatPoint& point, const Font& font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
 {
 #if ENABLE(LETTERPRESS)
     if (!count)
         return;
 
-    const FontPlatformData& platformData = font->platformData();
+    const FontPlatformData& platformData = font.platformData();
     if (platformData.orientation() == Vertical) {
         // FIXME: Implement support for vertical text. See <rdar://problem/13737298>.
         return;
@@ -158,14 +158,14 @@ private:
 #endif
 };
 
-static void showGlyphsWithAdvances(const FloatPoint& point, const Font* font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
+static void showGlyphsWithAdvances(const FloatPoint& point, const Font& font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
 {
     if (!count)
         return;
 
     CGContextSetTextPosition(context, point.x(), point.y());
 
-    const FontPlatformData& platformData = font->platformData();
+    const FontPlatformData& platformData = font.platformData();
     Vector<CGPoint, 256> positions(count);
     if (platformData.isColorBitmapFont())
         fillVectorWithHorizontalGlyphPositions(positions, context, advances, count);
@@ -181,7 +181,7 @@ static void showGlyphsWithAdvances(const FloatPoint& point, const Font* font, CG
 
         CGAffineTransform transform = CGAffineTransformInvert(CGContextGetTextMatrix(context));
 
-        CGPoint position = FloatPoint(point.x(), point.y() + font->fontMetrics().floatAscent(IdeographicBaseline) - font->fontMetrics().floatAscent());
+        CGPoint position = FloatPoint(point.x(), point.y() + font.fontMetrics().floatAscent(IdeographicBaseline) - font.fontMetrics().floatAscent());
         for (size_t i = 0; i < count; ++i) {
             CGSize translation = CGSizeApplyAffineTransform(translations[i], rotateLeftTransform);
             positions[i] = CGPointApplyAffineTransform(CGPointMake(position.x - translation.width, position.y + translation.height), transform);
@@ -246,35 +246,35 @@ static CGSize dilationSizeForTextColor(const Color& color)
 }
 #endif
 
-void FontCascade::drawGlyphs(GraphicsContext* context, const Font* font, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& anchorPoint) const
+void FontCascade::drawGlyphs(GraphicsContext& context, const Font& font, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& anchorPoint) const
 {
-    const FontPlatformData& platformData = font->platformData();
+    const FontPlatformData& platformData = font.platformData();
     if (!platformData.size())
         return;
 
-    CGContextRef cgContext = context->platformContext();
+    CGContextRef cgContext = context.platformContext();
 
     bool shouldSmoothFonts;
     bool changeFontSmoothing;
-    bool matchAntialiasedAndSmoothedFonts = context->antialiasedFontDilationEnabled();
+    bool matchAntialiasedAndSmoothedFonts = context.antialiasedFontDilationEnabled();
     
     switch (fontDescription().fontSmoothing()) {
     case Antialiased: {
-        context->setShouldAntialias(true);
+        context.setShouldAntialias(true);
         shouldSmoothFonts = false;
         changeFontSmoothing = true;
         matchAntialiasedAndSmoothedFonts = false; // CSS has opted into strictly antialiased fonts.
         break;
     }
     case SubpixelAntialiased: {
-        context->setShouldAntialias(true);
+        context.setShouldAntialias(true);
         shouldSmoothFonts = true;
         changeFontSmoothing = true;
         matchAntialiasedAndSmoothedFonts = true;
         break;
     }
     case NoSmoothing: {
-        context->setShouldAntialias(false);
+        context.setShouldAntialias(false);
         shouldSmoothFonts = false;
         changeFontSmoothing = true;
         matchAntialiasedAndSmoothedFonts = false;
@@ -319,7 +319,7 @@ void FontCascade::drawGlyphs(GraphicsContext* context, const Font* font, const G
     
     CGContextSetFont(cgContext, platformData.cgFont());
 
-    bool useLetterpressEffect = shouldUseLetterpressEffect(*context);
+    bool useLetterpressEffect = shouldUseLetterpressEffect(context);
     FloatPoint point = anchorPoint;
 
     CGAffineTransform matrix = CGAffineTransformIdentity;
@@ -339,9 +339,9 @@ void FontCascade::drawGlyphs(GraphicsContext* context, const Font* font, const G
     CGContextSetTextMatrix(cgContext, matrix);
 
 #if PLATFORM(IOS)
-    CGContextSetShouldSubpixelQuantizeFonts(cgContext, context->shouldSubpixelQuantizeFonts());
+    CGContextSetShouldSubpixelQuantizeFonts(cgContext, context.shouldSubpixelQuantizeFonts());
 #else
-    setCGFontRenderingMode(cgContext, [drawFont renderingMode], context->shouldSubpixelQuantizeFonts());
+    setCGFontRenderingMode(cgContext, [drawFont renderingMode], context.shouldSubpixelQuantizeFonts());
 #endif
     CGContextSetFontSize(cgContext, platformData.size());
 
@@ -350,11 +350,11 @@ void FontCascade::drawGlyphs(GraphicsContext* context, const Font* font, const G
     float shadowBlur;
     Color shadowColor;
     ColorSpace shadowColorSpace;
-    ColorSpace fillColorSpace = context->fillColorSpace();
-    context->getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
+    ColorSpace fillColorSpace = context.fillColorSpace();
+    context.getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
 
-    AffineTransform contextCTM = context->getCTM();
-    float syntheticBoldOffset = font->syntheticBoldOffset();
+    AffineTransform contextCTM = context.getCTM();
+    float syntheticBoldOffset = font.syntheticBoldOffset();
     if (syntheticBoldOffset && !contextCTM.isIdentityOrTranslationOrFlipped()) {
         FloatSize horizontalUnitSizeInDevicePixels = contextCTM.mapSize(FloatSize(1, 0));
         float horizontalUnitLengthInDevicePixels = sqrtf(horizontalUnitSizeInDevicePixels.width() * horizontalUnitSizeInDevicePixels.width() + horizontalUnitSizeInDevicePixels.height() * horizontalUnitSizeInDevicePixels.height());
@@ -362,20 +362,20 @@ void FontCascade::drawGlyphs(GraphicsContext* context, const Font* font, const G
             syntheticBoldOffset /= horizontalUnitLengthInDevicePixels;
     };
 
-    bool hasSimpleShadow = context->textDrawingMode() == TextModeFill && shadowColor.isValid() && !shadowBlur && !platformData.isColorBitmapFont() && (!context->shadowsIgnoreTransforms() || contextCTM.isIdentityOrTranslationOrFlipped()) && !context->isInTransparencyLayer();
+    bool hasSimpleShadow = context.textDrawingMode() == TextModeFill && shadowColor.isValid() && !shadowBlur && !platformData.isColorBitmapFont() && (!context.shadowsIgnoreTransforms() || contextCTM.isIdentityOrTranslationOrFlipped()) && !context.isInTransparencyLayer();
     if (hasSimpleShadow) {
         // Paint simple shadows ourselves instead of relying on CG shadows, to avoid losing subpixel antialiasing.
-        context->clearShadow();
-        Color fillColor = context->fillColor();
+        context.clearShadow();
+        Color fillColor = context.fillColor();
         Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255);
-        context->setFillColor(shadowFillColor, shadowColorSpace);
+        context.setFillColor(shadowFillColor, shadowColorSpace);
         float shadowTextX = point.x() + shadowOffset.width();
         // If shadows are ignoring transforms, then we haven't applied the Y coordinate flip yet, so down is negative.
-        float shadowTextY = point.y() + shadowOffset.height() * (context->shadowsIgnoreTransforms() ? -1 : 1);
+        float shadowTextY = point.y() + shadowOffset.height() * (context.shadowsIgnoreTransforms() ? -1 : 1);
         showGlyphsWithAdvances(FloatPoint(shadowTextX, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
         if (syntheticBoldOffset)
             showGlyphsWithAdvances(FloatPoint(shadowTextX + syntheticBoldOffset, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
-        context->setFillColor(fillColor, fillColorSpace);
+        context.setFillColor(fillColor, fillColorSpace);
     }
 
     if (useLetterpressEffect)
@@ -386,7 +386,7 @@ void FontCascade::drawGlyphs(GraphicsContext* context, const Font* font, const G
         showGlyphsWithAdvances(FloatPoint(point.x() + syntheticBoldOffset, point.y()), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
 
     if (hasSimpleShadow)
-        context->setShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
+        context.setShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
 
 #if !PLATFORM(IOS)
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
@@ -660,7 +660,7 @@ float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, int fr
     return initialAdvance;
 }
 
-float FontCascade::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
+float FontCascade::drawComplexText(GraphicsContext& context, const TextRun& run, const FloatPoint& point, int from, int to) const
 {
     // This glyph buffer holds our glyphs + advances + font data for each glyph.
     GlyphBuffer glyphBuffer;
@@ -678,7 +678,7 @@ float FontCascade::drawComplexText(GraphicsContext* context, const TextRun& run,
     return startPoint.x() - startX;
 }
 
-void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
+void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext& context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
 {
     GlyphBuffer glyphBuffer;
     float initialAdvance = getGlyphsAndAdvancesForComplexText(run, from, to, glyphBuffer, ForTextEmphasis);
index 144c6a5..afcf759 100644 (file)
@@ -56,7 +56,7 @@ String ImageBuffer::toDataURL(const String& mimeType, const double* quality, Coo
 {
     ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
 
-    cairo_surface_t* image = cairo_get_target(context()->platformContext()->cr());
+    cairo_surface_t* image = cairo_get_target(context().platformContext()->cr());
 
     Vector<char> encodedImage;
 
index c14f60f..089f450 100644 (file)
@@ -68,15 +68,15 @@ void FEBlend::platformApplySoftware()
     ImageBuffer* resultImage = createImageBufferResult();
     if (!resultImage)
         return;
-    GraphicsContext* filterContext = resultImage->context();
+    GraphicsContext& filterContext = resultImage->context();
 
     ImageBuffer* imageBuffer = in->asImageBuffer();
     ImageBuffer* imageBuffer2 = in2->asImageBuffer();
     ASSERT(imageBuffer);
     ASSERT(imageBuffer2);
 
-    filterContext->drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
-    filterContext->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), ImagePaintingOptions(CompositeSourceOver, m_mode));
+    filterContext.drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
+    filterContext.drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), ImagePaintingOptions(CompositeSourceOver, m_mode));
 }
 #endif
 
index 363bb38..8766aec 100644 (file)
@@ -147,7 +147,7 @@ void FEColorMatrix::platformApplySoftware()
     if (!resultImage)
         return;
 
-    resultImage->context()->drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
+    resultImage->context().drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
 
     IntRect imageRect(IntPoint(), resultImage->logicalSize());
     RefPtr<Uint8ClampedArray> pixelArray = resultImage->getUnmultipliedImageData(imageRect);
index 36befe7..fcc81e8 100644 (file)
@@ -272,7 +272,7 @@ void FEComposite::platformApplySoftware()
     ImageBuffer* resultImage = createImageBufferResult();
     if (!resultImage)
         return;
-    GraphicsContext* filterContext = resultImage->context();
+    GraphicsContext& filterContext = resultImage->context();
 
     ImageBuffer* imageBuffer = in->asImageBuffer();
     ImageBuffer* imageBuffer2 = in2->asImageBuffer();
@@ -281,8 +281,8 @@ void FEComposite::platformApplySoftware()
 
     switch (m_type) {
     case FECOMPOSITE_OPERATOR_OVER:
-        filterContext->drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
+        filterContext.drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
+        filterContext.drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
         break;
     case FECOMPOSITE_OPERATOR_IN: {
         // Applies only to the intersected region.
@@ -294,21 +294,21 @@ void FEComposite::platformApplySoftware()
         IntRect adjustedDestinationRect = destinationRect - absolutePaintRect().location();
         IntRect sourceRect = destinationRect - in->absolutePaintRect().location();
         IntRect source2Rect = destinationRect - in2->absolutePaintRect().location();
-        filterContext->drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, adjustedDestinationRect, source2Rect);
-        filterContext->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, adjustedDestinationRect, sourceRect, CompositeSourceIn);
+        filterContext.drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, adjustedDestinationRect, source2Rect);
+        filterContext.drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, adjustedDestinationRect, sourceRect, CompositeSourceIn);
         break;
     }
     case FECOMPOSITE_OPERATOR_OUT:
-        filterContext->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
-        filterContext->drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()), IntRect(IntPoint(), imageBuffer2->logicalSize()), CompositeDestinationOut);
+        filterContext.drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
+        filterContext.drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()), IntRect(IntPoint(), imageBuffer2->logicalSize()), CompositeDestinationOut);
         break;
     case FECOMPOSITE_OPERATOR_ATOP:
-        filterContext->drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), CompositeSourceAtop);
+        filterContext.drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
+        filterContext.drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), CompositeSourceAtop);
         break;
     case FECOMPOSITE_OPERATOR_XOR:
-        filterContext->drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), CompositeXOR);
+        filterContext.drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
+        filterContext.drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), CompositeXOR);
         break;
     default:
         break;
index 5e7c904..633ebc6 100644 (file)
@@ -89,11 +89,10 @@ void FEDropShadow::platformApplySoftware()
 
     ImageBuffer* sourceImage = in->asImageBuffer();
     ASSERT(sourceImage);
-    GraphicsContext* resultContext = resultImage->context();
-    ASSERT(resultContext);
-    resultContext->setAlpha(m_shadowOpacity);
-    resultContext->drawImageBuffer(sourceImage, ColorSpaceDeviceRGB, drawingRegionWithOffset);
-    resultContext->setAlpha(1);
+    GraphicsContext& resultContext = resultImage->context();
+    resultContext.setAlpha(m_shadowOpacity);
+    resultContext.drawImageBuffer(sourceImage, ColorSpaceDeviceRGB, drawingRegionWithOffset);
+    resultContext.setAlpha(1);
 
     ShadowBlur contextShadow(blurRadius, offset, m_shadowColor, ColorSpaceDeviceRGB);
 
@@ -105,11 +104,11 @@ void FEDropShadow::platformApplySoftware()
 
     resultImage->putByteArray(Premultiplied, srcPixelArray.get(), shadowArea.size(), shadowArea, IntPoint(), ImageBuffer::BackingStoreCoordinateSystem);
 
-    resultContext->setCompositeOperation(CompositeSourceIn);
-    resultContext->fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), m_shadowColor, ColorSpaceDeviceRGB);
-    resultContext->setCompositeOperation(CompositeDestinationOver);
+    resultContext.setCompositeOperation(CompositeSourceIn);
+    resultContext.fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), m_shadowColor, ColorSpaceDeviceRGB);
+    resultContext.setCompositeOperation(CompositeDestinationOver);
 
-    resultImage->context()->drawImageBuffer(sourceImage, ColorSpaceDeviceRGB, drawingRegion);
+    resultImage->context().drawImageBuffer(sourceImage, ColorSpaceDeviceRGB, drawingRegion);
 }
 
 void FEDropShadow::dump()
index c49860c..7ed429f 100644 (file)
@@ -74,7 +74,7 @@ void FEFlood::platformApplySoftware()
         return;
 
     Color color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity());
-    resultImage->context()->fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), color, ColorSpaceDeviceRGB);
+    resultImage->context().fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), color, ColorSpaceDeviceRGB);
 }
 
 void FEFlood::dump()
index 26b932a..fccdd45 100644 (file)
@@ -47,10 +47,10 @@ void FEMerge::platformApplySoftware()
     if (!resultImage)
         return;
 
-    GraphicsContext* filterContext = resultImage->context();
+    GraphicsContext& filterContext = resultImage->context();
     for (unsigned i = 0; i < size; ++i) {
         FilterEffect* in = inputEffect(i);
-        filterContext->drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
+        filterContext.drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
     }
 }
 
index a44c21d..ffea638 100644 (file)
@@ -87,7 +87,7 @@ void FEOffset::platformApplySoftware()
     FloatRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
     Filter& filter = this->filter();
     drawingRegion.move(filter.applyHorizontalScale(m_dx), filter.applyVerticalScale(m_dy));
-    resultImage->context()->drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegion);
+    resultImage->context().drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, drawingRegion);
 }
 
 void FEOffset::dump()
index 8d3172d..5dc47dd 100644 (file)
@@ -67,9 +67,9 @@ void FETile::platformApplySoftware()
     if (!tileImage)
         return;
 
-    GraphicsContext* tileImageContext = tileImage->context();
-    tileImageContext->translate(-inMaxEffectLocation.x(), -inMaxEffectLocation.y());
-    tileImageContext->drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, in->absolutePaintRect().location());
+    GraphicsContext& tileImageContext = tileImage->context();
+    tileImageContext.translate(-inMaxEffectLocation.x(), -inMaxEffectLocation.y());
+    tileImageContext.drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, in->absolutePaintRect().location());
 
     auto tileImageCopy = tileImage->copyImage(CopyBackingStore);
     if (!tileImageCopy)
@@ -80,9 +80,9 @@ void FETile::platformApplySoftware()
     AffineTransform patternTransform;
     patternTransform.translate(inMaxEffectLocation.x() - maxEffectLocation.x(), inMaxEffectLocation.y() - maxEffectLocation.y());
     pattern.get().setPatternSpaceTransform(patternTransform);
-    GraphicsContext* filterContext = resultImage->context();
-    filterContext->setFillPattern(WTF::move(pattern));
-    filterContext->fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()));
+    GraphicsContext& filterContext = resultImage->context();
+    filterContext.setFillPattern(WTF::move(pattern));
+    filterContext.fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()));
 }
 
 void FETile::dump()
index c98d5b9..ba14712 100644 (file)
@@ -466,7 +466,6 @@ ImageBuffer* FilterEffect::createImageBufferResult()
     if (!m_imageBufferResult)
         return nullptr;
 
-    ASSERT(m_imageBufferResult->context());
     return m_imageBufferResult.get();
 }
 
index 3a7a502..70b1d55 100644 (file)
@@ -51,14 +51,14 @@ void SourceAlpha::platformApplySoftware()
     ImageBuffer* resultImage = createImageBufferResult();
     if (!resultImage)
         return;
-    GraphicsContext* filterContext = resultImage->context();
+    GraphicsContext& filterContext = resultImage->context();
 
     ImageBuffer* imageBuffer = inputEffect(0)->asImageBuffer();
     ASSERT(imageBuffer);
 
     FloatRect imageRect(FloatPoint(), absolutePaintRect().size());
-    filterContext->fillRect(imageRect, Color::black, ColorSpaceDeviceRGB);
-    filterContext->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, IntPoint(), CompositeDestinationIn);
+    filterContext.fillRect(imageRect, Color::black, ColorSpaceDeviceRGB);
+    filterContext.drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, IntPoint(), CompositeDestinationIn);
 }
 
 void SourceAlpha::dump()
index 5c26524..3198b03 100644 (file)
@@ -54,7 +54,7 @@ void SourceGraphic::platformApplySoftware()
     if (!resultImage || !filter.sourceImage())
         return;
 
-    resultImage->context()->drawImageBuffer(filter.sourceImage(), ColorSpaceDeviceRGB, IntPoint());
+    resultImage->context().drawImageBuffer(filter.sourceImage(), ColorSpaceDeviceRGB, IntPoint());
 }
 
 void SourceGraphic::dump()
index 64a23d1..e5f286a 100644 (file)
@@ -502,14 +502,14 @@ void MediaPlayerPrivateGStreamerBase::setSize(const IntSize& size)
     m_size = size;
 }
 
-void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext* context, const FloatRect& rect)
+void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext& context, const FloatRect& rect)
 {
 #if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
     if (client())
         return;
 #endif
 
-    if (context->paintingDisabled())
+    if (context.paintingDisabled())
         return;
 
     if (!m_player->visible())
@@ -523,7 +523,7 @@ void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext* context, const Floa
     if (!gstImage)
         return;
 
-    context->drawImage(reinterpret_cast<Image*>(gstImage->image().get()), ColorSpaceSRGB,
+    context.drawImage(reinterpret_cast<Image*>(gstImage->image().get()), ColorSpaceSRGB,
         rect, gstImage->rect(), CompositeCopy);
 }
 
index 3135733..d2f88e8 100644 (file)
@@ -82,7 +82,7 @@ public:
     void sizeChanged();
 
     void triggerRepaint(GstSample*);
-    void paint(GraphicsContext*, const FloatRect&);
+    void paint(GraphicsContext&, const FloatRect&);
 
     virtual bool hasSingleSecurityOrigin() const { return true; }
     virtual float maxTimeLoaded() const { return 0.0; }
index 02c48d8..ace1905 100644 (file)
@@ -256,7 +256,7 @@ void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& point, float w
 
     // Draw underline.
 #if !PLATFORM(IOS)
-    LocalCurrentGraphicsContext localContext(this);
+    LocalCurrentGraphicsContext localContext(*this);
     NSGraphicsContext *currentContext = [NSGraphicsContext currentContext];
     CGContextRef context = (CGContextRef)[currentContext graphicsPort];
 #else
index fd13abf..f41027f 100644 (file)
@@ -77,7 +77,7 @@ void Icon::paint(GraphicsContext& context, const FloatRect& rect)
     if (context.paintingDisabled())
         return;
 
-    LocalCurrentGraphicsContext localCurrentGC(&context);
+    LocalCurrentGraphicsContext localCurrentGC(context);
 
     [m_nsImage drawInRect:rect fromRect:NSMakeRect(0, 0, [m_nsImage size].width, [m_nsImage size].height) operation:NSCompositeSourceOver fraction:1.0f];
 }
index 01e86f1..196decc 100644 (file)
@@ -127,8 +127,8 @@ private:
     
     virtual bool hasAvailableVideoFrame() const override;
 
-    void paint(GraphicsContext*, const FloatRect&) override;
-    void paintCurrentFrameInContext(GraphicsContext*, const FloatRect&) override;
+    void paint(GraphicsContext&, const FloatRect&) override;
+    void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&) override;
     virtual void prepareForRendering() override;
 
     bool supportsAcceleratedRendering() const override;
index a7a2137..a4c00b7 100644 (file)
@@ -1184,7 +1184,7 @@ void MediaPlayerPrivateQTKit::repaint()
     m_player->repaint();
 }
 
-void MediaPlayerPrivateQTKit::paintCurrentFrameInContext(GraphicsContext* context, const FloatRect& r)
+void MediaPlayerPrivateQTKit::paintCurrentFrameInContext(GraphicsContext& context, const FloatRect& r)
 {
     id qtVideoRenderer = m_qtVideoRenderer.get();
     if (!qtVideoRenderer && currentRenderingMode() == MediaRenderingMovieLayer) {
@@ -1197,9 +1197,9 @@ void MediaPlayerPrivateQTKit::paintCurrentFrameInContext(GraphicsContext* contex
     paint(context, r);
 }
 
-void MediaPlayerPrivateQTKit::paint(GraphicsContext* context, const FloatRect& r)
+void MediaPlayerPrivateQTKit::paint(GraphicsContext& context, const FloatRect& r)
 {
-    if (context->paintingDisabled() || m_hasUnsupportedTracks)
+    if (context.paintingDisabled() || m_hasUnsupportedTracks)
         return;
     id qtVideoRenderer = m_qtVideoRenderer.get();
     if (!qtVideoRenderer)
@@ -1211,12 +1211,12 @@ void MediaPlayerPrivateQTKit::paint(GraphicsContext* context, const FloatRect& r
     FloatSize scaleFactor(1.0f, -1.0f);
     FloatRect paintRect(FloatPoint(), r.size());
 
-    GraphicsContextStateSaver stateSaver(*context);
-    context->translate(r.x(), r.y() + r.height());
-    context->scale(scaleFactor);
-    context->setImageInterpolationQuality(InterpolationLow);
+    GraphicsContextStateSaver stateSaver(context);
+    context.translate(r.x(), r.y() + r.height());
+    context.scale(scaleFactor);
+    context.setImageInterpolationQuality(InterpolationLow);
 
-    newContext = [NSGraphicsContext graphicsContextWithGraphicsPort:context->platformContext() flipped:NO];
+    newContext = [NSGraphicsContext graphicsContextWithGraphicsPort:context.platformContext() flipped:NO];
 
     [NSGraphicsContext saveGraphicsState];
     [NSGraphicsContext setCurrentContext:newContext];