am 3aca01d3: am 2683b10b: Merge "opengl translator: Mac fixes for unbind context"

* commit '3aca01d3b03bdb2e312ff302d04eb36034f09384':
  opengl translator: Mac fixes for unbind context
This commit is contained in:
David Turner
2011-07-06 07:46:24 -07:00
committed by Android Git Automerger
2 changed files with 21 additions and 13 deletions

View File

@@ -156,6 +156,17 @@ bool destroyContext(EGLNativeDisplayType dpy,EGLNativeContextType ctx) {
}
bool makeCurrent(EGLNativeDisplayType dpy,EglSurface* read,EglSurface* draw,EGLNativeContextType ctx){
// check for unbind
if (ctx == NULL && read == NULL && draw == NULL) {
nsWindowMakeCurrent(NULL, NULL);
return true;
}
else if (ctx == NULL || read == NULL || draw == NULL) {
// error !
return false;
}
//dont supporting diffrent read & draw surfaces on Mac
if(read->native() != draw->native()) return false;
switch(draw->type()){

View File

@@ -60,14 +60,11 @@ void nsWindowMakeCurrent(void* context,void* nativeWin){
NSView* win = (NSView *)nativeWin;
if(ctx == nil){
[NSOpenGLContext clearCurrentContext];
} else {
if(win != nil){
[ctx clearDrawable];
} else if (win != nil) {
[ctx setView: win];
[ctx makeCurrentContext];
}
}
}
void nsSwapBuffers(){
NSOpenGLContext* ctx = [NSOpenGLContext currentContext];