1 // Copyright (c) 2015 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_EFL_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_EFL_H_
10 #include "gpu/command_buffer/client/context_support.h"
11 #include "gpu/command_buffer/client/gles2_impl_export.h"
12 #include "gpu/command_buffer/client/gles2_interface.h"
20 class GLES2_IMPL_EXPORT GLES2ImplementationEfl : public GLES2Interface,
21 public ContextSupport {
23 GLES2ImplementationEfl(Evas_GL_API* evas_gl_api);
24 ~GLES2ImplementationEfl() override;
26 // Include the auto-generated part of this class. We split this because
27 // it means we can easily edit the non-auto generated parts right here in
28 // this file instead of having to edit some template or the code generator.
29 #include "gpu/command_buffer/client/gles2_implementation_efl_header_autogen.h"
31 // ContextSupport implementation.
32 void SignalSyncToken(const SyncToken& sync_token,
33 const base::Closure& callback) override {}
34 void SignalQuery(uint32_t query, const base::Closure& callback) override {}
35 void SetAggressivelyFreeResources(bool aggressively_free_resources) override {
37 void Swap() override {}
38 void SwapWithDamage(const gfx::Rect& damage) override {}
39 void PartialSwapBuffers(const gfx::Rect& sub_buffer) override {}
40 void CommitOverlayPlanes() override {}
41 void ScheduleOverlayPlane(int plane_z_order,
42 gfx::OverlayTransform plane_transform,
43 unsigned overlay_texture_id,
44 const gfx::Rect& display_bounds,
45 const gfx::RectF& uv_rect) override {}
46 uint64_t ShareGroupTracingGUID() const override;
47 void SetErrorMessageCallback(
48 const base::Callback<void(const char*, int32_t)>& callback) override {}
50 GLuint DoCreateProgram();
51 void DoUseProgram(GLuint program);
52 void DoDeleteProgram(GLuint program);
53 void DoUniform1f(GLint location, GLfloat x);
54 void DoUniform1fv(GLint location, GLsizei count, const GLfloat* v);
55 void DoUniform1i(GLint location, GLint x);
56 void DoUniform1iv(GLint location, GLsizei count, const GLint* v);
57 void DoUniform2f(GLint location, GLfloat x, GLfloat y);
58 void DoUniform2fv(GLint location, GLsizei count, const GLfloat* v);
59 void DoUniform2i(GLint location, GLint x, GLint y);
60 void DoUniform2iv(GLint location, GLsizei count, const GLint* v);
61 void DoUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
62 void DoUniform3fv(GLint location, GLsizei count, const GLfloat* v);
63 void DoUniform3i(GLint location, GLint x, GLint y, GLint z);
64 void DoUniform3iv(GLint location, GLsizei count, const GLint* v);
65 void DoUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
66 void DoUniform4fv(GLint location, GLsizei count, const GLfloat* v);
67 void DoUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
68 void DoUniform4iv(GLint location, GLsizei count, const GLint* v);
69 void DoUniformMatrix2fv(GLint location,
72 const GLfloat* value);
73 void DoUniformMatrix3fv(GLint location,
76 const GLfloat* value);
77 void DoUniformMatrix4fv(GLint location,
80 const GLfloat* value);
81 void DoBindUniformLocationCHROMIUM(GLuint program,
85 void DoGenTextures(GLsizei n, GLuint* textures);
86 void DoConsumeTextureCHROMIUM(GLenum target, const GLbyte* data);
87 GLuint DoCreateAndConsumeTextureCHROMIUM(GLenum target, const GLbyte* data);
88 void DoBindTexture(GLenum target, GLuint texture);
89 void DoDeleteTextures(GLsizei n, const GLuint* textures);
91 GLuint DoInsertFenceSyncCHROMIUM();
92 void DoWaitSyncTokenCHROMIUM(const GLbyte* sync_token);
95 Evas_GL_API* evas_gl_api_;
99 typedef std::map<GLint, std::string> UniformLocationMap;
100 UniformLocationMap uniform_location_map_;
103 GLint current_program_;
105 typedef std::map<GLint, ProgramData> ProgramMap;
106 ProgramMap program_map_;
108 GLuint bound_texture_id_;
110 typedef std::map<GLuint, GLuint> TextureConsumedMap;
111 TextureConsumedMap texture_consumed_map_;
113 typedef std::map<GLenum, GLuint> TextureBoundMap;
114 TextureBoundMap texture_bound_map_;
116 std::set<GLuint> textures_;
118 GLint GetBoundUniformLocation(GLint location);
119 ProgramData& GetProgramData(GLint program = -1);
125 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_EFL_H_