未验证 提交 9495a52d 编写于 作者: C Chinmay Garde 提交者: GitHub

On iOS, try to use ES3, then fall back to ES2. (#5006)

上级 d6d4eec2
......@@ -14,14 +14,21 @@ namespace shell {
IOSGLContext::IOSGLContext(fml::scoped_nsobject<CAEAGLLayer> layer)
: layer_(std::move(layer)),
context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]),
resource_context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2
sharegroup:context_.get().sharegroup]),
framebuffer_(GL_NONE),
colorbuffer_(GL_NONE),
storage_size_width_(0),
storage_size_height_(0),
valid_(false) {
context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3]);
if (context_ != nullptr) {
resource_context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3
sharegroup:context_.get().sharegroup]);
} else {
context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]);
resource_context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2
sharegroup:context_.get().sharegroup]);
}
FXL_DCHECK(layer_ != nullptr);
FXL_DCHECK(context_ != nullptr);
FXL_DCHECK(resource_context_ != nullptr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册