| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_APPS_JS_BINDINGS_GL_CONTEXT_H_ | 5 #ifndef MOJO_APPS_JS_BINDINGS_GL_CONTEXT_H_ |
| 6 #define MOJO_APPS_JS_BINDINGS_GL_CONTEXT_H_ | 6 #define MOJO_APPS_JS_BINDINGS_GL_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
| 9 | 9 |
| 10 #include "gin/handle.h" | 10 #include "gin/handle.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 typedef Opaque Shader; | 24 typedef Opaque Shader; |
| 25 | 25 |
| 26 // Context implements WebGLRenderingContext. | 26 // Context implements WebGLRenderingContext. |
| 27 class Context : public gin::Wrappable<Context> { | 27 class Context : public gin::Wrappable<Context> { |
| 28 public: | 28 public: |
| 29 static gin::WrapperInfo kWrapperInfo; | 29 static gin::WrapperInfo kWrapperInfo; |
| 30 | 30 |
| 31 static gin::Handle<Context> Create(v8::Isolate* isolate, uint64_t encoded, | 31 static gin::Handle<Context> Create(v8::Isolate* isolate, uint64_t encoded, |
| 32 int width, int height); | 32 int width, int height); |
| 33 static v8::Handle<v8::ObjectTemplate> GetObjectTemplate(v8::Isolate* isolate); | |
| 34 | |
| 35 static gin::Handle<Shader> CreateShader(const gin::Arguments& arguments, | 33 static gin::Handle<Shader> CreateShader(const gin::Arguments& arguments, |
| 36 GLenum type); | 34 GLenum type); |
| 37 static void ShaderSource(gin::Handle<Shader> shader, | 35 static void ShaderSource(gin::Handle<Shader> shader, |
| 38 const std::string& source); | 36 const std::string& source); |
| 39 static void CompileShader(const gin::Arguments& arguments, | 37 static void CompileShader(const gin::Arguments& arguments, |
| 40 gin::Handle<Shader> shader); | 38 gin::Handle<Shader> shader); |
| 41 | 39 |
| 42 private: | 40 private: |
| 41 friend class gin::Wrappable<Context>; |
| 42 static v8::Local<v8::ObjectTemplate> GetObjectTemplate(v8::Isolate* isolate); |
| 43 |
| 43 Context(uint64_t encoded, int width, int height); | 44 Context(uint64_t encoded, int width, int height); |
| 44 | 45 |
| 45 uint64_t encoded_; | 46 uint64_t encoded_; |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 } // namespace gl | 49 } // namespace gl |
| 49 } // namespace js | 50 } // namespace js |
| 50 } // namespace mojo | 51 } // namespace mojo |
| 51 | 52 |
| 52 #endif // MOJO_APPS_JS_BINDINGS_GL_CONTEXT_H_ | 53 #endif // MOJO_APPS_JS_BINDINGS_GL_CONTEXT_H_ |
| OLD | NEW |