-
bfulgham@apple.com authored
https://bugs.webkit.org/show_bug.cgi?id=120778 Reviewed by Anders Carlsson. Change code to use a GDI-specific smart pointer, rather than OwnPtr. This is a first step to simplifying OwnPtr. It also gets rid of some Windows- specific code in WTF. * WebCore.vcxproj/WebCore.vcxproj: Add the new header file. * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto. * page/win/FrameCGWin.cpp: (WebCore::imageFromRect): Switch to GDIObject. * page/win/FrameCairoWin.cpp: (WebCore::imageFromRect): Switch to GDIObject. * page/win/FrameWin.cpp: (WebCore::imageFromSelection): Switch to GDIObject. (WebCore::Frame::dragImageForSelection): Ditto. (WebCore::Frame::nodeImage): Ditto. * page/win/FrameWin.h: * platform/graphics/ca/win/CACFLayerTreeHost.cpp: (WebCore::getDirtyRects): Switch from OwnPtr to GDIObject. * platform/graphics/win/FontCacheWin.cpp: (WebCore::createGDIFont): Switch to GDIObject. (WebCore::FontCache::createFontPlatformData): Ditto. * platform/graphics/win/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): Switch to GDIObject. * platform/graphics/win/FontCustomPlatformDataCairo.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): Switch to GDIObject. * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::releaseWindowsContext): Switch to GDIObject. * platform/graphics/win/GraphicsContextCairoWin.cpp: (WebCore::GraphicsContext::releaseWindowsContext): Switch to GDIObject. * platform/graphics/win/GraphicsContextWin.cpp: (WebCore::GraphicsContext::getWindowsContext): Switch to GDIObject. * platform/graphics/win/SimpleFontDataWin.cpp: (WebCore::SimpleFontData::platformCreateScaledFontData): Switch to GDIObject. * platform/win/CursorWin.cpp: (WebCore::createSharedCursor): Switch to GDIObject. * platform/win/DragImageCGWin.cpp: (WebCore::scaleDragImage): Switch to GDIObject. (WebCore::createDragImageFromImage): * platform/win/DragImageCairoWin.cpp: (WebCore::scaleDragImage): Switch to GDIObject. (WebCore::createDragImageFromImage): Ditto. * platform/win/DragImageWin.cpp: (WebCore::createDragImageForLink): Switch to GDIObject. * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeImage): Switch to GDIObject. * platform/win/ScrollbarThemeWin.cpp: (WebCore::ScrollbarThemeWin::paintTrackPiece): Switch to GDIObject. * plugins/win/PluginViewWin.cpp: (WebCore::PluginView::updatePluginWidget): Switch to GDIObject. (WebCore::PluginView::snapshot): Ditto. * rendering/RenderThemeWin.cpp: (WebCore::drawControl): Switch to GDIObject. Source/WebKit/win: [Windows] Change from using OwnPtr<GDI Stuff> to new GDIObject template. https://bugs.webkit.org/show_bug.cgi?id=120778 Reviewed by Anders Carlsson. * FullscreenVideoController.cpp: (FullscreenVideoController::createHUDWindow): Switch to GDIObject. (FullscreenVideoController::draw): Ditto. * FullscreenVideoController.h: * WebCoreSupport/EmbeddedWidget.cpp: (EmbeddedWidget::frameRectsChanged): Switch to GDIObject. * WebNodeHighlight.cpp: (WebNodeHighlight::update): Switch to GDIObject. * WebView.cpp: (WebView::scrollBackingStore): Switch to GDIObject. (WebView::updateBackingStore): Ditto. (WebView::performLayeredWindowUpdate): Ditto. (WebView::paint): Ditto. (WebView::paintIntoBackingStore): Ditto. (WebView::paintIntoWindow): Ditto. (WebView::generateSelectionImage): Ditto. Source/WTF: [Windows] Change from using OwnPtr<GDI Stuff> to new GDIObject template. https://bugs.webkit.org/show_bug.cgi?id=120778 Reviewed by Anders Carlsson. * WTF.vcxproj/WTF.vcxproj: Add new GDIObject header file. * WTF.vcxproj/WTF.vcxproj.filters: Ditto. * WTF.vcxproj/copy-files.cmd: Copy new header file. * wtf/OwnPtrCommon.h: Remove some GDI specializations. * wtf/win/GDIObject.h: Added. (WTF::GDIObject::GDIObject): (WTF::GDIObject::~GDIObject): (WTF::GDIObject::get): (WTF::GDIObject::operator!): (WTF::GDIObject::operator UnspecifiedBoolType): (WTF::GDIObject::operator=): (WTF::GDIObject::swap): (WTF::::clear): (WTF::::leak): (WTF::::GDIObject): (WTF::=): (WTF::adoptGDIObject): (WTF::swap): (WTF::T): (WTF::HDC): * wtf/win/OwnPtrWin.cpp: (WTF::deleteOwnedPtr): Remove some GDI specializations. Tools: [Windows] Change from using OwnPtr<GDI Stuff> to new GDIObject. https://bugs.webkit.org/show_bug.cgi?id=120778 Reviewed by Anders Carlsson. * DumpRenderTree/win/PixelDumpSupportWin.cpp: (createBitmapContextFromWebView): Use GDIObject. * Scripts/webkitpy/style/checkers/cpp.py: (check_for_leaky_patterns): Update for GDIObject instead of adoptPtr and OwnPtr. * Scripts/webkitpy/style/checkers/cpp_unittest.py: (LeakyPatternTest.test_create_dc): Update for GDIObject instead of adoptPtr/OwnPtr. (LeakyPatternTest.test_create_compatible_dc): Ditto. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
283b393b