summaryrefslogtreecommitdiffstats
path: root/chromium/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
blob: 42f70c9550fc4a8537ba874e18d9f2a58e4e2181 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h"

#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"

using gpu::gles2::GLES2Interface;
using gpu::ContextSupport;

namespace {

class ScopedCallingGLFromSkia {
 public:
  ScopedCallingGLFromSkia(ContextSupport* context_support)
      : context_support_(context_support) {
    context_support_->WillCallGLFromSkia();
  }
  ~ScopedCallingGLFromSkia() { context_support_->DidCallGLFromSkia(); }

 private:
  ContextSupport* context_support_;
};

template <typename R, typename... Args>
GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)> gles_bind(
    R (GLES2Interface::*func)(Args...),
    GLES2Interface* gles2_interface,
    ContextSupport* context_support) {
  if (context_support->HasGrContextSupport()) {
    return [func, context_support, gles2_interface](Args... args) {
      ScopedCallingGLFromSkia guard(context_support);
      return (gles2_interface->*func)(args...);
    };
  }

  // This fallback binding should only be used by unit tests which do not care
  // about GrContext::resetContext() getting called automatically.
  return [func, gles2_interface](Args... args) {
    return (gles2_interface->*func)(args...);
  };
}
}  // namespace

namespace skia_bindings {

sk_sp<GrGLInterface> CreateGLES2InterfaceBindings(
    GLES2Interface* impl,
    ContextSupport* context_support) {
  sk_sp<GrGLInterface> interface(new GrGLInterface);
  interface->fStandard = kGLES_GrGLStandard;

  // Allowing Skia to use GL ES 3.0 caused a perf test regression (see Issue
  // 719572). Until that can be understood we are limiting to ES 2.0 (with
  // extensions).
  auto get_string = [impl](GLenum name) {
    if (name == GL_VERSION)
      return reinterpret_cast<const GLubyte*>("OpenGL ES 2.0 Chromium");
    return impl->GetString(name);
  };
  auto get_stringi =
      gles_bind(&GLES2Interface::GetStringi, impl, context_support);
  auto get_integerv =
      gles_bind(&GLES2Interface::GetIntegerv, impl, context_support);
  interface->fExtensions.init(kGLES_GrGLStandard, get_string, get_stringi,
                              get_integerv);

  GrGLInterface::Functions* functions = &interface->fFunctions;
  functions->fActiveTexture =
      gles_bind(&GLES2Interface::ActiveTexture, impl, context_support);
  functions->fAttachShader =
      gles_bind(&GLES2Interface::AttachShader, impl, context_support);
  functions->fBindAttribLocation =
      gles_bind(&GLES2Interface::BindAttribLocation, impl, context_support);
  functions->fBindBuffer =
      gles_bind(&GLES2Interface::BindBuffer, impl, context_support);
  functions->fBindTexture =
      gles_bind(&GLES2Interface::BindTexture, impl, context_support);
  functions->fBindVertexArray =
      gles_bind(&GLES2Interface::BindVertexArrayOES, impl, context_support);
  functions->fBlendBarrier =
      gles_bind(&GLES2Interface::BlendBarrierKHR, impl, context_support);
  functions->fBlendColor =
      gles_bind(&GLES2Interface::BlendColor, impl, context_support);
  functions->fBlendEquation =
      gles_bind(&GLES2Interface::BlendEquation, impl, context_support);
  functions->fBlendFunc =
      gles_bind(&GLES2Interface::BlendFunc, impl, context_support);
  functions->fBufferData =
      gles_bind(&GLES2Interface::BufferData, impl, context_support);
  functions->fBufferSubData =
      gles_bind(&GLES2Interface::BufferSubData, impl, context_support);
  functions->fClear = gles_bind(&GLES2Interface::Clear, impl, context_support);
  functions->fClearColor =
      gles_bind(&GLES2Interface::ClearColor, impl, context_support);
  functions->fClearStencil =
      gles_bind(&GLES2Interface::ClearStencil, impl, context_support);
  functions->fClientWaitSync =
      gles_bind(&GLES2Interface::ClientWaitSync, impl, context_support);
  functions->fColorMask =
      gles_bind(&GLES2Interface::ColorMask, impl, context_support);
  functions->fCompileShader =
      gles_bind(&GLES2Interface::CompileShader, impl, context_support);
  functions->fCompressedTexImage2D =
      gles_bind(&GLES2Interface::CompressedTexImage2D, impl, context_support);
  functions->fCompressedTexSubImage2D = gles_bind(
      &GLES2Interface::CompressedTexSubImage2D, impl, context_support);
  functions->fCopyTexSubImage2D =
      gles_bind(&GLES2Interface::CopyTexSubImage2D, impl, context_support);
  functions->fCreateProgram =
      gles_bind(&GLES2Interface::CreateProgram, impl, context_support);
  functions->fCreateShader =
      gles_bind(&GLES2Interface::CreateShader, impl, context_support);
  functions->fCullFace =
      gles_bind(&GLES2Interface::CullFace, impl, context_support);
  functions->fDeleteBuffers =
      gles_bind(&GLES2Interface::DeleteBuffers, impl, context_support);
  functions->fDeleteProgram =
      gles_bind(&GLES2Interface::DeleteProgram, impl, context_support);
  functions->fDeleteShader =
      gles_bind(&GLES2Interface::DeleteShader, impl, context_support);
  functions->fDeleteSync =
      gles_bind(&GLES2Interface::DeleteSync, impl, context_support);
  functions->fDeleteTextures =
      gles_bind(&GLES2Interface::DeleteTextures, impl, context_support);
  functions->fDeleteVertexArrays =
      gles_bind(&GLES2Interface::DeleteVertexArraysOES, impl, context_support);
  functions->fDepthMask =
      gles_bind(&GLES2Interface::DepthMask, impl, context_support);
  functions->fDisable =
      gles_bind(&GLES2Interface::Disable, impl, context_support);
  functions->fDisableVertexAttribArray = gles_bind(
      &GLES2Interface::DisableVertexAttribArray, impl, context_support);
  functions->fDiscardFramebuffer =
      gles_bind(&GLES2Interface::DiscardFramebufferEXT, impl, context_support);
  functions->fDrawArrays =
      gles_bind(&GLES2Interface::DrawArrays, impl, context_support);
  functions->fDrawArraysInstanced = gles_bind(
      &GLES2Interface::DrawArraysInstancedANGLE, impl, context_support);
  functions->fDrawBuffers =
      gles_bind(&GLES2Interface::DrawBuffersEXT, impl, context_support);
  functions->fDrawElements =
      gles_bind(&GLES2Interface::DrawElements, impl, context_support);
  functions->fDrawElementsInstanced = gles_bind(
      &GLES2Interface::DrawElementsInstancedANGLE, impl, context_support);
  functions->fDrawRangeElements =
      gles_bind(&GLES2Interface::DrawRangeElements, impl, context_support);
  functions->fEnable =
      gles_bind(&GLES2Interface::Enable, impl, context_support);
  functions->fEnableVertexAttribArray = gles_bind(
      &GLES2Interface::EnableVertexAttribArray, impl, context_support);
  functions->fEndQuery =
      gles_bind(&GLES2Interface::EndQueryEXT, impl, context_support);
  functions->fFenceSync =
      gles_bind(&GLES2Interface::FenceSync, impl, context_support);
  functions->fFinish =
      gles_bind(&GLES2Interface::Finish, impl, context_support);
  functions->fFlush = gles_bind(&GLES2Interface::Flush, impl, context_support);
  functions->fFlushMappedBufferRange =
      gles_bind(&GLES2Interface::FlushMappedBufferRange, impl, context_support);
  functions->fFrontFace =
      gles_bind(&GLES2Interface::FrontFace, impl, context_support);
  functions->fGenBuffers =
      gles_bind(&GLES2Interface::GenBuffers, impl, context_support);
  functions->fGenTextures =
      gles_bind(&GLES2Interface::GenTextures, impl, context_support);
  functions->fGenVertexArrays =
      gles_bind(&GLES2Interface::GenVertexArraysOES, impl, context_support);
  functions->fGetBufferParameteriv =
      gles_bind(&GLES2Interface::GetBufferParameteriv, impl, context_support);
  functions->fGetError =
      gles_bind(&GLES2Interface::GetError, impl, context_support);
  functions->fGetIntegerv = get_integerv;
  functions->fGetInternalformativ =
      gles_bind(&GLES2Interface::GetInternalformativ, impl, context_support);
  functions->fGetProgramInfoLog =
      gles_bind(&GLES2Interface::GetProgramInfoLog, impl, context_support);
  functions->fGetProgramiv =
      gles_bind(&GLES2Interface::GetProgramiv, impl, context_support);
  functions->fGetQueryiv =
      gles_bind(&GLES2Interface::GetQueryivEXT, impl, context_support);
  functions->fGetQueryObjectuiv =
      gles_bind(&GLES2Interface::GetQueryObjectuivEXT, impl, context_support);
  functions->fGetShaderInfoLog =
      gles_bind(&GLES2Interface::GetShaderInfoLog, impl, context_support);
  functions->fGetShaderiv =
      gles_bind(&GLES2Interface::GetShaderiv, impl, context_support);
  functions->fGetShaderPrecisionFormat = gles_bind(
      &GLES2Interface::GetShaderPrecisionFormat, impl, context_support);
  functions->fGetString = get_string;
  functions->fGetStringi = get_stringi;
  functions->fGetUniformLocation =
      gles_bind(&GLES2Interface::GetUniformLocation, impl, context_support);
  functions->fInsertEventMarker =
      gles_bind(&GLES2Interface::InsertEventMarkerEXT, impl, context_support);
  functions->fInvalidateFramebuffer =
      gles_bind(&GLES2Interface::InvalidateFramebuffer, impl, context_support);
  functions->fInvalidateSubFramebuffer = gles_bind(
      &GLES2Interface::InvalidateSubFramebuffer, impl, context_support);
  functions->fIsSync =
      gles_bind(&GLES2Interface::IsSync, impl, context_support);
  functions->fIsTexture =
      gles_bind(&GLES2Interface::IsTexture, impl, context_support);
  functions->fLineWidth =
      gles_bind(&GLES2Interface::LineWidth, impl, context_support);
  functions->fLinkProgram =
      gles_bind(&GLES2Interface::LinkProgram, impl, context_support);
  functions->fMapBufferRange =
      gles_bind(&GLES2Interface::MapBufferRange, impl, context_support);
  functions->fMapBufferSubData = gles_bind(
      &GLES2Interface::MapBufferSubDataCHROMIUM, impl, context_support);
  functions->fMapTexSubImage2D = gles_bind(
      &GLES2Interface::MapTexSubImage2DCHROMIUM, impl, context_support);
  functions->fPixelStorei =
      gles_bind(&GLES2Interface::PixelStorei, impl, context_support);
  functions->fPopGroupMarker =
      gles_bind(&GLES2Interface::PopGroupMarkerEXT, impl, context_support);
  functions->fPushGroupMarker =
      gles_bind(&GLES2Interface::PushGroupMarkerEXT, impl, context_support);
  functions->fReadBuffer =
      gles_bind(&GLES2Interface::ReadBuffer, impl, context_support);
  functions->fReadPixels =
      gles_bind(&GLES2Interface::ReadPixels, impl, context_support);
  functions->fScissor =
      gles_bind(&GLES2Interface::Scissor, impl, context_support);
  functions->fShaderSource =
      gles_bind(&GLES2Interface::ShaderSource, impl, context_support);
  functions->fStencilFunc =
      gles_bind(&GLES2Interface::StencilFunc, impl, context_support);
  functions->fStencilFuncSeparate =
      gles_bind(&GLES2Interface::StencilFuncSeparate, impl, context_support);
  functions->fStencilMask =
      gles_bind(&GLES2Interface::StencilMask, impl, context_support);
  functions->fStencilMaskSeparate =
      gles_bind(&GLES2Interface::StencilMaskSeparate, impl, context_support);
  functions->fStencilOp =
      gles_bind(&GLES2Interface::StencilOp, impl, context_support);
  functions->fStencilOpSeparate =
      gles_bind(&GLES2Interface::StencilOpSeparate, impl, context_support);
  functions->fTexImage2D =
      gles_bind(&GLES2Interface::TexImage2D, impl, context_support);
  functions->fTexParameteri =
      gles_bind(&GLES2Interface::TexParameteri, impl, context_support);
  functions->fTexParameteriv =
      gles_bind(&GLES2Interface::TexParameteriv, impl, context_support);
  functions->fTexStorage2D =
      gles_bind(&GLES2Interface::TexStorage2DEXT, impl, context_support);
  functions->fTexSubImage2D =
      gles_bind(&GLES2Interface::TexSubImage2D, impl, context_support);
  functions->fUniform1f =
      gles_bind(&GLES2Interface::Uniform1f, impl, context_support);
  functions->fUniform1i =
      gles_bind(&GLES2Interface::Uniform1i, impl, context_support);
  functions->fUniform1fv =
      gles_bind(&GLES2Interface::Uniform1fv, impl, context_support);
  functions->fUniform1iv =
      gles_bind(&GLES2Interface::Uniform1iv, impl, context_support);
  functions->fUniform2f =
      gles_bind(&GLES2Interface::Uniform2f, impl, context_support);
  functions->fUniform2i =
      gles_bind(&GLES2Interface::Uniform2i, impl, context_support);
  functions->fUniform2fv =
      gles_bind(&GLES2Interface::Uniform2fv, impl, context_support);
  functions->fUniform2iv =
      gles_bind(&GLES2Interface::Uniform2iv, impl, context_support);
  functions->fUniform3f =
      gles_bind(&GLES2Interface::Uniform3f, impl, context_support);
  functions->fUniform3i =
      gles_bind(&GLES2Interface::Uniform3i, impl, context_support);
  functions->fUniform3fv =
      gles_bind(&GLES2Interface::Uniform3fv, impl, context_support);
  functions->fUniform3iv =
      gles_bind(&GLES2Interface::Uniform3iv, impl, context_support);
  functions->fUniform4f =
      gles_bind(&GLES2Interface::Uniform4f, impl, context_support);
  functions->fUniform4i =
      gles_bind(&GLES2Interface::Uniform4i, impl, context_support);
  functions->fUniform4fv =
      gles_bind(&GLES2Interface::Uniform4fv, impl, context_support);
  functions->fUniform4iv =
      gles_bind(&GLES2Interface::Uniform4iv, impl, context_support);
  functions->fUniformMatrix2fv =
      gles_bind(&GLES2Interface::UniformMatrix2fv, impl, context_support);
  functions->fUniformMatrix3fv =
      gles_bind(&GLES2Interface::UniformMatrix3fv, impl, context_support);
  functions->fUniformMatrix4fv =
      gles_bind(&GLES2Interface::UniformMatrix4fv, impl, context_support);
  functions->fUnmapBufferSubData = gles_bind(
      &GLES2Interface::UnmapBufferSubDataCHROMIUM, impl, context_support);
  functions->fUnmapTexSubImage2D = gles_bind(
      &GLES2Interface::UnmapTexSubImage2DCHROMIUM, impl, context_support);
  functions->fUseProgram =
      gles_bind(&GLES2Interface::UseProgram, impl, context_support);
  functions->fVertexAttrib1f =
      gles_bind(&GLES2Interface::VertexAttrib1f, impl, context_support);
  functions->fVertexAttrib2fv =
      gles_bind(&GLES2Interface::VertexAttrib2fv, impl, context_support);
  functions->fVertexAttrib3fv =
      gles_bind(&GLES2Interface::VertexAttrib3fv, impl, context_support);
  functions->fVertexAttrib4fv =
      gles_bind(&GLES2Interface::VertexAttrib4fv, impl, context_support);
  functions->fVertexAttribDivisor = gles_bind(
      &GLES2Interface::VertexAttribDivisorANGLE, impl, context_support);
  functions->fVertexAttribPointer =
      gles_bind(&GLES2Interface::VertexAttribPointer, impl, context_support);
  functions->fVertexAttribIPointer =
      gles_bind(&GLES2Interface::VertexAttribIPointer, impl, context_support);
  functions->fViewport =
      gles_bind(&GLES2Interface::Viewport, impl, context_support);
  functions->fWaitSync =
      gles_bind(&GLES2Interface::WaitSync, impl, context_support);
  functions->fBindFramebuffer =
      gles_bind(&GLES2Interface::BindFramebuffer, impl, context_support);
  functions->fBeginQuery =
      gles_bind(&GLES2Interface::BeginQueryEXT, impl, context_support);
  functions->fBindRenderbuffer =
      gles_bind(&GLES2Interface::BindRenderbuffer, impl, context_support);
  functions->fCheckFramebufferStatus =
      gles_bind(&GLES2Interface::CheckFramebufferStatus, impl, context_support);
  functions->fDeleteFramebuffers =
      gles_bind(&GLES2Interface::DeleteFramebuffers, impl, context_support);
  functions->fDeleteQueries =
      gles_bind(&GLES2Interface::DeleteQueriesEXT, impl, context_support);
  functions->fDeleteRenderbuffers =
      gles_bind(&GLES2Interface::DeleteRenderbuffers, impl, context_support);
  functions->fFramebufferRenderbuffer = gles_bind(
      &GLES2Interface::FramebufferRenderbuffer, impl, context_support);
  functions->fFramebufferTexture2D =
      gles_bind(&GLES2Interface::FramebufferTexture2D, impl, context_support);
  functions->fFramebufferTexture2DMultisample =
      gles_bind(&GLES2Interface::FramebufferTexture2DMultisampleEXT, impl,
                context_support);
  functions->fGenFramebuffers =
      gles_bind(&GLES2Interface::GenFramebuffers, impl, context_support);
  functions->fGenRenderbuffers =
      gles_bind(&GLES2Interface::GenRenderbuffers, impl, context_support);
  functions->fGetFramebufferAttachmentParameteriv =
      gles_bind(&GLES2Interface::GetFramebufferAttachmentParameteriv, impl,
                context_support);
  functions->fGetRenderbufferParameteriv = gles_bind(
      &GLES2Interface::GetRenderbufferParameteriv, impl, context_support);
  functions->fGenQueries =
      gles_bind(&GLES2Interface::GenQueriesEXT, impl, context_support);
  functions->fRenderbufferStorage =
      gles_bind(&GLES2Interface::RenderbufferStorage, impl, context_support);
  functions->fRenderbufferStorageMultisample =
      gles_bind(&GLES2Interface::RenderbufferStorageMultisampleCHROMIUM, impl,
                context_support);
  functions->fRenderbufferStorageMultisampleES2EXT =
      gles_bind(&GLES2Interface::RenderbufferStorageMultisampleEXT, impl,
                context_support);
  functions->fBindFragDataLocation = gles_bind(
      &GLES2Interface::BindFragDataLocationEXT, impl, context_support);
  functions->fBindFragDataLocationIndexed = gles_bind(
      &GLES2Interface::BindFragDataLocationIndexedEXT, impl, context_support);
  functions->fBindUniformLocation = gles_bind(
      &GLES2Interface::BindUniformLocationCHROMIUM, impl, context_support);
  functions->fBlitFramebuffer = gles_bind(
      &GLES2Interface::BlitFramebufferCHROMIUM, impl, context_support);
  functions->fGenerateMipmap =
      gles_bind(&GLES2Interface::GenerateMipmap, impl, context_support);
  functions->fMatrixLoadf =
      gles_bind(&GLES2Interface::MatrixLoadfCHROMIUM, impl, context_support);
  functions->fMatrixLoadIdentity = gles_bind(
      &GLES2Interface::MatrixLoadIdentityCHROMIUM, impl, context_support);
  functions->fPathCommands =
      gles_bind(&GLES2Interface::PathCommandsCHROMIUM, impl, context_support);
  functions->fPathParameteri =
      gles_bind(&GLES2Interface::PathParameteriCHROMIUM, impl, context_support);
  functions->fPathParameterf =
      gles_bind(&GLES2Interface::PathParameterfCHROMIUM, impl, context_support);
  functions->fGenPaths =
      gles_bind(&GLES2Interface::GenPathsCHROMIUM, impl, context_support);
  functions->fIsPath =
      gles_bind(&GLES2Interface::IsPathCHROMIUM, impl, context_support);
  functions->fDeletePaths =
      gles_bind(&GLES2Interface::DeletePathsCHROMIUM, impl, context_support);
  functions->fPathStencilFunc = gles_bind(
      &GLES2Interface::PathStencilFuncCHROMIUM, impl, context_support);
  functions->fStencilFillPath = gles_bind(
      &GLES2Interface::StencilFillPathCHROMIUM, impl, context_support);
  functions->fStencilStrokePath = gles_bind(
      &GLES2Interface::StencilStrokePathCHROMIUM, impl, context_support);
  functions->fCoverFillPath =
      gles_bind(&GLES2Interface::CoverFillPathCHROMIUM, impl, context_support);
  functions->fCoverStrokePath = gles_bind(
      &GLES2Interface::CoverStrokePathCHROMIUM, impl, context_support);
  functions->fStencilThenCoverFillPath = gles_bind(
      &GLES2Interface::StencilThenCoverFillPathCHROMIUM, impl, context_support);
  functions->fStencilThenCoverStrokePath =
      gles_bind(&GLES2Interface::StencilThenCoverStrokePathCHROMIUM, impl,
                context_support);
  functions->fStencilFillPathInstanced = gles_bind(
      &GLES2Interface::StencilFillPathInstancedCHROMIUM, impl, context_support);
  functions->fStencilStrokePathInstanced =
      gles_bind(&GLES2Interface::StencilStrokePathInstancedCHROMIUM, impl,
                context_support);
  functions->fCoverFillPathInstanced = gles_bind(
      &GLES2Interface::CoverFillPathInstancedCHROMIUM, impl, context_support);
  functions->fCoverStrokePathInstanced = gles_bind(
      &GLES2Interface::CoverStrokePathInstancedCHROMIUM, impl, context_support);
  functions->fStencilThenCoverFillPathInstanced =
      gles_bind(&GLES2Interface::StencilThenCoverFillPathInstancedCHROMIUM,
                impl, context_support);
  functions->fStencilThenCoverStrokePathInstanced =
      gles_bind(&GLES2Interface::StencilThenCoverStrokePathInstancedCHROMIUM,
                impl, context_support);
  functions->fProgramPathFragmentInputGen =
      gles_bind(&GLES2Interface::ProgramPathFragmentInputGenCHROMIUM, impl,
                context_support);
  functions->fBindFragmentInputLocation =
      gles_bind(&GLES2Interface::BindFragmentInputLocationCHROMIUM, impl,
                context_support);
  functions->fCoverageModulation = gles_bind(
      &GLES2Interface::CoverageModulationCHROMIUM, impl, context_support);
  functions->fWindowRectangles =
      gles_bind(&GLES2Interface::WindowRectanglesEXT, impl, context_support);
  return interface;
}

}  // namespace skia_bindings