4632N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 4632N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4632N/A * This code is free software; you can redistribute it and/or modify it 4632N/A * under the terms of the GNU General Public License version 2 only, as 4632N/A * published by the Free Software Foundation. Oracle designates this 4632N/A * particular file as subject to the "Classpath" exception as provided 4632N/A * by Oracle in the LICENSE file that accompanied this code. 4632N/A * This code is distributed in the hope that it will be useful, but WITHOUT 4632N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 4632N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 4632N/A * version 2 for more details (a copy is included in the LICENSE file that 4632N/A * You should have received a copy of the GNU General Public License version 4632N/A * 2 along with this work; if not, write to the Free Software Foundation, 4632N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 4632N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 4632N/A * or visit www.oracle.com if you need additional information or have any 4632N/A#
import "sun_java2d_opengl_CGLSurfaceData.h" 4632N/A#
import "CGLGraphicsConfig.h" 4632N/A/* JDK's glext.h is already included and will prevent the Apple glext.h 4632N/A * being included, so define the externs directly 4632N/A * The methods in this file implement the native windowing system specific 4632N/A * layer (CGL) for the OpenGL-based Java 2D pipeline. 4632N/A// TODO: hack that's called from OGLRenderQueue to test out unlockFocus behavior 4632N/A * Makes the given context current to its associated "scratch" surface. If 4632N/A * the operation is successful, this method will return JNI_TRUE; otherwise, 4632N/A "CGLSD_MakeCurrentToScratch: context is null");
4632N/A * This function disposes of any native windowing system resources associated 4632N/A * with this surface. For instance, if the given OGLSDOps is of type 4632N/A * OGLSD_PBUFFER, this method implementation will destroy the actual pbuffer 4632N/A // detach the NSView from the NSOpenGLContext 4632N/A * Returns a pointer (as a jlong) to the native CGLGraphicsConfigInfo 4632N/A * associated with the given OGLSDOps. This method can be called from 4632N/A * shared code to retrieve the native GraphicsConfig data in a platform- 4632N/A * Makes the given GraphicsConfig's context current to its associated 4632N/A * "scratch" surface. If there is a problem making the context current, 4632N/A * this method will return NULL; otherwise, returns a pointer to the 4632N/A * OGLContext that is associated with the given GraphicsConfig. 4632N/A // avoid changing the context's target view whenever possible, since 4632N/A // calling setView causes flickering; as long as our context is current 4632N/A // to some view, it's not necessary to switch to the scratch surface 4632N/A // it seems to be necessary to explicitly flush between context changes 5040N/A // make sure our context is current 4632N/A // the GL_EXT_framebuffer_object extension is present, so this call 4632N/A // will ensure that we are bound to the scratch surface (and not 4632N/A // some other framebuffer object) 4632N/A * Makes a context current to the given source and destination 4632N/A * surfaces. If there is a problem making the context current, this method 4632N/A * will return NULL; otherwise, returns a pointer to the OGLContext that is 4632N/A * associated with the destination surface. 4632N/A // it seems to be necessary to explicitly flush between context changes 4632N/A // first make sure we have a current context (if the context isn't 4632N/A // already current to some drawable, we will make it current to 4632N/A // now bind to the fbobject associated with the destination surface; 4632N/A // this means that all rendering will go into the fbobject destination 4632N/A // (note that we unbind the currently bound texture first; this is 4632N/A // recommended procedure when binding an fbobject) 4632N/A // REMIND: pbuffers are not fully tested yet... 4632N/A // the GL_EXT_framebuffer_object extension is present, so we 4632N/A // must bind to the default (windowing system provided) 4632N/A // bind pbuffer to the render texture object (since we are preparing 4632N/A // to copy from the pbuffer) 4632N/A * This function initializes a native window surface and caches the window 4632N/A * bounds in the given OGLSDOps. Returns JNI_TRUE if the operation was 4632N/A * successful; JNI_FALSE otherwise. 4721N/A /* If there's a remote layer (being used for testing) 4721N/A * then we want to have that also receive the texture. 4721N/A * First sync. up its dimensions with that of the layer 4721N/A * we have attached to the local window and tell it that 4721N/A * it also needs to copy the texture. 4632N/A // find the maximum allowable texture dimensions (this value ultimately 4632N/A // determines our maximum pbuffer size) 4632N/A // use non-power-of-two dimensions directly 4632N/A // find the appropriate power-of-two dimensions 4632N/A // make sure the actual dimensions match those that we requested 4632N/A// Must be called on the QFT... 4632N/A // we have to explicitly tell the NSOpenGLContext that its target 4632N/A // drawable has changed size