From 3b7b682ca322d62f03c812f22623a43dc25b0074 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 16 Sep 2012 23:59:52 +0200 Subject: remove unnecessary locks when setting video layer transparency drastically improves performance when the layer alpha is frequently changed --- main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/main.c b/main.c index 87ce683..10f1c57 100644 --- a/main.c +++ b/main.c @@ -721,12 +721,10 @@ layer_video_alpha(struct layer_video *ctx, float opacity) Uint8 alpha = (Uint8)ceilf(opacity*SDL_ALPHA_OPAQUE); ctx->alpha = opacity; - SDL_LockMutex(ctx->mutex); if (alpha == SDL_ALPHA_OPAQUE) SDL_SetAlpha(ctx->surf, 0, 0); else SDL_SetAlpha(ctx->surf, SDL_SRCALPHA | SDL_RLEACCEL, alpha); - SDL_UnlockMutex(ctx->mutex); } static void -- cgit v1.2.3