Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
with
318 additions
and 61 deletions.
- +10 −0 ChangeLog
- +10 −0 Source/WTF/ChangeLog
- +2 −2 Source/WTF/wtf/Platform.h
- +23 −0 Source/WebCore/ChangeLog
- +111 −59 Source/WebCore/PlatformAppleWin.cmake
- +1 −0 Source/WebCore/config.h
- +1 −0 Source/WebCore/page/win/FrameWinDirect2D.cpp
- +96 −0 Source/WebCore/platform/graphics/win/GraphicsLayerDirect2D.cpp
- +61 −0 Source/WebCore/platform/graphics/win/GraphicsLayerDirect2D.h
- +3 −0 Source/cmake/OptionsAppleWin.cmake
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -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> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -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 |
Oops, something went wrong.