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 #include "mojo/skia/gl_bindings_skia.h" | 5 #include "mojo/skia/gl_bindings_skia.h" |
6 | 6 |
7 #ifndef GL_GLEXT_PROTOTYPES | 7 #ifndef GL_GLEXT_PROTOTYPES |
8 #define GL_GLEXT_PROTOTYPES | 8 #define GL_GLEXT_PROTOTYPES |
9 #endif | 9 #endif |
10 #include "mojo/public/c/gpu/GLES2/gl2.h" | 10 #include "mojo/public/c/gpu/GLES2/gl2.h" |
11 #include "mojo/public/c/gpu/GLES2/gl2ext.h" | 11 #include "mojo/public/c/gpu/GLES2/gl2ext.h" |
12 #include "mojo/public/c/gpu/GLES2/gl2extmojo.h" | 12 #include "mojo/public/c/gpu/GLES2/gl2extmojo.h" |
13 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" | 13 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" |
14 | 14 |
15 namespace mojo { | 15 namespace mojo { |
16 namespace skia { | 16 namespace skia { |
17 | 17 |
18 GrGLInterface* CreateMojoSkiaGLBinding() { | 18 sk_sp<GrGLInterface> CreateMojoSkiaGLBinding() { |
19 GrGLInterface* interface = new GrGLInterface; | 19 sk_sp<GrGLInterface> interface = sk_make_sp<GrGLInterface>(); |
20 interface->fStandard = kGLES_GrGLStandard; | 20 interface->fStandard = kGLES_GrGLStandard; |
21 interface->fExtensions.init(kGLES_GrGLStandard, glGetString, nullptr, | 21 interface->fExtensions.init(kGLES_GrGLStandard, glGetString, nullptr, |
22 glGetIntegerv); | 22 glGetIntegerv); |
23 | 23 |
24 GrGLInterface::Functions* functions = &interface->fFunctions; | 24 GrGLInterface::Functions* functions = &interface->fFunctions; |
25 functions->fActiveTexture = glActiveTexture; | 25 functions->fActiveTexture = glActiveTexture; |
26 functions->fAttachShader = glAttachShader; | 26 functions->fAttachShader = glAttachShader; |
27 functions->fBindAttribLocation = glBindAttribLocation; | 27 functions->fBindAttribLocation = glBindAttribLocation; |
28 functions->fBindBuffer = glBindBuffer; | 28 functions->fBindBuffer = glBindBuffer; |
29 functions->fBindTexture = glBindTexture; | 29 functions->fBindTexture = glBindTexture; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 functions->fBlitFramebuffer = nullptr; // TODO: Implement. | 145 functions->fBlitFramebuffer = nullptr; // TODO: Implement. |
146 functions->fGenerateMipmap = glGenerateMipmap; | 146 functions->fGenerateMipmap = glGenerateMipmap; |
147 functions->fMatrixLoadf = nullptr; // TODO: Implement. | 147 functions->fMatrixLoadf = nullptr; // TODO: Implement. |
148 functions->fMatrixLoadIdentity = nullptr; // TODO: Implement. | 148 functions->fMatrixLoadIdentity = nullptr; // TODO: Implement. |
149 | 149 |
150 return interface; | 150 return interface; |
151 } | 151 } |
152 | 152 |
153 } // namespace skia | 153 } // namespace skia |
154 } // namespace mojo | 154 } // namespace mojo |
OLD | NEW |