#include "config.h"
#include "DrawingArea.h"
#include <WebCore/DisplayRefreshMonitor.h>
#include <WebCore/TransformationMatrix.h>
#include <wtf/Functional.h>
#if PLATFORM(COCOA)
#include "RemoteLayerTreeDrawingArea.h"
#include "TiledCoreAnimationDrawingArea.h"
#else
#if USE(COORDINATED_GRAPHICS)
#include "CoordinatedDrawingArea.h"
#else
#include "DrawingAreaImpl.h"
#endif
#endif
#include "WebPageCreationParameters.h"
using namespace WebCore;
namespace WebKit {
std::unique_ptr<DrawingArea> DrawingArea::create(WebPage& webPage, const WebPageCreationParameters& parameters)
{
switch (parameters.drawingAreaType) {
#if PLATFORM(COCOA)
#if !PLATFORM(IOS)
case DrawingAreaTypeTiledCoreAnimation:
return std::make_unique<TiledCoreAnimationDrawingArea>(webPage, parameters);
#endif
case DrawingAreaTypeRemoteLayerTree:
return std::make_unique<RemoteLayerTreeDrawingArea>(webPage, parameters);
#else
#if USE(COORDINATED_GRAPHICS)
case DrawingAreaTypeCoordinated:
return std::make_unique<CoordinatedDrawingArea>(webPage, parameters);
#else
case DrawingAreaTypeImpl:
return std::make_unique<DrawingAreaImpl>(webPage, parameters);
#endif
#endif
}
return nullptr;
}
DrawingArea::DrawingArea(DrawingAreaType type, WebPage& webPage)
: m_type(type)
, m_webPage(webPage)
{
}
DrawingArea::~DrawingArea()
{
}
void DrawingArea::dispatchAfterEnsuringUpdatedScrollPosition(std::function<void ()> function)
{
function();
}
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
PassRefPtr<WebCore::DisplayRefreshMonitor> DrawingArea::createDisplayRefreshMonitor(PlatformDisplayID)
{
return nullptr;
}
#endif
}