jdk/src/macosx/native/com/apple/laf/JRSUIController.m
changeset 24151 a558c7acb1ad
parent 16841 5cd8d248ea97
equal deleted inserted replaced
24150:367d67fc074c 24151:a558c7acb1ad
     1 /*
     1 /*
     2  * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   197     if (!rawPixelData) return apple_laf_JRSUIControl_NULL_PTR;
   197     if (!rawPixelData) return apple_laf_JRSUIControl_NULL_PTR;
   198 
   198 
   199     CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
   199     CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
   200     CGContextRef cgRef = CGBitmapContextCreate(rawPixelData, imgW, imgH, 8, imgW * 4, colorspace, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host);
   200     CGContextRef cgRef = CGBitmapContextCreate(rawPixelData, imgW, imgH, 8, imgW * 4, colorspace, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host);
   201     CGColorSpaceRelease(colorspace);
   201     CGColorSpaceRelease(colorspace);
   202     CGContextScaleCTM(cgRef, imgW/w , imgH/h);
   202     CGContextScaleCTM(cgRef, imgW/(w + x + x) , imgH/(h + y + y));
   203 
   203 
   204     jint status = doPaintCGContext(cgRef, controlPtr, oldProperties, newProperties, x, y, w, h);
   204     jint status = doPaintCGContext(cgRef, controlPtr, oldProperties, newProperties, x, y, w, h);
   205     CGContextRelease(cgRef);
   205     CGContextRelease(cgRef);
   206 
   206 
   207     (*env)->ReleasePrimitiveArrayCritical(env, data, rawPixelData, 0);
   207     (*env)->ReleasePrimitiveArrayCritical(env, data, rawPixelData, 0);