From 5976337c948900c9d6b0dc3593e91d2abde7ab00 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 28 Feb 2017 15:50:02 -0800 Subject: [PATCH] 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 --- engine/src/flutter/lib/ui/painting/image_decoding.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/engine/src/flutter/lib/ui/painting/image_decoding.cc b/engine/src/flutter/lib/ui/painting/image_decoding.cc index 0f525f4868..78c13a3a61 100644 --- a/engine/src/flutter/lib/ui/painting/image_decoding.cc +++ b/engine/src/flutter/lib/ui/painting/image_decoding.cc @@ -15,6 +15,10 @@ #include "lib/tonic/typed_data/uint8_list.h" #include "third_party/skia/include/core/SkImageGenerator.h" +#ifdef OS_ANDROID +#include +#endif + using tonic::DartInvoke; using tonic::DartPersistentValue; using tonic::ToDart; @@ -39,6 +43,9 @@ sk_sp DecodeImage(sk_sp buffer) { auto colorspace = SkColorSpace::MakeSRGB(); if (auto texture_image = raster_image->makeTextureImage(context, colorspace.get())) { +#ifdef OS_ANDROID + glFlush(); +#endif return texture_image; } }