Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: mojo/apps/js/bindings/gl/opaque.h

Issue 113893005: [gin] Introduce Wrappable::GetObjectTemplate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/apps/js/bindings/gl/module.cc ('k') | mojo/apps/js/bindings/gl/opaque.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_OPAQUE_H_ 5 #ifndef MOJO_APPS_JS_BINDINGS_GL_OPAQUE_H_
6 #define MOJO_APPS_JS_BINDINGS_GL_OPAQUE_H_ 6 #define MOJO_APPS_JS_BINDINGS_GL_OPAQUE_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"
11 #include "gin/public/wrapper_info.h" 11 #include "gin/public/wrapper_info.h"
12 #include "gin/wrappable.h" 12 #include "gin/wrappable.h"
13 #include "v8/include/v8.h" 13 #include "v8/include/v8.h"
14 14
15 namespace mojo { 15 namespace mojo {
16 namespace js { 16 namespace js {
17 namespace gl { 17 namespace gl {
18 18
19 // WebGL has many interfaces, such as WebGLObject, WebGLBuffer, etc, which wrap 19 // WebGL has many interfaces, such as WebGLObject, WebGLBuffer, etc, which wrap
20 // integers that are opaque to script. This class is used for all those objects. 20 // integers that are opaque to script. This class is used for all those objects.
21 class Opaque : public gin::Wrappable<Opaque> { 21 class Opaque : public gin::Wrappable<Opaque> {
22 public: 22 public:
23 static gin::WrapperInfo kWrapperInfo; 23 static gin::WrapperInfo kWrapperInfo;
24 24
25 static gin::Handle<Opaque> Create(v8::Isolate* isolate, GLuint value); 25 static gin::Handle<Opaque> Create(v8::Isolate* isolate, GLuint value);
26 static v8::Handle<v8::ObjectTemplate> GetObjectTemplate(v8::Isolate* isolate);
27 26
28 GLuint value() const { return value_; } 27 GLuint value() const { return value_; }
29 void set_value(GLuint val) { value_ = val; } 28 void set_value(GLuint val) { value_ = val; }
30 29
31 private: 30 private:
32 Opaque(GLuint value); 31 Opaque(GLuint value);
33 32
34 GLuint value_; 33 GLuint value_;
35 }; 34 };
36 35
37 } // namespace gl 36 } // namespace gl
38 } // namespace js 37 } // namespace js
39 } // namespace mojo 38 } // namespace mojo
40 39
41 #endif // MOJO_APPS_JS_BINDINGS_GL_CONTEXT_H_ 40 #endif // MOJO_APPS_JS_BINDINGS_GL_CONTEXT_H_
OLDNEW
« no previous file with comments | « mojo/apps/js/bindings/gl/module.cc ('k') | mojo/apps/js/bindings/gl/opaque.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698