PlatformCALayerRemoteTiledBacking.cpp [plain text]
#include "config.h"
#import "PlatformCALayerRemoteTiledBacking.h"
#import "RemoteLayerTreeContext.h"
#import <WebCore/GraphicsLayerCA.h>
#import <WebCore/PlatformCALayerCocoa.h>
#import <WebCore/TiledBacking.h>
#import <wtf/RetainPtr.h>
using namespace WebCore;
namespace WebKit {
PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking(LayerType layerType, PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
: PlatformCALayerRemote(layerType, owner, context)
, m_tileController(std::make_unique<TileController>(this))
{
}
PlatformCALayerRemoteTiledBacking::~PlatformCALayerRemoteTiledBacking()
{
}
void PlatformCALayerRemoteTiledBacking::setNeedsDisplayInRect(const FloatRect& dirtyRect)
{
m_tileController->setNeedsDisplayInRect(enclosingIntRect(dirtyRect));
}
void PlatformCALayerRemoteTiledBacking::setNeedsDisplay()
{
m_tileController->setNeedsDisplay();
}
const WebCore::PlatformCALayerList* PlatformCALayerRemoteTiledBacking::customSublayers() const
{
m_customSublayers = m_tileController->containerLayers();
return &m_customSublayers;
}
void PlatformCALayerRemoteTiledBacking::setBounds(const WebCore::FloatRect& bounds)
{
PlatformCALayerRemote::setBounds(bounds);
m_tileController->tileCacheLayerBoundsChanged();
}
bool PlatformCALayerRemoteTiledBacking::isOpaque() const
{
return m_tileController->tilesAreOpaque();
}
void PlatformCALayerRemoteTiledBacking::setOpaque(bool opaque)
{
m_tileController->setTilesOpaque(opaque);
}
bool PlatformCALayerRemoteTiledBacking::acceleratesDrawing() const
{
return m_tileController->acceleratesDrawing();
}
void PlatformCALayerRemoteTiledBacking::setAcceleratesDrawing(bool acceleratesDrawing)
{
m_tileController->setAcceleratesDrawing(acceleratesDrawing);
}
float PlatformCALayerRemoteTiledBacking::contentsScale() const
{
return m_tileController->contentsScale();
}
void PlatformCALayerRemoteTiledBacking::setContentsScale(float scale)
{
m_tileController->setContentsScale(scale);
}
void PlatformCALayerRemoteTiledBacking::setBorderWidth(float borderWidth)
{
m_tileController->setTileDebugBorderWidth(borderWidth / 2);
}
void PlatformCALayerRemoteTiledBacking::setBorderColor(const WebCore::Color& color)
{
m_tileController->setTileDebugBorderColor(color);
}
}