fix a drawing order glitch in the mac default plugin. b=467580 sr=jst
authorJosh Aas <joshmoz@gmail.com>
Tue, 02 Dec 2008 16:05:36 -0500
changeset 22174 f603fec24bf7642509006fc26f0c78455d7c993b
parent 22173 49a032846a3aa67ab2ac7a3fad269f512938dfe0
child 22184 31e5958cb97a21bb27bff4c9438ea659791b6b9b
push id3842
push userjosh@mozilla.com
push dateTue, 02 Dec 2008 21:05:51 +0000
treeherdermozilla-central@f603fec24bf7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs467580
milestone1.9.2a1pre
fix a drawing order glitch in the mac default plugin. b=467580 sr=jst
modules/plugin/default/mac/DefaultPlugin.mm
--- a/modules/plugin/default/mac/DefaultPlugin.mm
+++ b/modules/plugin/default/mac/DefaultPlugin.mm
@@ -223,30 +223,30 @@ void drawPlugin(NPP instance)
   CGContextTranslateCTM(cgContext, 0.0, windowHeight);
   CGContextScaleCTM(cgContext, 1.0, -1.0);
 
   // draw a white background for the plugin
   CGContextAddRect(cgContext, CGRectMake(0, 0, windowWidth, windowHeight));
   CGContextSetGrayFillColor(cgContext, 1.0, 1.0);
   CGContextDrawPath(cgContext, kCGPathFill);
 
-  // draw a blue frame around the plugin
-  CGContextAddRect(cgContext, CGRectMake(0, 0, windowWidth, windowHeight));
-  CGContextSetRGBStrokeColor(cgContext, 0.0, 0.0, 0.5, 1.0);
-  CGContextSetLineWidth(cgContext, 2.0);
-  CGContextStrokePath(cgContext);
-
   // draw the broken plugin icon
   CFBundleRef bundle = ::CFBundleGetBundleWithIdentifier(CFSTR("org.mozilla.DefaultPlugin"));
   CFURLRef imageURL = ::CFBundleCopyResourceURL(bundle, CFSTR("plugin"), CFSTR("png"), NULL);
   CGDataProviderRef dataProvider = ::CGDataProviderCreateWithURL(imageURL);
   ::CFRelease(imageURL);
   CGImageRef imageRef = ::CGImageCreateWithPNGDataProvider(dataProvider, NULL, TRUE, kCGRenderingIntentDefault);
   ::CGDataProviderRelease(dataProvider);
   float imageWidth = ::CGImageGetWidth(imageRef);
   float imageHeight = ::CGImageGetHeight(imageRef);
   CGRect drawRect = ::CGRectMake(windowWidth / 2 - imageWidth / 2, windowHeight / 2 - imageHeight / 2, imageWidth, imageHeight);
   ::CGContextDrawImage(cgContext, drawRect, imageRef);
   ::CGImageRelease(imageRef);
 
+  // draw a blue frame around the plugin
+  CGContextAddRect(cgContext, CGRectMake(0, 0, windowWidth, windowHeight));
+  CGContextSetRGBStrokeColor(cgContext, 0.0, 0.0, 0.5, 1.0);
+  CGContextSetLineWidth(cgContext, 2.0);
+  CGContextStrokePath(cgContext);
+
   // restore the cgcontext gstate
   CGContextRestoreGState(cgContext);
 }