modules/graphics/src/main/native-glass/mac/GlassView3D.m

Print this page

        

*** 148,157 **** --- 148,159 ---- } } } CGLContextObj clientCGL = NULL; + BOOL isSwPipe = NO; + if (jproperties != NULL) { jobject contextPtrKey = (*env)->NewStringUTF(env, "contextPtr"); jobject contextPtrValue = (*env)->CallObjectMethod(env, jproperties, jMapGetMethod, contextPtrKey); GLASS_CHECK_EXCEPTION(env);
*** 173,182 **** --- 175,185 ---- } if (sharedCGL == NULL) { // this can happen in Rain or clients other than Prism (ie. device details do not have the shared context set) sharedCGL = clientCGL; + isSwPipe = YES; } self->isHiDPIAware = NO; if (jproperties != NULL) {
*** 189,199 **** self->isHiDPIAware = (*env)->CallBooleanMethod(env, kHiDPIAwareValue, jBooleanValueMethod) ? YES : NO; GLASS_CHECK_EXCEPTION(env); } } ! GlassLayer3D *layer = [[GlassLayer3D alloc] initWithSharedContext:sharedCGL andClientContext:clientCGL withHiDPIAware:self->isHiDPIAware]; // https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/nsview_Class/Reference/NSView.html#//apple_ref/occ/instm/NSView/setWantsLayer: // the order of the following 2 calls is important: here we indicate we want a layer-hosting view { [self setLayer:layer]; --- 192,202 ---- self->isHiDPIAware = (*env)->CallBooleanMethod(env, kHiDPIAwareValue, jBooleanValueMethod) ? YES : NO; GLASS_CHECK_EXCEPTION(env); } } ! GlassLayer3D *layer = [[GlassLayer3D alloc] initWithSharedContext:sharedCGL andClientContext:clientCGL withHiDPIAware:self->isHiDPIAware withIsSwPipe:isSwPipe]; // https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/nsview_Class/Reference/NSView.html#//apple_ref/occ/instm/NSView/setWantsLayer: // the order of the following 2 calls is important: here we indicate we want a layer-hosting view { [self setLayer:layer];
*** 231,240 **** --- 234,244 ---- GlassLayer3D *layer = (GlassLayer3D*)[self layer]; [[layer getPainterOffscreen] bindForWidth:(GLuint)[self bounds].size.width andHeight:(GLuint)[self bounds].size.height]; { glDeleteTextures(1, &self->_texture); } + [[layer getPainterOffscreen] unbind]; } [[self layer] release]; [self->_delegate release]; self->_delegate = nil;
*** 603,612 **** --- 607,617 ---- self->_drawCounter--; if (self->_drawCounter == 0) { GlassLayer3D *layer = (GlassLayer3D*)[self layer]; + [[layer getPainterOffscreen] unbind]; [layer flush]; } LOG("end"); }