mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
WIP refactor rerender render-v2
This commit is contained in:
20
frontend/render_v2/cpp/js/preamble.js
Normal file
20
frontend/render_v2/cpp/js/preamble.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// Adds compile-time JS functions to augment Renderer interface.
|
||||
(function (Renderer) {
|
||||
console.log("preamble", Renderer);
|
||||
Renderer.setCanvas = function setCanvas(canvas, attrs) {
|
||||
console.log("GL", GL);
|
||||
debugger
|
||||
const context = GL.createContext(canvas, attrs);
|
||||
if (!context) {
|
||||
throw new Error('Could not create a new WebGL context')
|
||||
}
|
||||
GL.makeContextCurrent(context);
|
||||
|
||||
// Emscripten does not enable this by default and Skia needs this
|
||||
// to handle certain GPU corner cases.
|
||||
GL.currentContext.GLctx.getExtension('WEBGL_debug_renderer_info');
|
||||
|
||||
console.log("setCanvas", canvas, attrs);
|
||||
const gr = this._MakeGrContext();
|
||||
console.log("gr", gr);
|
||||
};
|
||||
Reference in New Issue
Block a user