TextureMapperGCGLPlatformLayer.h [plain text]
#pragma once
#if ENABLE(GRAPHICS_CONTEXT_GL) && USE(TEXTURE_MAPPER) && !USE(NICOSIA)
#include "GraphicsContextGLOpenGL.h"
#include "PlatformLayer.h"
#include "TextureMapperPlatformLayer.h"
#include "TextureMapperPlatformLayerProxyProvider.h"
namespace WebCore {
class GLContext;
class TextureMapperPlatformLayerProxy;
class TextureMapperGCGLPlatformLayer : public PlatformLayer {
WTF_MAKE_FAST_ALLOCATED;
public:
TextureMapperGCGLPlatformLayer(GraphicsContextGLOpenGL&, GraphicsContextGLOpenGL::Destination);
virtual ~TextureMapperGCGLPlatformLayer();
bool makeContextCurrent();
PlatformGraphicsContextGL platformContext() const;
#if USE(COORDINATED_GRAPHICS)
RefPtr<TextureMapperPlatformLayerProxy> proxy() const override;
void swapBuffersIfNeeded() override;
#else
virtual void paintToTextureMapper(TextureMapper&, const FloatRect& target, const TransformationMatrix&, float opacity);
#endif
private:
GraphicsContextGLOpenGL& m_context;
std::unique_ptr<GLContext> m_glContext;
#if USE(COORDINATED_GRAPHICS)
RefPtr<TextureMapperPlatformLayerProxy> m_platformLayerProxy;
#endif
};
}
#endif // ENABLE(GRAPHICS_CONTEXT_GL) && USE(TEXTURE_MAPPER)