aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-09-16 23:59:52 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-09-16 23:59:52 +0200
commit3b7b682ca322d62f03c812f22623a43dc25b0074 (patch)
tree37ecf6240b7229c5879884b3490774f475e8794f
parent2025ec49e8ae78501ee0bd20d8e974c9d2edae8a (diff)
downloadosc-graphics-3b7b682ca322d62f03c812f22623a43dc25b0074.tar.gz
remove unnecessary locks when setting video layer transparency
drastically improves performance when the layer alpha is frequently changed
-rw-r--r--main.c2
1 files changed, 0 insertions, 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