[vlc-commits] macosx/fspanel: another minor optimization and simplification of the image drawing code

Felix Paul Kühne git at videolan.org
Wed Jun 27 17:10:09 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Jun 25 01:27:05 2012 +0200| [dd19842eacec0cce2f41b4ace43661471563dd1a] | committer: Felix Paul Kühne

macosx/fspanel: another minor optimization and simplification of the image drawing code
(cherry picked from commit 3d7bdcde683a3a0845bf8d441d18a9cb539e1d5d)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=dd19842eacec0cce2f41b4ace43661471563dd1a
---

 modules/gui/macosx/fspanel.m |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/modules/gui/macosx/fspanel.m b/modules/gui/macosx/fspanel.m
index b707092..2d925cf 100644
--- a/modules/gui/macosx/fspanel.m
+++ b/modules/gui/macosx/fspanel.m
@@ -586,26 +586,27 @@
     [[VLCCoreInteraction sharedInstance] setVolume: [sender intValue]];
 }
 
-#define addImage(image, _x, _y, mode, _width)                                               \
-    image_rect.size = [image size];                                                         \
+#define addImage(image, _x, _y, mode)                                                       \
+    image_size = [image size];                                                              \
+    image_rect.size = image_size;                                                           \
     image_rect.origin.x = 0;                                                                \
     image_rect.origin.y = 0;                                                                \
     frame.origin.x = _x;                                                                    \
     frame.origin.y = _y;                                                                    \
-    frame.size = [image size];                                                              \
-    if( _width ) frame.size.width = _width;                                                 \
+    frame.size = image_size;                                                                \
     [image drawInRect:frame fromRect:image_rect operation:mode fraction:1];
 
 - (void)drawRect:(NSRect)rect
 {
     NSRect frame = [self frame];
     NSRect image_rect;
+    NSSize image_size;
     NSImage *img;
-    addImage( o_background_img, 0, 0, NSCompositeCopy, 0 );
-    addImage( o_vol_sld_img, 26, 23, NSCompositeSourceOver, 0 );
-    addImage( o_vol_mute_img, 16, 18, NSCompositeSourceOver, 0 );
-    addImage( o_vol_max_img, 124, 18, NSCompositeSourceOver, 0 );
-    addImage( o_time_sld_img, 15, 53, NSCompositeSourceOver, 0);
+    addImage( o_background_img, 0, 0, NSCompositeCopy );
+    addImage( o_vol_sld_img, 26, 23, NSCompositeSourceOver );
+    addImage( o_vol_mute_img, 16, 18, NSCompositeSourceOver );
+    addImage( o_vol_max_img, 124, 18, NSCompositeSourceOver );
+    addImage( o_time_sld_img, 15, 53, NSCompositeSourceOver );
 }
 
 @end



More information about the vlc-commits mailing list