Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8260931: Implement JEP 382: New macOS Rendering Pipeline #2403

Closed
wants to merge 47 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0b8d96b
Project Lanai Patch
aghaisas Feb 4, 2021
5476874
Merge branch 'master' into 8260931_lanai_JEP_branch
aghaisas Feb 8, 2021
8ed7b5f
Lanai PR#174 - 8261234 - kcr
aghaisas Feb 8, 2021
6044adc
Lanai PR#175 - 8261304 - aghaisas
aghaisas Feb 8, 2021
fdf3be9
Lanai PR#176 - 8261399 - jdv
aghaisas Feb 9, 2021
6417328
Lanai PR#177 - 8261430 - aghaisas
aghaisas Feb 9, 2021
9a72538
Merge branch 'master' into 8260931_lanai_JEP_branch
aghaisas Feb 11, 2021
9c13bb3
Lanai PR#178 - 8261273 - avu
aghaisas Feb 11, 2021
6a3f96e
Lanai PR#179 - 8261402 - avu
aghaisas Feb 11, 2021
102494b
Lanai PR#180 - 8261546 - jdv
aghaisas Feb 11, 2021
7340d06
Lanai PR#181 - 8261143 - aghaisas
aghaisas Feb 11, 2021
a7df89b
Merge branch 'master' into 8260931_lanai_JEP_branch
aghaisas Feb 15, 2021
edf247d
Lanai PR#182 - 8261547 - psadhukhan
aghaisas Feb 15, 2021
8b5bf34
Lanai PR#184 - 8261620 - aghaisas
aghaisas Feb 15, 2021
d2548e0
Lanai PR#185 - 8261632 - jdv
aghaisas Feb 15, 2021
0d8aedc
Lanai PR#186 - 8261638 - avu
aghaisas Feb 15, 2021
3942a5b
Lanai PR#187 - 8261704 - jdv
aghaisas Feb 15, 2021
90af90d
Lanai PR#189 - 8261712 - avu
aghaisas Feb 15, 2021
1c0c0c1
Lanai PR#190 - 8261706 - jdv
aghaisas Feb 15, 2021
7b0b0dc
Lanai PR#191 - 8261705 - jdv
aghaisas Feb 15, 2021
10ebb70
Merge branch 'master' into 8260931_lanai_JEP_branch
aghaisas Feb 21, 2021
9432c5a
Lanai PR#192 - 8261789 - aghaisas
aghaisas Feb 21, 2021
68220fb
Lanai PR#193 - 8261734 - avu
aghaisas Feb 21, 2021
30284b9
Lanai PR#194 - 8261703 - jdv
aghaisas Feb 21, 2021
e2f78dd
Lanai PR#195 - 8261908 - jdv
aghaisas Feb 21, 2021
1e0ff66
Lanai PR#196 - 8260715 - avu
aghaisas Feb 21, 2021
8c598a6
Lanai PR#197 - 8261960 - jdv
aghaisas Feb 21, 2021
a2983f0
Lanai PR#198 - 8261646 - avu
aghaisas Feb 21, 2021
614be05
Lanai PR#199 - 8262091 - aghaisas
aghaisas Feb 21, 2021
30dab8d
Merge branch 'master' into 8260931_lanai_JEP_branch
aghaisas Mar 1, 2021
bf888a2
Lanai PR#200 - 8262115 - aghaisas
aghaisas Mar 1, 2021
6e2e528
Lanai PR#201 - 8261891 - avu
aghaisas Mar 1, 2021
9059255
Lanai PR#202 - 8262293 - avu
aghaisas Mar 1, 2021
e0fbc42
Lanai PR#203 - 8262313 - jdv
aghaisas Mar 1, 2021
c9ebcbc
Lanai PR#205 - 8262496 - avu
aghaisas Mar 1, 2021
5cb1fd9
Lanai PR#206 - 8262729 - aghaisas
aghaisas Mar 1, 2021
09519fd
Merge branch 'master' into 8260931_lanai_JEP_branch
aghaisas Mar 8, 2021
3995be1
Lanai PR#207 - 8262750 - jdv
aghaisas Mar 8, 2021
5660744
Lanai PR#208 - 8262928 - jdv
aghaisas Mar 8, 2021
e459f1a
Lanai PR#209 - 8262936 - jdv
aghaisas Mar 8, 2021
de45693
Lanai PR#210 - 8263159 - jdv
aghaisas Mar 8, 2021
b065a49
Merge branch 'master' into 8260931_lanai_JEP_branch
aghaisas Mar 10, 2021
d27ff90
Lanai PR#211 - 8262882 - aghaisas
aghaisas Mar 10, 2021
9a27831
Lanai PR#212 - 8259825 - aghaisas
aghaisas Mar 10, 2021
3980ecb
Lanai PR#213 - 8263325 - avu
aghaisas Mar 10, 2021
c4309ab
Merge branch 'master' into 8260931_lanai_JEP_branch
aghaisas Mar 11, 2021
369c3d2
Lanai PR#214 - 8263324 - avu
aghaisas Mar 11, 2021
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -189,18 +189,18 @@ private void deliverMouseEvent(final NSEvent event) {

if (event.getType() == CocoaConstants.NSScrollWheel) {
responder.handleScrollEvent(x, y, absX, absY, event.getModifierFlags(),
event.getScrollDeltaX(), event.getScrollDeltaY(),
event.getScrollPhase());
event.getScrollDeltaX(), event.getScrollDeltaY(),
event.getScrollPhase());
} else {
responder.handleMouseEvent(event.getType(), event.getModifierFlags(), event.getButtonNumber(),
event.getClickCount(), x, y,
absX, absY);
event.getClickCount(), x, y,
absX, absY);
}
}

private void deliverKeyEvent(NSEvent event) {
responder.handleKeyEvent(event.getType(), event.getModifierFlags(), event.getCharacters(),
event.getCharactersIgnoringModifiers(), event.getKeyCode(), true, false);
event.getCharactersIgnoringModifiers(), event.getKeyCode(), true, false);
}

/**
@@ -223,8 +223,8 @@ public void setVisible(boolean visible) {
owner.execute(ownerPtr -> {
execute(ptr -> {
CWrapper.NSWindow.orderWindow(ptr,
CWrapper.NSWindow.NSWindowAbove,
ownerPtr);
CWrapper.NSWindow.NSWindowAbove,
ownerPtr);
});
});

@@ -367,7 +367,7 @@ private void updateIconSize() {
currentSize = newSize;
IconInfo ico = getSecurityIconInfo(currentSize, 0);
AWTAccessor.getWindowAccessor().setSecurityWarningSize(
ownerWindow, ico.getWidth(), ico.getHeight());
ownerWindow, ico.getWidth(), ico.getHeight());
}
}
}
@@ -379,7 +379,7 @@ private Graphics getGraphics() {
}

return new SunGraphics2D(sd, SystemColor.windowText, SystemColor.window,
ownerWindow.getFont());
ownerWindow.getFont());
}


@@ -44,7 +44,7 @@
* for example destination, stencil, or any other property of MTLRenderPassDescriptor)
* 2. Updates 'mutable' properties encoder: pipelineState (with corresponding buffers), clip, transform, e.t.c. To avoid
* unnecessary calls of [encoder setXXX] this manager compares requested state with cached one.
* */
*/
@interface EncoderManager : NSObject
- (id _Nonnull)init;
- (void)dealloc;
@@ -201,7 +201,7 @@ - (void)updatePipelineState:(id<MTLRenderCommandEncoder>)encoder
- (void) updateClip:(id<MTLRenderCommandEncoder>)encoder clip:(MTLClip *)clip forceUpdate:(jboolean)forceUpdate
{
if (clip.stencilMaskGenerationInProgress == JNI_TRUE) {
// don't set setScissorOrStencil when generateion in progress
// don't set setScissorOrStencil when generation in progress
return;
}

@@ -79,7 +79,7 @@
(JNIEnv *env, jclass mtlgc)
{
FILE *f = popen("/usr/sbin/system_profiler SPDisplaysDataType", "r");
This conversation was marked as resolved by aghaisas

This comment has been minimized.

@kevinrushforth

kevinrushforth Feb 5, 2021
Member Outdated

How robust is this? It seems like the contents of this could be an implementation detail and subject to change. Is it documented by Apple?

This comment has been minimized.

@mrserb

mrserb Mar 7, 2021
Member Outdated

I suggest fixing this before the integration.

This comment has been minimized.

@aghaisas

aghaisas Mar 11, 2021
Author Contributor Outdated

Fixed with JDK-8259825.

bool metalSupported = JNI_FALSE;
jboolean metalSupported = JNI_FALSE;
while (getc(f) != EOF)
{
char str[60];
@@ -37,8 +37,8 @@
@class MTLPipelineStatesStorage;

/**
* The MTLPaint class represents paint mode (color, gradient, e.t.c.)
* */
* The MTLPaint class represents paint mode (color, gradient etc.)
*/

@interface MTLPaint : NSObject

@@ -34,12 +34,12 @@
#include "Trace.h"

/**
* The MTLSDOps structure describes a native OpenGL surface and contains all
* The MTLSDOps structure describes a native Metal surface and contains all
* information pertaining to the native surface. Some information about
* the more important/different fields:
*
* void *privOps;
* Pointer to native-specific (GLX, WGL, etc.) SurfaceData info, such as the
* Pointer to native-specific (Metal) SurfaceData info, such as the
* native Drawable handle and GraphicsConfig data.
*
* jint drawableType;
@@ -53,11 +53,6 @@
* to disable writes into the alpha channel) to ensure that the surface
* remains fully opaque.
*
* jboolean needsInit;
* If true, the surface requires some one-time initialization, which should
* be performed after a context has been made current to the surface for
* the first time.
*
* jint x/yOffset
* The offset in pixels of the Metal viewport origin from the lower-left
* corner of the heavyweight drawable. For example, a top-level frame on
@@ -83,15 +78,9 @@
* value is null, the texture has not yet been initialized.
*
* jint textureWidth/Height;
* The actual bounds of the texture object for this surface. If the
* GL_ARB_texture_non_power_of_two extension is not present, the dimensions
* of an OpenGL texture object must be a power-of-two (e.g. 64x32 or 128x512).
* The actual bounds of the texture object for this surface.
* The texture image that we care about has dimensions specified by the width
* and height fields in this MTLSDOps structure. For example, if the image
* to be stored in the texture has dimensions 115x47, the actual OpenGL
* texture we allocate will have dimensions 128x64 to meet the pow2
* restriction. The image bounds within the texture can be accessed using
* floating point texture coordinates in the range [0.0,1.0].
* and height fields in this MTLSDOps structure.
*/
typedef struct {
SurfaceDataOps sdOps;
@@ -74,7 +74,7 @@
* stays in that mode for the duration of the application. It should
* be safe to use this one glyph cache for all screens in a multimon
* environment, since the glyph cache texture is shared between all contexts,
* and (in theory) OpenGL drivers should be smart enough to manage that
* and (in theory) Metal drivers should be smart enough to manage that
* texture across all screens.
*/

@@ -235,7 +235,6 @@ JNIEXPORT SurfaceDataOps * JNICALL
SurfaceData_InitOps(JNIEnv *env, jobject sData, int opsSize)
{
SurfaceDataOps *ops = malloc(opsSize);

SurfaceData_SetOps(env, sData, ops);
if (ops != NULL) {
memset(ops, 0, opsSize);