Skip to content
Permalink
Browse files
[Win][Direct2D] Add Direct2D CMake rules
https://bugs.webkit.org/show_bug.cgi?id=162925

Reviewed by Brent Fulgham.

.:

* Source/cmake/OptionsAppleWin.cmake: Add a new 'USE_DIRECT2D' option
flag for the build. Currently this is commented out and is unused.

Source/WebCore:

Modify PlatformAppleWin.cmake to conditionally build the CoreGraphics
and CoreAnimation implementation, or the Direct2D files, depending
on whether the USE_DIRECT2D macro is set in the CMake build options.
By default it builds the normal CA/CG way.

Add a stub GraphicsLayer implementation for Direct2D.

No new tests because there is no change in our active ports.

* PlatformAppleWin.cmake: Conditionalize the build for CA/CG or
Direct2D.
* config.h: Make sure CA is turned of for Direct2D builds.
* page/win/FrameWinDirect2D.cpp: Add missing include file.
* platform/graphics/win/GraphicsLayerDirect2D.cpp: Added.
* platform/graphics/win/GraphicsLayerDirect2D.h: Added.

Source/WTF:

* wtf/Platform.h: Don't USE(CA) or USE(CG) if building
with Direct2D.


Canonical link: https://commits.webkit.org/180924@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206871 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
brentfulgham committed Oct 6, 2016
1 parent 30070a4 commit 9969b8b579334238aded3db0d415681d67477e80
@@ -1,3 +1,13 @@
2016-10-06 Brent Fulgham <bfulgham@apple.com>

[Win][Direct2D] Add Direct2D CMake rules
https://bugs.webkit.org/show_bug.cgi?id=162925

Reviewed by Brent Fulgham.

* Source/cmake/OptionsAppleWin.cmake: Add a new 'USE_DIRECT2D' option
flag for the build. Currently this is commented out and is unused.

2016-10-05 Zan Dobersek <zdobersek@igalia.com>

Rename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA
@@ -1,3 +1,13 @@
2016-10-06 Brent Fulgham <bfulgham@apple.com>

[Win][Direct2D] Add Direct2D CMake rules
https://bugs.webkit.org/show_bug.cgi?id=162925

Reviewed by Brent Fulgham.

* wtf/Platform.h: Don't USE(CA) or USE(CG) if building
with Direct2D.

2016-10-05 Yusuke Suzuki <utatane.tea@gmail.com>

[DOMJIT] Add initial CheckDOM and CallDOM implementations
@@ -480,10 +480,10 @@
/* Graphics engines */

/* USE(CG) and PLATFORM(CI) */
#if PLATFORM(COCOA) || (PLATFORM(WIN) && !USE(WINGDI) && !PLATFORM(WIN_CAIRO))
#if PLATFORM(COCOA) || (PLATFORM(WIN) && !USE(WINGDI) && !PLATFORM(WIN_CAIRO) && !USE(DIRECT2D))
#define USE_CG 1
#endif
#if PLATFORM(COCOA) || (PLATFORM(WIN) && USE(CG))
#if PLATFORM(COCOA) || (PLATFORM(WIN) && USE(CG) && !USE(DIRECT2D))
#define USE_CA 1
#endif

@@ -1,3 +1,26 @@
2016-10-06 Brent Fulgham <bfulgham@apple.com>

[Win][Direct2D] Add Direct2D CMake rules
https://bugs.webkit.org/show_bug.cgi?id=162925

Reviewed by Brent Fulgham.

Modify PlatformAppleWin.cmake to conditionally build the CoreGraphics
and CoreAnimation implementation, or the Direct2D files, depending
on whether the USE_DIRECT2D macro is set in the CMake build options.
By default it builds the normal CA/CG way.

Add a stub GraphicsLayer implementation for Direct2D.

No new tests because there is no change in our active ports.

* PlatformAppleWin.cmake: Conditionalize the build for CA/CG or
Direct2D.
* config.h: Make sure CA is turned of for Direct2D builds.
* page/win/FrameWinDirect2D.cpp: Add missing include file.
* platform/graphics/win/GraphicsLayerDirect2D.cpp: Added.
* platform/graphics/win/GraphicsLayerDirect2D.h: Added.

2016-10-06 Yusuke Suzuki <utatane.tea@gmail.com>

[WebCore][JSC] Use new @throwTypeError and @throwRangeError intrinsics
@@ -15,13 +15,26 @@ list(APPEND WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/spi/cg"
)

if (${USE_DIRECT2D})
list(APPEND WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/graphics/win"
)
else ()
list(APPEND WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/graphics/avfoundation"
"${WEBCORE_DIR}/platform/graphics/avfoundation/cf"
"${WEBCORE_DIR}/platform/graphics/ca"
"${WEBCORE_DIR}/platform/graphics/ca/win"
"${WEBCORE_DIR}/platform/graphics/cg"
"${WEBCORE_DIR}/platform/spi/cg"
)
endif ()

list(APPEND WebCore_SOURCES
loader/cf/ResourceLoaderCFNet.cpp

page/CaptionUserPreferencesMediaAF.cpp

page/win/FrameCGWin.cpp

platform/cf/CoreMediaSoftLink.cpp
platform/cf/MediaAccessibilitySoftLink.cpp

@@ -37,56 +50,7 @@ list(APPEND WebCore_SOURCES
platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp

platform/graphics/ca/GraphicsLayerCA.cpp
platform/graphics/ca/LayerFlushScheduler.cpp
platform/graphics/ca/LayerPool.cpp
platform/graphics/ca/PlatformCALayer.cpp
platform/graphics/ca/TileController.cpp
platform/graphics/ca/TileCoverageMap.cpp
platform/graphics/ca/TileGrid.cpp
platform/graphics/ca/TransformationMatrixCA.cpp

platform/graphics/ca/win/CACFLayerTreeHost.cpp
platform/graphics/ca/win/LayerChangesFlusher.cpp
platform/graphics/ca/win/PlatformCAAnimationWin.cpp
platform/graphics/ca/win/PlatformCAFiltersWin.cpp
platform/graphics/ca/win/PlatformCALayerWin.cpp
platform/graphics/ca/win/PlatformCALayerWinInternal.cpp
platform/graphics/ca/win/WebTiledBackingLayerWin.cpp
platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp

platform/graphics/cg/ColorCG.cpp
platform/graphics/cg/FloatPointCG.cpp
platform/graphics/cg/FloatRectCG.cpp
platform/graphics/cg/FloatSizeCG.cpp
platform/graphics/cg/GradientCG.cpp
platform/graphics/cg/GraphicsContext3DCG.cpp
platform/graphics/cg/GraphicsContextCG.cpp
platform/graphics/cg/IOSurfacePool.cpp
platform/graphics/cg/ImageBufferCG.cpp
platform/graphics/cg/ImageBufferDataCG.cpp
platform/graphics/cg/ImageCG.cpp
platform/graphics/cg/ImageDecoderCG.cpp
platform/graphics/cg/ImageSourceCGWin.cpp
platform/graphics/cg/IntPointCG.cpp
platform/graphics/cg/IntRectCG.cpp
platform/graphics/cg/IntSizeCG.cpp
platform/graphics/cg/NativeImageCG.cpp
platform/graphics/cg/PDFDocumentImage.cpp
platform/graphics/cg/PathCG.cpp
platform/graphics/cg/PatternCG.cpp
platform/graphics/cg/SubimageCacheWithTimer.cpp
platform/graphics/cg/TransformationMatrixCG.cpp

platform/graphics/opentype/OpenTypeCG.cpp

platform/graphics/win/FontCGWin.cpp
platform/graphics/win/FontCustomPlatformData.cpp
platform/graphics/win/FontPlatformDataCGWin.cpp
platform/graphics/win/GlyphPageTreeNodeCGWin.cpp
platform/graphics/win/GraphicsContextCGWin.cpp
platform/graphics/win/ImageCGWin.cpp
platform/graphics/win/SimpleFontDataCGWin.cpp

platform/network/cf/AuthenticationCF.cpp
platform/network/cf/CookieJarCFNet.cpp
@@ -106,18 +70,106 @@ list(APPEND WebCore_SOURCES
platform/network/cf/SocketStreamHandleImplCFNet.cpp
platform/network/cf/SynchronousLoaderClientCFNet.cpp
platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp

platform/win/DragImageCGWin.cpp
)

list(APPEND WebCore_FORWARDING_HEADERS_DIRECTORIES
platform/graphics/ca
platform/graphics/cg

platform/graphics/ca/win
if (${USE_DIRECT2D})
list(APPEND WebCore_SOURCES
page/win/FrameWinDirect2D.cpp

platform/graphics/win/FontCascadeDirect2D.cpp
platform/graphics/win/FontPlatformDataDirect2D.cpp
platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp
platform/graphics/win/GradientDirect2D.cpp
platform/graphics/win/GraphicsContextDirect2D.cpp
platform/graphics/win/GraphicsLayerDirect2D.cpp
platform/graphics/win/ImageBufferDataDirect2D.cpp
platform/graphics/win/ImageBufferDirect2D.cpp
platform/graphics/win/ImageDecoderDirect2D.cpp
platform/graphics/win/ImageDirect2D.cpp
platform/graphics/win/NativeImageDirect2D.cpp
platform/graphics/win/PathDirect2D.cpp
platform/graphics/win/SimpleFontDataDirect2D.cpp
platform/graphics/win/TextAnalyzerHelper.cpp

platform/win/DragImageDirect2D.cpp
)
else ()
list(APPEND WebCore_SOURCES
page/win/FrameCGWin.cpp

platform/graphics/ca/GraphicsLayerCA.cpp
platform/graphics/ca/LayerFlushScheduler.cpp
platform/graphics/ca/LayerPool.cpp
platform/graphics/ca/PlatformCALayer.cpp
platform/graphics/ca/TileController.cpp
platform/graphics/ca/TileCoverageMap.cpp
platform/graphics/ca/TileGrid.cpp
platform/graphics/ca/TransformationMatrixCA.cpp

platform/graphics/ca/win/CACFLayerTreeHost.cpp
platform/graphics/ca/win/LayerChangesFlusher.cpp
platform/graphics/ca/win/PlatformCAAnimationWin.cpp
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/ColorCG.cpp
platform/graphics/cg/FloatPointCG.cpp
platform/graphics/cg/FloatRectCG.cpp
platform/graphics/cg/FloatSizeCG.cpp
platform/graphics/cg/GradientCG.cpp
platform/graphics/cg/GraphicsContext3DCG.cpp
platform/graphics/cg/GraphicsContextCG.cpp
platform/graphics/cg/IOSurfacePool.cpp
platform/graphics/cg/ImageBufferCG.cpp
platform/graphics/cg/ImageBufferDataCG.cpp
platform/graphics/cg/ImageCG.cpp
platform/graphics/cg/ImageDecoderCG.cpp
platform/graphics/cg/ImageSourceCGWin.cpp
platform/graphics/cg/IntPointCG.cpp
platform/graphics/cg/IntRectCG.cpp
platform/graphics/cg/IntSizeCG.cpp
platform/graphics/cg/NativeImageCG.cpp
platform/graphics/cg/PDFDocumentImage.cpp
platform/graphics/cg/PathCG.cpp
platform/graphics/cg/PatternCG.cpp
platform/graphics/cg/SubimageCacheWithTimer.cpp
platform/graphics/cg/TransformationMatrixCG.cpp

platform/graphics/opentype/OpenTypeCG.cpp

platform/graphics/win/FontCGWin.cpp
platform/graphics/win/FontPlatformDataCGWin.cpp
platform/graphics/win/GlyphPageTreeNodeCGWin.cpp
platform/graphics/win/GraphicsContextCGWin.cpp
platform/graphics/win/ImageCGWin.cpp
platform/graphics/win/SimpleFontDataCGWin.cpp

platform/win/DragImageCGWin.cpp
)
endif ()

list(APPEND WebCore_FORWARDING_HEADERS_DIRECTORIES
platform/network/cf

platform/spi/cf
platform/spi/cg
)

if (${USE_DIRECT2D})
list(APPEND WebCore_FORWARDING_HEADERS_DIRECTORIES
platform/graphics/win
)
else ()
list(APPEND WebCore_FORWARDING_HEADERS_DIRECTORIES
platform/graphics/ca
platform/graphics/cg

platform/graphics/ca/win

platform/network/cf

platform/spi/cg
)
endif ()
@@ -95,6 +95,7 @@
#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
#endif
#elif USE(DIRECT2D)
#undef USE_CA
#undef USE_CG
#elif !USE(WINGDI)
#define USE_CG 1
@@ -33,6 +33,7 @@
#include "FrameSelection.h"
#include "FrameView.h"
#include "GraphicsContext.h"
#include "NotImplemented.h"
#include "RenderObject.h"
#include "Settings.h"
#include <d2d1.h>
@@ -0,0 +1,96 @@
/*
* 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 "GraphicsLayerDirect2D.h"

#if USE(DIRECT2D)

#include "DisplayList.h"
#include "GraphicsLayerFactory.h"
#include "NotImplemented.h"
#include <limits.h>
#include <wtf/CurrentTime.h>
#include <wtf/MathExtras.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/SystemTracing.h>
#include <wtf/TemporaryChange.h>
#include <wtf/text/WTFString.h>


#if COMPILER(MSVC)
// See https://msdn.microsoft.com/en-us/library/1wea5zwe.aspx
#pragma warning(disable: 4701)
#endif

namespace WebCore {


std::unique_ptr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient& client, Type layerType)
{
std::unique_ptr<GraphicsLayer> graphicsLayer;
if (!factory)
graphicsLayer = std::make_unique<GraphicsLayerDirect2D>(layerType, client);
else
graphicsLayer = factory->createGraphicsLayer(layerType, client);

graphicsLayer->initialize(layerType);

return graphicsLayer;
}

GraphicsLayerDirect2D::GraphicsLayerDirect2D(Type layerType, GraphicsLayerClient& client)
: GraphicsLayer(layerType, client)
{
}

void GraphicsLayerDirect2D::initialize(Type layerType)
{
}

GraphicsLayerDirect2D::~GraphicsLayerDirect2D()
{
willBeDestroyed();
}

void GraphicsLayerDirect2D::setNeedsDisplay()
{
if (!drawsContent())
return;

notImplemented();
}

void GraphicsLayerDirect2D::setNeedsDisplayInRect(const FloatRect& r, ShouldClipToLayer shouldClip)
{
if (!drawsContent())
return;

notImplemented();
}

} // namespace WebCore

#endif

0 comments on commit 9969b8b

Please sign in to comment.