Do a glFlush after creating textures on the IO thread before they are used by the GPU thread (flutter/engine#3456)
Fixes https://github.com/flutter/flutter/issues/8431
This commit is contained in:
@@ -15,6 +15,10 @@
|
||||
#include "lib/tonic/typed_data/uint8_list.h"
|
||||
#include "third_party/skia/include/core/SkImageGenerator.h"
|
||||
|
||||
#ifdef OS_ANDROID
|
||||
#include <GLES2/gl2.h>
|
||||
#endif
|
||||
|
||||
using tonic::DartInvoke;
|
||||
using tonic::DartPersistentValue;
|
||||
using tonic::ToDart;
|
||||
@@ -39,6 +43,9 @@ sk_sp<SkImage> DecodeImage(sk_sp<SkData> buffer) {
|
||||
auto colorspace = SkColorSpace::MakeSRGB();
|
||||
if (auto texture_image =
|
||||
raster_image->makeTextureImage(context, colorspace.get())) {
|
||||
#ifdef OS_ANDROID
|
||||
glFlush();
|
||||
#endif
|
||||
return texture_image;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user