From 31d56d08ab278ce86851c8a74f7d47ca1ca188b4 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 9 Sep 2011 19:14:22 +0000 Subject: [PATCH] do we really need to create a new colour space to clear the background? We can just use the generic RGB space. --- direct/src/plugin_npapi/ppInstance.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/direct/src/plugin_npapi/ppInstance.cxx b/direct/src/plugin_npapi/ppInstance.cxx index 2f39f53fba..8797f6724b 100644 --- a/direct/src/plugin_npapi/ppInstance.cxx +++ b/direct/src/plugin_npapi/ppInstance.cxx @@ -2705,9 +2705,8 @@ osx_release_twirl_images() { void PPInstance:: paint_twirl_osx_cgcontext(CGContextRef context) { // Clear the whole region to the bgcolor before beginning. - CGFloat bg_components[] = { _bgcolor_r / 255.0f, _bgcolor_g / 255.0f, _bgcolor_b / 255.0f, 1 }; - CGColorSpaceRef rgb_space = CGColorSpaceCreateDeviceRGB(); - CGColorRef bg = CGColorCreate(rgb_space, bg_components); + CGColorRef bg = CGColorCreateGenericRGB( + _bgcolor_r / 255.0f, _bgcolor_g / 255.0f, _bgcolor_b / 255.0f, 1); CGRect region = { { 0, 0 }, { _window.width, _window.height } }; CGContextBeginPath(context); @@ -2716,7 +2715,6 @@ paint_twirl_osx_cgcontext(CGContextRef context) { CGContextFillPath(context); CGColorRelease(bg); - CGColorSpaceRelease(rgb_space); if (_failed) { // Draw the failed icon if something went wrong.