[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    [OpenJDK 2D-Dev] hg: macosx-port/macosx-port/jdk: Some cleanup in CAOpenGLLayer prototype (including
From:       swingler () apple ! com (Mike Swingler)
Date:       2012-10-12 1:09:16
Message-ID: 6EE749CF-9E35-4F5E-9207-42E4A64ABEF1 () apple ! com
[Download RAW message or body]

If you were a regular Cocoa app that had standard NSButtons, NSTextFields, and \
NSScrollViews, I'd say yes - you are doing it wrong...but since you tightly control \
your own view hierarchy, I don't think this is a problem. The CAOpenGLLayer breaks a \
lot of the standard rules anyway, and standard NSViews don't render into it anyway.

Perhaps overriding your own -[NSView makeBackingLayer] a better approach - but unless \
you suspect this is actually a source of bugs or leaks, I'd say don't worry about it.

Regards,
Mike Swingler
Apple Inc.

On Oct 11, 2012, at 4:44 AM, Sergey Bylokhov <Sergey.Bylokhov at oracle.com> wrote:

> Hi Mike, Phil, Dmitry, Scott.
> 
> I have a question about our CALayer implementation. According to the code below we \
> use layer-backed NSView. AWTView.m:
> [self setWantsLayer: YES];
> [self.layer addSublayer: (CALayer *)cglLayer];
> But in the documentation for NSView.setWantsLayer: "When using layer-backed views \
> you should never interact directly with the layer" So we use layer-backed NSView \
> and add our CAOpenGLLayer to the backed layer as sublayer. Because of that we use \
> NSView.drawRect and CAOpenGLLayer.drawInCGLContext simultaneously, I guess this is \
> incorrect. Is this configuration supported by Apple?
> Should we change our implementation to layer-hosting view or probably we can use \
> layer-backed view with appropriate NSView.makeBackingLayer()? 
> 01.09.2011 13:11, dmitry.cherepanov at oracle.com wrote:
> > Changeset: c6eecbe2396f
> > Author:    dcherepanov
> > Date:      2011-09-01 13:08 +0400
> > URL:       http://hg.openjdk.java.net/macosx-port/macosx-port/jdk/rev/c6eecbe2396f
> >  
> > Some cleanup in CAOpenGLLayer prototype (including extracting layer code into \
> > CGLLayer.h|m and removing stale code) 
> > ! make/sun/lwawt/FILES_c_macosx.gmk
> > ! make/sun/lwawt/FILES_c_macosx.gmk.all
> > ! src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java
> > - src/macosx/classes/sun/java2d/opengl/CGLRenderQueue.java
> > ! src/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java
> > ! src/macosx/classes/sun/lwawt/macosx/CPlatformView.java
> > ! src/macosx/native/sun/awt/AWTView.h
> > ! src/macosx/native/sun/awt/AWTView.m
> > ! src/macosx/native/sun/awt/ThreadUtilities.m
> > ! src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m
> > + src/macosx/native/sun/java2d/opengl/CGLLayer.h
> > + src/macosx/native/sun/java2d/opengl/CGLLayer.m
> > ! src/macosx/native/sun/java2d/opengl/CGLSurfaceData.m
> > ! src/share/classes/sun/java2d/opengl/OGLRenderQueue.java
> > ! src/share/classes/sun/java2d/pipe/BufferedContext.java
> > ! src/share/native/sun/java2d/opengl/OGLSurfaceData.h
> > - test/experimental/layers/ButtonTest.java
> > 
> 
> 
> -- 
> Best regards, Sergey.
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic