mirror of
https://github.com/zhigang1992/expo.git
synced 2026-06-15 01:49:56 +08:00
No need to glFlush() right before glReadPixels(...)
fbshipit-source-id: 185da7c
This commit is contained in:
committed by
Exponent GitHub Bot
parent
cbd915e611
commit
63aa6296cd
@@ -720,14 +720,12 @@ private:
|
||||
size_t byteLength = width * height * bytesPerPixel(type, format);
|
||||
auto pixels = std::shared_ptr<void>(malloc(byteLength), free);
|
||||
addBlockingToNextBatch([&] {
|
||||
glFlush();
|
||||
glReadPixels(x, y, width, height, format, type, pixels.get());
|
||||
});
|
||||
JSObjectSetTypedArrayData(jsCtx, (JSObjectRef) jsArgv[6], pixels.get(), byteLength);
|
||||
} else {
|
||||
void *pixels = JSObjectGetTypedArrayBytesPtr(jsCtx, (JSObjectRef) jsArgv[6], NULL);
|
||||
addBlockingToNextBatch([&] {
|
||||
glFlush();
|
||||
glReadPixels(x, y, width, height, format, type, pixels);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user