handle WebGL layers
This commit is contained in:
@@ -917,6 +917,9 @@ function getImageData(layer, frameState) {
|
||||
}
|
||||
const container = renderer.renderFrame(frameState, null);
|
||||
let element;
|
||||
if (container instanceof HTMLCanvasElement) {
|
||||
element = container;
|
||||
} else {
|
||||
if (container) {
|
||||
element = container.firstElementChild;
|
||||
}
|
||||
@@ -927,6 +930,7 @@ function getImageData(layer, frameState) {
|
||||
const context = element.getContext('2d');
|
||||
return context.getImageData(0, 0, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
if (!sharedContext) {
|
||||
sharedContext = createCanvasContext2D(width, height);
|
||||
|
||||
Reference in New Issue
Block a user