Scheduling blitting based on Metal Context state metal-prototype-branch
authorjdv
Wed, 24 Jul 2019 11:08:24 +0530
branchmetal-prototype-branch
changeset 57505 c47331043c12
parent 57504 f72a3278a493
child 57682 6b0febcd7b43
Scheduling blitting based on Metal Context state
src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderQueue.m
--- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderQueue.m	Wed Jul 24 10:24:35 2019 +0530
+++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderQueue.m	Wed Jul 24 11:08:24 2019 +0530
@@ -518,7 +518,7 @@
                 }
 
                 dstOps = (BMTLSDOps *)jlong_to_ptr(pDst);
-                [MTLContext setSurfacesEnv:env src:pSrc dst:pDst];
+                mtlc = [MTLContext setSurfacesEnv:env src:pSrc dst:pDst];
             }
             break;
         case sun_java2d_pipe_BufferedOpCodes_SET_SCRATCH_SURFACE:
@@ -801,8 +801,10 @@
             onSurfaceModified(dstOps);
     }
 
-    RESET_PREVIOUS_OP();
-    scheduleBlitAllModifiedLayers();
+    if (mtlc != NULL) {
+        RESET_PREVIOUS_OP();
+        scheduleBlitAllModifiedLayers();
+    }
 }
 
 /**