ImageBufferDataCairo.h [plain text]
#ifndef ImageBufferDataCairo_h
#define ImageBufferDataCairo_h
#if USE(CAIRO)
#include "PlatformContextCairo.h"
#include "RefPtrCairo.h"
#if ENABLE(ACCELERATED_2D_CANVAS)
#include "PlatformLayer.h"
#include "TextureMapper.h"
#include "TextureMapperPlatformLayer.h"
#include "TextureMapperPlatformLayerProxyProvider.h"
#endif
#if ENABLE(ACCELERATED_2D_CANVAS) && USE(NICOSIA)
#include "NicosiaContentLayerTextureMapperImpl.h"
#endif
namespace WebCore {
class IntSize;
class TextureMapperPlatformLayerProxy;
class ImageBufferData
#if ENABLE(ACCELERATED_2D_CANVAS)
#if USE(NICOSIA)
: public Nicosia::ContentLayerTextureMapperImpl::Client
#else
: public PlatformLayer
#endif
#endif
{
public:
ImageBufferData(const IntSize&, RenderingMode);
virtual ~ImageBufferData();
RefPtr<cairo_surface_t> m_surface;
PlatformContextCairo m_platformContext;
std::unique_ptr<GraphicsContext> m_context;
IntSize m_size;
RenderingMode m_renderingMode;
#if ENABLE(ACCELERATED_2D_CANVAS)
void createCairoGLSurface();
#if USE(COORDINATED_GRAPHICS)
#if USE(NICOSIA)
void swapBuffersIfNeeded() override;
#else
RefPtr<TextureMapperPlatformLayerProxy> proxy() const override;
void swapBuffersIfNeeded() override;
#endif
void createCompositorBuffer();
RefPtr<cairo_surface_t> m_compositorSurface;
uint32_t m_compositorTexture;
RefPtr<cairo_t> m_compositorCr;
#if USE(NICOSIA)
RefPtr<Nicosia::ContentLayer> m_nicosiaLayer;
#else
RefPtr<TextureMapperPlatformLayerProxy> m_platformLayerProxy;
#endif
#else
virtual void paintToTextureMapper(TextureMapper&, const FloatRect& target, const TransformationMatrix&, float opacity);
#endif
uint32_t m_texture;
#endif
};
}
#endif // USE(CAIRO)
#endif // ImageBufferDataCairo_h