Avoid GL calls when compiling for Fuchsia. (flutter/engine#13847)

* Avoid GL calls when compiling for Fuchsia.
This commit is contained in:
Jim Graham 2019-11-13 16:41:03 -08:00 committed by GitHub
parent 85e7580127
commit c36b203a4e

View File

@ -4,6 +4,7 @@
#include "flutter/shell/common/shell_io_manager.h"
#include "flutter/fml/build_config.h"
#include "flutter/fml/message_loop.h"
#include "flutter/shell/common/persistent_cache.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
@ -38,12 +39,14 @@ sk_sp<GrContext> ShellIOManager::CreateCompatibleResourceLoadingContext(
// ES2 shading language when the ES3 external image extension is missing.
options.fPreferExternalImagesOverES3 = true;
#if !OS_FUCHSIA
if (auto context = GrContext::MakeGL(gl_interface, options)) {
// Do not cache textures created by the image decoder. These textures
// should be deleted when they are no longer referenced by an SkImage.
context->setResourceCacheLimits(0, 0);
return context;
}
#endif
return nullptr;
}