1 // 2 // Copyright 2015 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 // GLImplFactory.h: 7 // Factory interface for OpenGL ES Impl objects. 8 // 9 10 #ifndef LIBANGLE_RENDERER_GLIMPLFACTORY_H_ 11 #define LIBANGLE_RENDERER_GLIMPLFACTORY_H_ 12 13 #include <vector> 14 15 #include "angle_gl.h" 16 #include "libANGLE/Framebuffer.h" 17 #include "libANGLE/Program.h" 18 #include "libANGLE/ProgramPipeline.h" 19 #include "libANGLE/Shader.h" 20 #include "libANGLE/TransformFeedback.h" 21 #include "libANGLE/VertexArray.h" 22 23 namespace gl 24 { 25 class ContextState; 26 } 27 28 namespace rx 29 { 30 class BufferImpl; 31 class CompilerImpl; 32 class ContextImpl; 33 class FenceNVImpl; 34 class SyncImpl; 35 class FramebufferImpl; 36 class PathImpl; 37 class ProgramImpl; 38 class ProgramPipelineImpl; 39 class QueryImpl; 40 class RenderbufferImpl; 41 class SamplerImpl; 42 class ShaderImpl; 43 class TextureImpl; 44 class TransformFeedbackImpl; 45 class VertexArrayImpl; 46 47 class GLImplFactory : angle::NonCopyable 48 { 49 public: GLImplFactory()50 GLImplFactory() {} ~GLImplFactory()51 virtual ~GLImplFactory() {} 52 53 // Shader creation 54 virtual CompilerImpl *createCompiler() = 0; 55 virtual ShaderImpl *createShader(const gl::ShaderState &data) = 0; 56 virtual ProgramImpl *createProgram(const gl::ProgramState &data) = 0; 57 58 // Framebuffer creation 59 virtual FramebufferImpl *createFramebuffer(const gl::FramebufferState &data) = 0; 60 61 // Texture creation 62 virtual TextureImpl *createTexture(const gl::TextureState &state) = 0; 63 64 // Renderbuffer creation 65 virtual RenderbufferImpl *createRenderbuffer() = 0; 66 67 // Buffer creation 68 virtual BufferImpl *createBuffer(const gl::BufferState &state) = 0; 69 70 // Vertex Array creation 71 virtual VertexArrayImpl *createVertexArray(const gl::VertexArrayState &data) = 0; 72 73 // Query and Fence creation 74 virtual QueryImpl *createQuery(GLenum type) = 0; 75 virtual FenceNVImpl *createFenceNV() = 0; 76 virtual SyncImpl *createSync() = 0; 77 78 // Transform Feedback creation 79 virtual TransformFeedbackImpl *createTransformFeedback( 80 const gl::TransformFeedbackState &state) = 0; 81 82 // Sampler object creation 83 virtual SamplerImpl *createSampler(const gl::SamplerState &state) = 0; 84 85 // Program Pipeline object creation 86 virtual ProgramPipelineImpl *createProgramPipeline(const gl::ProgramPipelineState &data) = 0; 87 88 virtual std::vector<PathImpl *> createPaths(GLsizei range) = 0; 89 }; 90 91 } // namespace rx 92 93 #endif // LIBANGLE_RENDERER_GLIMPLFACTORY_H_ 94