Bug 736232 - Strange result using transparent layer, blending modes...

...and layer opacity

Use a temporary variable to store intermediate result instead of
writting 2 times to the output buffer, because input and output
buffer might be the same.