skia2/tools/gpu/gl/interface
Kevin Lubick 2f9a098439 [canvaskit] Remove getproc when creating WebGL interface
This saves about 15kb of wasm code size (4kb gzipped), 11kb
of JS code size (2kb gzipped) and about 10ms
when creating a new surface (~35ms -> 25ms in a local test).

This also gates the webgl code more strongly (off unless you
really request it), since the headers won't be available
except in an emscripten environment.

Change-Id: I303f6c342c72e7cfe29be241f55ae8f5631a3f75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311916
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-08-20 14:55:50 +00:00
..
gen_interface.go Reland "Get EGLimage functions out of GrGLInterface." 2019-05-15 19:58:45 +00:00
interface.json5 Implement indirect draws with ANGLE's multi draw extension 2020-07-17 21:18:53 +00:00
Makefile Reland "Generate GrGLInterface and GrGlAssembleInterface* from table" 2019-03-26 10:55:00 +00:00
README.md Reland "Generate GrGLInterface and GrGlAssembleInterface* from table" 2019-03-26 10:55:00 +00:00
templates.go [canvaskit] Remove getproc when creating WebGL interface 2020-08-20 14:55:50 +00:00

GrGlInterface Autogeneration

Background

At a high level, the first three steps of making a GrGLInterface (a generic way to interact with a GL-like GPU) are:

  • Assemble: Copy a set of function pointers into the struct
  • Validate: Make sure the function pointers advertised actually exist.
  • Capabilities: Compute what fast/slow paths are enabled based on the functions in the struct (GrGLCaps, for short)

Autogeneration

The first two steps have been automated with a table-based generation script located in this folder. The table is in JSON5 format (like JSON, but with comments). O

Once edited, the Assemble/Validate code can be re-generated by running make generate in this folder.