changeset 53451:0ce38f458fdd

8220517: Enhanced GIF support Reviewed-by: aivanov, ssahoo, mschoene, prr
author serb
date Wed, 27 Mar 2019 00:24:13 -0700
parents 00f139847484
children 44b3cdc5dd8a
files src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m	Tue Mar 26 10:23:43 2019 -0700
+++ b/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m	Wed Mar 27 00:24:13 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, 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
@@ -190,7 +190,7 @@
 
     splash->maskRequired = 0;
 
-    
+
     //TODO: the following is too much of a hack but should work in 90% cases.
     //      besides we don't use device-dependent drawing, so probably
     //      that's very fine indeed
@@ -257,9 +257,11 @@
 SplashRedrawWindow(Splash * splash) {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
-    SplashUpdateScreenData(splash);
+    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+        // drop the reference to the old view and image
+        [splash->window setContentView: nil];
+        SplashUpdateScreenData(splash);
 
-    [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
         // NSDeviceRGBColorSpace vs. NSCalibratedRGBColorSpace ?
         NSBitmapImageRep * rep = [[NSBitmapImageRep alloc]
             initWithBitmapDataPlanes: (unsigned char**)&splash->screenData
@@ -286,7 +288,7 @@
             size.height /= scaleFactor;
             [image setSize: size];
         }
-        
+
         NSImageView * view = [[NSImageView alloc] init];
 
         [view setImage: image];