Title: [206830] trunk/Source/WebCore
Revision
206830
Author
[email protected]
Date
2016-10-05 14:16:27 -0700 (Wed, 05 Oct 2016)

Log Message

[Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when building for D2D
https://bugs.webkit.org/show_bug.cgi?id=162977

Reviewed by Alex Christensen.

Currently the Direct2D implementation does not support some of the accelerated compositing
features that require CoreAnimation. During this bring-up, we want to disable these routines
so that we can build and run in (mostly) unaccelerated drawing.

This patch mostly consists of adding "#if USE(CG)" and "#if USE(CA)" to files that are
specific to those implementations.

This change should have no impact on non-Direct2D ports.

No change in behavior for active ports.

* config.h: Turn of CG when building in Direct2D.
* css/CSSFontFaceSource.cpp:
* loader/cache/CachedFont.cpp:
* loader/cache/CachedSVGFont.cpp:
* page/CaptionUserPreferencesMediaAF.cpp:
* page/win/FrameCGWin.cpp:
* page/win/FrameDirect2D.cpp: Added.
* platform/graphics/Font.cpp:
* platform/graphics/FontCache.cpp:
* platform/graphics/FontPlatformData.cpp:
* platform/graphics/GraphicsContext.h:
* platform/graphics/Image.cpp:
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
* platform/graphics/ca/GraphicsLayerCA.cpp:
* platform/graphics/ca/PlatformCALayer.cpp:
* platform/graphics/ca/TileController.cpp:
* platform/graphics/ca/TileGrid.cpp:
* platform/graphics/ca/TileGrid.h:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
* platform/graphics/ca/win/LayerChangesFlusher.cpp:
* platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
* platform/graphics/ca/win/PlatformCAAnimationWin.h:
* platform/graphics/ca/win/PlatformCAFiltersWin.cpp:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
* platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
* platform/graphics/cg/GradientCG.cpp:
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cg/ImageBufferCG.cpp:
* platform/graphics/cg/ImageBufferDataCG.cpp:
* platform/graphics/cg/PDFDocumentImage.cpp:
* platform/graphics/cg/PatternCG.cpp:
* platform/graphics/cg/SubimageCacheWithTimer.cpp:
* platform/graphics/win/FontCGWin.cpp:
* platform/graphics/win/FontPlatformDataCGWin.cpp:
* platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
* platform/graphics/win/GradientDirect2D.cpp:
* platform/graphics/win/PathDirect2D.cpp: Fix a few build problems I didn't notice
while building without Direct2D active.
* platform/graphics/win/SimpleFontDataCGWin.cpp:
* platform/graphics/win/SimpleFontDataWin.cpp:
* platform/win/DragImageCGWin.cpp:
* platform/win/DragImageDirect2D.cpp: Added.
* rendering/RenderMediaControls.cpp:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206829 => 206830)


--- trunk/Source/WebCore/ChangeLog	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/ChangeLog	2016-10-05 21:16:27 UTC (rev 206830)
@@ -1,3 +1,69 @@
+2016-10-05  Brent Fulgham  <[email protected]>
+
+        [Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when building for D2D
+        https://bugs.webkit.org/show_bug.cgi?id=162977
+
+        Reviewed by Alex Christensen.
+
+        Currently the Direct2D implementation does not support some of the accelerated compositing
+        features that require CoreAnimation. During this bring-up, we want to disable these routines
+        so that we can build and run in (mostly) unaccelerated drawing.
+
+        This patch mostly consists of adding "#if USE(CG)" and "#if USE(CA)" to files that are
+        specific to those implementations.
+
+        This change should have no impact on non-Direct2D ports.
+
+        No change in behavior for active ports.
+
+        * config.h: Turn of CG when building in Direct2D.
+        * css/CSSFontFaceSource.cpp:
+        * loader/cache/CachedFont.cpp:
+        * loader/cache/CachedSVGFont.cpp:
+        * page/CaptionUserPreferencesMediaAF.cpp:
+        * page/win/FrameCGWin.cpp:
+        * page/win/FrameDirect2D.cpp: Added.
+        * platform/graphics/Font.cpp:
+        * platform/graphics/FontCache.cpp:
+        * platform/graphics/FontPlatformData.cpp:
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/Image.cpp:
+        * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        * platform/graphics/ca/PlatformCALayer.cpp:
+        * platform/graphics/ca/TileController.cpp:
+        * platform/graphics/ca/TileGrid.cpp:
+        * platform/graphics/ca/TileGrid.h:
+        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+        * platform/graphics/ca/win/LayerChangesFlusher.cpp:
+        * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
+        * platform/graphics/ca/win/PlatformCAAnimationWin.h:
+        * platform/graphics/ca/win/PlatformCAFiltersWin.cpp:
+        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
+        * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
+        * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
+        * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
+        * platform/graphics/cg/GradientCG.cpp:
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        * platform/graphics/cg/ImageBufferDataCG.cpp:
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        * platform/graphics/cg/PatternCG.cpp:
+        * platform/graphics/cg/SubimageCacheWithTimer.cpp:
+        * platform/graphics/win/FontCGWin.cpp:
+        * platform/graphics/win/FontPlatformDataCGWin.cpp:
+        * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
+        * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
+        * platform/graphics/win/GradientDirect2D.cpp:
+        * platform/graphics/win/PathDirect2D.cpp: Fix a few build problems I didn't notice
+        while building without Direct2D active.
+        * platform/graphics/win/SimpleFontDataCGWin.cpp:
+        * platform/graphics/win/SimpleFontDataWin.cpp:
+        * platform/win/DragImageCGWin.cpp:
+        * platform/win/DragImageDirect2D.cpp: Added.
+        * rendering/RenderMediaControls.cpp:
+
 2016-10-05  Chris Dumez  <[email protected]>
 
         KeyboardEvent.getModifierState() should support "CapsLock" modifier

Modified: trunk/Source/WebCore/config.h (206829 => 206830)


--- trunk/Source/WebCore/config.h	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/config.h	2016-10-05 21:16:27 UTC (rev 206830)
@@ -94,6 +94,8 @@
 #ifndef _WINSOCKAPI_
 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
 #endif
+#elif USE(DIRECT2D)
+#undef USE_CG
 #elif !USE(WINGDI)
 #define USE_CG 1
 #undef USE_CAIRO

Modified: trunk/Source/WebCore/css/CSSFontFaceSource.cpp (206829 => 206830)


--- trunk/Source/WebCore/css/CSSFontFaceSource.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -47,6 +47,10 @@
 #include "SVGURIReference.h"
 #endif
 
+#if USE(DIRECT2D)
+#include <dwrite.h>
+#endif
+
 namespace WebCore {
 
 inline void CSSFontFaceSource::setStatus(Status newStatus)

Modified: trunk/Source/WebCore/loader/cache/CachedFont.cpp (206829 => 206830)


--- trunk/Source/WebCore/loader/cache/CachedFont.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/loader/cache/CachedFont.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -40,6 +40,10 @@
 #include "WOFFFileFormat.h"
 #include <wtf/Vector.h>
 
+#if USE(DIRECT2D)
+#include <dwrite.h>
+#endif
+
 namespace WebCore {
 
 CachedFont::CachedFont(CachedResourceRequest&& request, SessionID sessionID, Type type)

Modified: trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp (206829 => 206830)


--- trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -40,6 +40,10 @@
 #include "TypedElementDescendantIterator.h"
 #include "SVGToOTFFontConversion.h"
 
+#if USE(DIRECT2D)
+#include <dwrite.h>
+#endif
+
 namespace WebCore {
 
 CachedSVGFont::CachedSVGFont(CachedResourceRequest&& request, SessionID sessionID)

Modified: trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp (206829 => 206830)


--- trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -27,6 +27,8 @@
 
 #if ENABLE(VIDEO_TRACK)
 
+#if !USE(DIRECT2D)
+
 #include "CaptionUserPreferencesMediaAF.h"
 
 #include "AudioTrackList.h"
@@ -965,4 +967,6 @@
     
 }
 
+#endif
+
 #endif // ENABLE(VIDEO_TRACK)

Modified: trunk/Source/WebCore/page/win/FrameCGWin.cpp (206829 => 206830)


--- trunk/Source/WebCore/page/win/FrameCGWin.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/page/win/FrameCGWin.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "FrameWin.h"
 
+#if USE(CG)
+
 #include "BitmapInfo.h"
 #include "Frame.h"
 #include "FrameSelection.h"
@@ -83,3 +85,5 @@
 }
 
 } // namespace WebCore
+
+#endif

Added: trunk/Source/WebCore/page/win/FrameWinDirect2D.cpp (0 => 206830)


--- trunk/Source/WebCore/page/win/FrameWinDirect2D.cpp	                        (rev 0)
+++ trunk/Source/WebCore/page/win/FrameWinDirect2D.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "FrameWin.h"
+
+#if USE(DIRECT2D)
+
+#include "BitmapInfo.h"
+#include "Frame.h"
+#include "FrameSelection.h"
+#include "FrameView.h"
+#include "GraphicsContext.h"
+#include "RenderObject.h"
+#include "Settings.h"
+#include <d2d1.h>
+#include <windows.h>
+#include <wtf/win/GDIObject.h>
+
+namespace WebCore {
+
+GDIObject<HBITMAP> imageFromRect(const Frame* frame, IntRect& ir)
+{
+    if (!frame)
+        return nullptr;
+
+    PaintBehavior oldPaintBehavior = frame->view()->paintBehavior();
+    frame->view()->setPaintBehavior(oldPaintBehavior | PaintBehaviorFlattenCompositingLayers);
+
+    void* bits = nullptr;
+    auto hdc = adoptGDIObject(::CreateCompatibleDC(0));
+    int w = ir.width();
+    int h = ir.height();
+    BitmapInfo bmp = BitmapInfo::create(IntSize(w, h));
+
+    GDIObject<HBITMAP> hbmp = adoptGDIObject(::CreateDIBSection(0, &bmp, DIB_RGB_COLORS, static_cast<void**>(&bits), 0, 0));
+    if (!hbmp)
+        return hbmp;
+
+    HGDIOBJ hbmpOld = SelectObject(hdc.get(), hbmp.get());
+
+    notImplemented();
+
+    SelectObject(hdc.get(), hbmpOld);
+
+    frame->view()->setPaintBehavior(oldPaintBehavior);
+
+    return hbmp;
+}
+
+} // namespace WebCore
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/Font.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/Font.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/Font.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -44,6 +44,10 @@
 #include "OpenTypeVerticalData.h"
 #endif
 
+#if USE(DIRECT2D)
+#include <dwrite.h>
+#endif
+
 namespace WebCore {
 
 unsigned GlyphPage::s_count = 0;

Modified: trunk/Source/WebCore/platform/graphics/FontCache.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/FontCache.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/FontCache.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -45,6 +45,10 @@
 #include "OpenTypeVerticalData.h"
 #endif
 
+#if USE(DIRECT2D)
+#include <dwrite.h>
+#endif
+
 #if PLATFORM(IOS)
 #include <wtf/Noncopyable.h>
 

Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -31,6 +31,10 @@
 #include <CoreGraphics/CGFont.h>
 #endif
 
+#if USE(DIRECT2D)
+#include <dwrite.h>
+#endif
+
 namespace WebCore {
 
 FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType)

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2016-10-05 21:16:27 UTC (rev 206830)
@@ -579,7 +579,6 @@
 
 #if USE(DIRECT2D)
     void platformInit(HDC, ID2D1RenderTarget**, RECT, bool hasAlpha = false);
-    void platformInit(ID2D1RenderTarget*);
     void drawWithoutShadow(const FloatRect& boundingRect, const std::function<void(ID2D1RenderTarget*)>&);
     void drawWithShadow(const FloatRect& boundingRect, const std::function<void(ID2D1RenderTarget*)>&);
 #endif

Modified: trunk/Source/WebCore/platform/graphics/Image.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/Image.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/Image.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -92,6 +92,9 @@
 
 void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, const FloatSize& spacing, CompositeOperator op, BlendMode blendMode)
 {
+#if USE(DIRECT2D)
+    notImplemented();
+#else
     Color color = singlePixelSolidColor();
     if (color.isValid()) {
         fillWithSolidColor(ctxt, destRect, color, op);
@@ -199,6 +202,7 @@
 #else
     startAnimation();
 #endif
+#endif
 }
 
 // FIXME: Merge with the other drawTiled eventually, since we need a combination of both for some things.

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -54,7 +54,14 @@
 RefPtr<Uint8Array> CDMSessionAVFoundationCF::generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode)
 {
     UNUSED_PARAM(mimeType);
-
+#if USE(DIRECT2D)
+    UNUSED_PARAM(initData);
+    UNUSED_PARAM(destinationURL);
+    UNUSED_PARAM(errorCode);
+    UNUSED_PARAM(systemCode);
+    notImplemented();
+    return nullptr;
+#else
     String keyURI;
     String keyID;
     RefPtr<Uint8Array> certificate;
@@ -101,6 +108,7 @@
 
     RefPtr<ArrayBuffer> keyRequestBuffer = ArrayBuffer::create(CFDataGetBytePtr(keyRequest.get()), CFDataGetLength(keyRequest.get()));
     return Uint8Array::create(keyRequestBuffer, 0, keyRequestBuffer->byteLength());
+#endif
 }
 
 void CDMSessionAVFoundationCF::releaseKeys()

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -863,7 +863,11 @@
         context.scale(FloatSize(1.0f, -1.0f));
         context.setImageInterpolationQuality(InterpolationLow);
         FloatRect paintRect(FloatPoint(), rect.size());
+#if USE(DIRECT2D)
+        notImplemented();
+#else
         CGContextDrawImage(context.platformContext(), CGRectMake(0, 0, paintRect.width(), paintRect.height()), image.get());
+#endif
         context.restore();
         image = 0;
     }

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -27,6 +27,8 @@
 
 #include "GraphicsLayerCA.h"
 
+#if USE(CA)
+
 #include "Animation.h"
 #include "DisplayListRecorder.h"
 #include "DisplayListReplayer.h"
@@ -3993,3 +3995,5 @@
 }
 
 } // namespace WebCore
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "PlatformCALayer.h"
 
+#if USE(CA)
+
 #include <CoreFoundation/CoreFoundation.h>
 #include <CoreText/CoreText.h>
 #include "GraphicsContextCG.h"
@@ -38,8 +40,6 @@
 #include "CoreTextSPIWin.h"
 #endif
 
-#if USE(CA)
-
 namespace WebCore {
 
 static GraphicsLayer::PlatformLayerID generateLayerID()

Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "TileController.h"
 
+#if USE(CG)
+
 #include "IntRect.h"
 #include "Logging.h"
 #include "PlatformCALayer.h"
@@ -735,3 +737,5 @@
 #endif
 
 } // namespace WebCore
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -24,6 +24,9 @@
  */
 
 #include "config.h"
+
+#if USE(CG)
+
 #include "TileGrid.h"
 
 #include "GraphicsContext.h"
@@ -762,3 +765,5 @@
 #endif
 
 } // namespace WebCore
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.h (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.h	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.h	2016-10-05 21:16:27 UTC (rev 206830)
@@ -51,7 +51,9 @@
     TileGrid(TileController&);
     ~TileGrid();
 
+#if USE(CA)
     PlatformCALayer& containerLayer() { return m_containerLayer; }
+#endif
 
     void setIsZoomedOutTileGrid(bool);
 
@@ -83,7 +85,9 @@
     double retainedTileBackingStoreMemory() const;
     unsigned blankPixelCount() const;
 
+#if USE(CG)
     void drawTileMapContents(CGContextRef, CGRect layerBounds) const;
+#endif
 
 #if PLATFORM(IOS)
     unsigned numberOfUnparentedTiles() const { return m_cohortList.size(); }
@@ -150,7 +154,9 @@
     bool isUsingDisplayListDrawing(PlatformCALayer*) const override;
 
     TileController& m_controller;
+#if USE(CA)
     Ref<PlatformCALayer> m_containerLayer;
+#endif
 
     typedef HashMap<TileIndex, TileInfo> TileMap;
     TileMap m_tiles;

Modified: trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "CACFLayerTreeHost.h"
 
+#if USE(CA)
+
 #include "CACFLayerTreeHostClient.h"
 #include "DebugPageOverlays.h"
 #include "DefWndProcWindowClass.h"
@@ -374,3 +376,5 @@
 }
 
 }
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/ca/win/LayerChangesFlusher.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/win/LayerChangesFlusher.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/win/LayerChangesFlusher.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "LayerChangesFlusher.h"
 
+#if USE(CA)
+
 #include "AbstractCACFLayerTreeHost.h"
 #include "StructuredExceptionHandlerSuppressor.h"
 #include <wtf/StdLibExtras.h>
@@ -129,3 +131,5 @@
 }
 
 } // namespace WebCore
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -25,7 +25,7 @@
 
 #include "config.h"
 
-#if PLATFORM(WIN)
+#if PLATFORM(WIN) && USE(CA)
 #include "PlatformCAAnimationWin.h"
 
 #include "FloatConversion.h"

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.h (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.h	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.h	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,7 +26,7 @@
 #ifndef PlatformCAAnimationWin_h
 #define PlatformCAAnimationWin_h
 
-#if PLATFORM(WIN)
+#if PLATFORM(WIN) && USE(CA)
 
 #include "PlatformCAAnimation.h"
 #include <wtf/RetainPtr.h>

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCAFiltersWin.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCAFiltersWin.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCAFiltersWin.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "PlatformCAFilters.h"
 
+#if USE(CA)
+
 using namespace WebCore;
 
 void PlatformCAFilters::setFiltersOnLayer(PlatformLayer* layer, const FilterOperations& filters)
@@ -44,3 +46,5 @@
     // Hardware filter animation not implemented on Windows.
     return "";
 }
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -27,6 +27,8 @@
 
 #include "PlatformCALayerWin.h"
 
+#if USE(CA)
+
 #include "AbstractCACFLayerTreeHost.h"
 #include "FontCascade.h"
 #include "GDIUtilities.h"
@@ -953,3 +955,5 @@
     cg.setFillColor(Color::black);
     cg.drawText(font, TextRun(text), IntPoint(x, y));
 }
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -27,6 +27,8 @@
 
 #include "PlatformCALayerWinInternal.h"
 
+#if USE(CA)
+
 #include "FontCascade.h"
 #include "GraphicsContext.h"
 #include "PlatformCALayer.h"
@@ -323,3 +325,5 @@
 
     CACFLayerSetBorderColor(owner()->platformLayer(), color.get());
 }
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "WKCACFViewLayerTreeHost.h"
 
+#if USE(CA)
+
 #include "GDIUtilities.h"
 #include "PlatformCALayer.h"
 #include "SoftLinking.h"
@@ -197,3 +199,5 @@
 #endif
 
 } // namespace WebCore
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/ca/win/WebTiledBackingLayerWin.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/ca/win/WebTiledBackingLayerWin.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/ca/win/WebTiledBackingLayerWin.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "WebTiledBackingLayerWin.h"
 
+#if USE(CA)
+
 #include "GraphicsContext.h"
 #include "PlatformCALayer.h"
 #include "TileController.h"
@@ -180,3 +182,5 @@
     ASSERT(m_tileController);
     m_tileController = nullptr;
 }
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/cg/GradientCG.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/cg/GradientCG.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/cg/GradientCG.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -27,6 +27,8 @@
 #include "config.h"
 #include "Gradient.h"
 
+#if USE(CG)
+
 #include "GraphicsContextCG.h"
 #include <CoreGraphics/CoreGraphics.h>
 #include <wtf/RetainPtr.h>
@@ -105,3 +107,5 @@
 }
 
 } //namespace
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -27,6 +27,8 @@
 #include "config.h"
 #include "GraphicsContextCG.h"
 
+#if USE(CG)
+
 #include "AffineTransform.h"
 #include "CoreGraphicsSPI.h"
 #include "DisplayListRecorder.h"
@@ -1048,7 +1050,6 @@
         return IntRect(-2048, -2048, 4096, 4096); // FIXME: display lists.
     }
 
-
     return enclosingIntRect(CGContextGetClipBoundingBox(platformContext()));
 }
 
@@ -1905,3 +1906,5 @@
 }
 
 }
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -28,6 +28,8 @@
 #include "config.h"
 #include "ImageBuffer.h"
 
+#if USE(CG)
+
 #include "BitmapImage.h"
 #include "GraphicsContext.h"
 #include "GraphicsContextCG.h"
@@ -591,3 +593,5 @@
 }
 
 } // namespace WebCore
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "ImageBufferData.h"
 
+#if USE(CG)
+
 #include "GraphicsContext.h"
 #include "IntRect.h"
 #include <CoreGraphics/CoreGraphics.h>
@@ -544,3 +546,5 @@
 }
 
 } // namespace WebCore
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -38,6 +38,7 @@
 #include "ImageObserver.h"
 #include "IntRect.h"
 #include "Length.h"
+#include "NotImplemented.h"
 #include "SharedBuffer.h"
 #include "TextStream.h"
 #include <CoreGraphics/CGContext.h>
@@ -344,8 +345,12 @@
 
     context.translate(-m_cropBox.x(), -m_cropBox.y());
 
+#if USE(DIRECT2D)
+    notImplemented();
+#else
     // CGPDF pages are indexed from 1.
     CGContextDrawPDFPage(context.platformContext(), CGPDFDocumentGetPage(m_document.get(), 1));
+#endif
 }
 
 #endif // !USE(PDFKIT_FOR_PDFDOCUMENTIMAGE)

Modified: trunk/Source/WebCore/platform/graphics/cg/PatternCG.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/cg/PatternCG.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/cg/PatternCG.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -27,6 +27,8 @@
 #include "config.h"
 #include "Pattern.h"
 
+#if USE(CG)
+
 #include "AffineTransform.h"
 #include "GraphicsContext.h"
 
@@ -90,3 +92,5 @@
 }
 
 }
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/cg/SubimageCacheWithTimer.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/cg/SubimageCacheWithTimer.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/cg/SubimageCacheWithTimer.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "SubimageCacheWithTimer.h"
 
+#if USE(CG)
+
 #include <wtf/Vector.h>
 
 #if CACHE_SUBIMAGES
@@ -114,3 +116,5 @@
 }
 
 #endif
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/win/FontCGWin.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/win/FontCGWin.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/win/FontCGWin.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "FontCascade.h"
 
+#if USE(CG)
+
 #include "AffineTransform.h"
 #include "FloatConversion.h"
 #include "Font.h"
@@ -218,3 +220,5 @@
 }
 
 }
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -24,6 +24,8 @@
 #include "config.h"
 #include "FontPlatformData.h"
 
+#if USE(CG)
+
 #include "SharedGDIObject.h"
 #include <ApplicationServices/ApplicationServices.h>
 #include <WebKitSystemInterface/WebKitSystemInterface.h>
@@ -135,3 +137,5 @@
 }
 
 }
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCGWin.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCGWin.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCGWin.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -29,6 +29,8 @@
 #include "config.h"
 #include "GlyphPage.h"
 
+#if USE(CG)
+
 #include "Font.h"
 #include <WebKitSystemInterface/WebKitSystemInterface.h>
 
@@ -58,3 +60,5 @@
 }
 
 }
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -29,7 +29,7 @@
 #if USE(DIRECT2D)
 
 #include "Font.h"
-#include "TextAnalysisHelper.h"
+#include "TextAnalyzerHelper.h"
 #include <dwrite.h>
 
 namespace WebCore {

Modified: trunk/Source/WebCore/platform/graphics/win/GradientDirect2D.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/win/GradientDirect2D.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/win/GradientDirect2D.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -98,7 +98,7 @@
         // for which m_p0 == m_p1.
         ASSERT(m_p0 == m_p1);
 
-        D2D1_MATRIX_3X2_F ctm;
+        D2D1_MATRIX_3X2_F ctm = { };
         d2dContext->GetTransform(&ctm);
 
         AffineTransform transform(ctm);

Modified: trunk/Source/WebCore/platform/graphics/win/PathDirect2D.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/win/PathDirect2D.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/win/PathDirect2D.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -336,7 +336,7 @@
     notImplemented();
 }
 
-static equalRadiusWidths(const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius)
+static bool equalRadiusWidths(const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius)
 {
     return topLeftRadius.width() == topRightRadius.width()
         && topRightRadius.width() == bottomLeftRadius.width()
@@ -343,7 +343,7 @@
         && bottomLeftRadius.width() == bottomRightRadius.width();
 }
 
-static equalRadiusHeights(const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius)
+static bool equalRadiusHeights(const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius)
 {
     return topLeftRadius.height() == bottomLeftRadius.height()
         && bottomLeftRadius.height() == topRightRadius.height()
@@ -414,7 +414,7 @@
     float firstArcEnd = startAngle + maxSweep;
     drawArcSection(m_activePath.get(), center, radius, startAngle, firstArcEnd, clockwise);
 
-    if (areEssentiallyEqual(firstArcEnd, endAngle))
+    if (WTF::areEssentiallyEqual(firstArcEnd, endAngle))
         return;
 
     drawArcSection(m_activePath.get(), center, radius, firstArcEnd, endAngle, clockwise);

Modified: trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -29,6 +29,8 @@
 #include "config.h"
 #include "Font.h"
 
+#if USE(CG)
+
 #include "CoreTextSPIWin.h"
 #include "FloatRect.h"
 #include "FontCache.h"
@@ -152,3 +154,5 @@
 }
 
 }
+
+#endif

Modified: trunk/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -37,6 +37,10 @@
 #include <wtf/MathExtras.h>
 #include <wtf/win/GDIObject.h>
 
+#if USE(DIRECT2D)
+#include <dwrite.h>
+#endif
+
 namespace WebCore {
 
 const float cSmallCapsFontSizeMultiplier = 0.7f;

Modified: trunk/Source/WebCore/platform/win/DragImageCGWin.cpp (206829 => 206830)


--- trunk/Source/WebCore/platform/win/DragImageCGWin.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/platform/win/DragImageCGWin.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "DragImage.h"
 
+#if USE(CG)
+
 #include "BitmapInfo.h"
 #include "CachedImage.h"
 #include "GraphicsContextCG.h"
@@ -146,3 +148,5 @@
 }
     
 }
+
+#endif

Added: trunk/Source/WebCore/platform/win/DragImageDirect2D.cpp (0 => 206830)


--- trunk/Source/WebCore/platform/win/DragImageDirect2D.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/win/DragImageDirect2D.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2016 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "DragImage.h"
+
+#if USE(DIRECT2D)
+
+#include "BitmapInfo.h"
+#include "CachedImage.h"
+#include "GraphicsContext.h"
+#include "HWndDC.h"
+#include "Image.h"
+#include "NotImplemented.h"
+
+#include <d2d1.h>
+#include <windows.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/win/GDIObject.h>
+
+namespace WebCore {
+
+void deallocContext(ID2D1RenderTarget* renderTarget)
+{
+    if (renderTarget)
+        renderTarget->Release();
+}
+
+GDIObject<HBITMAP> allocImage(HDC dc, IntSize size, ID2D1RenderTarget** targetRef)
+{
+    BitmapInfo bmpInfo = BitmapInfo::create(size);
+
+    LPVOID bits = nullptr;
+    auto hbmp = adoptGDIObject(::CreateDIBSection(dc, &bmpInfo, DIB_RGB_COLORS, &bits, 0, 0));
+
+    if (!targetRef || !hbmp)
+        return hbmp;
+
+    // FIXME: Use GDI Interop layer to create HBITMAP from D2D Bitmap
+    notImplemented();
+    return hbmp;
+}
+
+DragImageRef scaleDragImage(DragImageRef imageRef, FloatSize scale)
+{
+    // FIXME: due to the way drag images are done on windows we need 
+    // to preprocess the alpha channel <rdar://problem/5015946>
+    if (!imageRef)
+        return nullptr;
+
+    GDIObject<HBITMAP> hbmp;
+    auto image = adoptGDIObject(imageRef);
+
+    IntSize srcSize = dragImageSize(image.get());
+    IntSize dstSize(static_cast<int>(srcSize.width() * scale.width()), static_cast<int>(srcSize.height() * scale.height()));
+
+    HWndDC dc(nullptr);
+    auto dstDC = adoptGDIObject(::CreateCompatibleDC(dc));
+    if (dstDC)
+        notImplemented();
+
+    if (!hbmp)
+        hbmp.swap(image);
+    return hbmp.leak();
+}
+
+DragImageRef createDragImageFromImage(Image* img, ImageOrientationDescription)
+{
+    HWndDC dc(nullptr);
+    auto workingDC = adoptGDIObject(::CreateCompatibleDC(dc));
+    if (!workingDC)
+        return nullptr;
+
+    notImplemented();
+    return nullptr;
+}
+    
+}
+
+#endif

Modified: trunk/Source/WebCore/rendering/RenderMediaControls.cpp (206829 => 206830)


--- trunk/Source/WebCore/rendering/RenderMediaControls.cpp	2016-10-05 21:14:17 UTC (rev 206829)
+++ trunk/Source/WebCore/rendering/RenderMediaControls.cpp	2016-10-05 21:16:27 UTC (rev 206830)
@@ -32,6 +32,7 @@
 #include "GraphicsContext.h"
 #include "HTMLMediaElement.h"
 #include "HTMLNames.h"
+#include "NotImplemented.h"
 #include "PaintInfo.h"
 #include "RenderTheme.h"
 
@@ -128,6 +129,13 @@
 
 bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
+#if USE(DIRECT2D)
+    UNUSED_PARAM(part);
+    UNUSED_PARAM(o);
+    UNUSED_PARAM(paintInfo);
+    UNUSED_PARAM(r);
+    notImplemented();
+#else
     GraphicsContextStateSaver stateSaver(paintInfo.context());
 
     switch (part) {
@@ -214,7 +222,7 @@
         ASSERT_NOT_REACHED();
         break;
     }
-
+#endif
     return false;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to