TextureMapperPlatformLayer.h [plain text]
#pragma once
#if USE(TEXTURE_MAPPER)
#include "TextureMapper.h"
#include "TransformationMatrix.h"
namespace WebCore {
class TextureMapperPlatformLayer {
public:
class Client {
public:
virtual void platformLayerWillBeDestroyed() = 0;
virtual void setPlatformLayerNeedsDisplay() = 0;
};
TextureMapperPlatformLayer() = default;
virtual ~TextureMapperPlatformLayer() = default;
virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0) = 0;
virtual void drawBorder(TextureMapper& textureMapper, const Color& color, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
{
textureMapper.drawBorder(color, borderWidth, targetRect, transform);
}
void setClient(TextureMapperPlatformLayer::Client* client) { m_client = client; }
protected:
TextureMapperPlatformLayer::Client* client() { return m_client; }
private:
TextureMapperPlatformLayer::Client* m_client { nullptr };
};
}
#endif // USE(TEXTURE_MAPPER)