summaryrefslogtreecommitdiffstats
path: root/gfx/gl/GLContextProviderEAGL.mm
diff options
context:
space:
mode:
authorathenian200 <athenian200@outlook.com>2020-01-27 22:59:08 -0600
committerathenian200 <athenian200@outlook.com>2020-01-27 22:59:08 -0600
commit3c4f414db74b84f7d2a6fb13fd888a47a153699b (patch)
treeea81fca559849967a79d598a6f460830762ec9ea /gfx/gl/GLContextProviderEAGL.mm
parent1f8d508258ac5d7d57fc4eb35cac90f28bc8ca03 (diff)
parentc4b0715baaffc541670fd1158557aa7e61e521d3 (diff)
downloadUXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar
UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar.gz
UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar.lz
UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.tar.xz
UXP-3c4f414db74b84f7d2a6fb13fd888a47a153699b.zip
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into form-disabled-issue
Diffstat (limited to 'gfx/gl/GLContextProviderEAGL.mm')
-rw-r--r--gfx/gl/GLContextProviderEAGL.mm41
1 files changed, 15 insertions, 26 deletions
diff --git a/gfx/gl/GLContextProviderEAGL.mm b/gfx/gl/GLContextProviderEAGL.mm
index 507616e2f..11c7cce77 100644
--- a/gfx/gl/GLContextProviderEAGL.mm
+++ b/gfx/gl/GLContextProviderEAGL.mm
@@ -36,35 +36,24 @@ GLContextEAGL::GLContextEAGL(CreateContextFlags flags, const SurfaceCaps& caps,
GLContextEAGL::~GLContextEAGL()
{
- MakeCurrent();
-
- if (mBackbufferFB) {
- fDeleteFramebuffers(1, &mBackbufferFB);
- }
-
- if (mBackbufferRB) {
- fDeleteRenderbuffers(1, &mBackbufferRB);
+ if (MakeCurrent()) {
+ if (mBackbufferFB) {
+ fDeleteFramebuffers(1, &mBackbufferFB);
+ }
+ if (mBackbufferRB) {
+ fDeleteRenderbuffers(1, &mBackbufferRB);
+ }
}
+ mLayer = nil;
MarkDestroyed();
-
- if (mLayer) {
- mLayer = nil;
- }
-
- if (mContext) {
- [EAGLContext setCurrentContext:nil];
- [mContext release];
- }
+ [mContext release];
}
bool
GLContextEAGL::Init()
{
- if (!InitWithPrefix("gl", true))
- return false;
-
- return true;
+ return InitWithPrefix("gl", true);
}
bool
@@ -120,12 +109,12 @@ GLContextEAGL::MakeCurrentImpl(bool aForce)
return true;
}
- if (mContext) {
- if(![EAGLContext setCurrentContext:mContext]) {
- return false;
- }
+ if (IsDestroyed()) {
+ [EAGLContext setCurrentContext:nil];
+ return false;
}
- return true;
+
+ return [EAGLContext setCurrentContext:mContext];
}
bool