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