src/macosx/native/sun/java2d/opengl/CGLLayer.m
Print this page
@@ -55,13 +55,14 @@
self.javaLayer = layer;
// NOTE: async=YES means that the layer is re-cached periodically
self.asynchronous = FALSE;
- self.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable;
self.contentsGravity = kCAGravityTopLeft;
- self.needsDisplayOnBoundsChange = YES;
+ //Layer backed view
+ //self.needsDisplayOnBoundsChange = YES;
+ //self.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable;
textureID = 0; // texture will be created by rendering pipe
target = 0;
return self;
}
@@ -107,10 +108,14 @@
glBindTexture(target, 0);
glDisable(target);
}
+-(BOOL)canDrawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp{
+ return textureID == 0 ? NO : YES;
+}
+
-(void)drawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp
{
AWT_ASSERT_APPKIT_THREAD;
// Set the current context to the one given to us.