9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 #import "LWCToolkit.h"
27 #import "ThreadUtilities.h"
28 #include "GeomUtilities.h"
29
30 #import <JavaNativeFoundation/JavaNativeFoundation.h>
31
32 /**
33 * Some default values for invalid CoreGraphics display ID.
34 */
35 #define DEFAULT_DEVICE_WIDTH 1024
36 #define DEFAULT_DEVICE_HEIGHT 768
37 #define DEFAULT_DEVICE_DPI 72
38
39 /*
40 * Convert the mode string to the more convinient bits per pixel value
41 */
42 static int getBPPFromModeString(CFStringRef mode)
43 {
44 if ((CFStringCompare(mode, CFSTR(kIO30BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)) {
45 // This is a strange mode, where we using 10 bits per RGB component and pack it into 32 bits
46 // Java is not ready to work with this mode but we have to specify it as supported
47 return 30;
48 }
|
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 #import "LWCToolkit.h"
27 #import "ThreadUtilities.h"
28 #include "GeomUtilities.h"
29 #import <Metal/Metal.h>
30 #import <MetalKit/MetalKit.h>
31
32 #import <JavaNativeFoundation/JavaNativeFoundation.h>
33
34 /**
35 * Some default values for invalid CoreGraphics display ID.
36 */
37 #define DEFAULT_DEVICE_WIDTH 1024
38 #define DEFAULT_DEVICE_HEIGHT 768
39 #define DEFAULT_DEVICE_DPI 72
40
41 /*
42 * Convert the mode string to the more convinient bits per pixel value
43 */
44 static int getBPPFromModeString(CFStringRef mode)
45 {
46 if ((CFStringCompare(mode, CFSTR(kIO30BitDirectPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)) {
47 // This is a strange mode, where we using 10 bits per RGB component and pack it into 32 bits
48 // Java is not ready to work with this mode but we have to specify it as supported
49 return 30;
50 }
|