app_server: Remove special case for fully opaque layers
* Fixes #19871. Change-Id: I4b74dc9fae512530ed1d0bec74d73c24c6a99ea3 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10212 Tested-by: Commit checker robot <[email protected]> Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
@@ -238,11 +238,6 @@ Canvas::BlendLayer(Layer* layerPtr)
|
|||||||
{
|
{
|
||||||
BReference<Layer> layer(layerPtr, true);
|
BReference<Layer> layer(layerPtr, true);
|
||||||
|
|
||||||
if (layer->Opacity() == 255) {
|
|
||||||
layer->Play(this);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BReference <UtilityBitmap> layerBitmap(layer->RenderToBitmap(this), true);
|
BReference <UtilityBitmap> layerBitmap(layer->RenderToBitmap(this), true);
|
||||||
if (layerBitmap == NULL)
|
if (layerBitmap == NULL)
|
||||||
return;
|
return;
|
||||||
@@ -257,11 +252,13 @@ Canvas::BlendLayer(Layer* layerPtr)
|
|||||||
fDrawState->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_COMPOSITE);
|
fDrawState->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_COMPOSITE);
|
||||||
fDrawState->SetTransformEnabled(false);
|
fDrawState->SetTransformEnabled(false);
|
||||||
|
|
||||||
BReference<AlphaMask> mask(new(std::nothrow) UniformAlphaMask(layer->Opacity()), true);
|
if (layer->Opacity() < 255) {
|
||||||
if (mask == NULL)
|
BReference<AlphaMask> mask(new(std::nothrow) UniformAlphaMask(layer->Opacity()), true);
|
||||||
return;
|
if (mask == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
SetAlphaMask(mask);
|
SetAlphaMask(mask);
|
||||||
|
}
|
||||||
ResyncDrawState();
|
ResyncDrawState();
|
||||||
|
|
||||||
GetDrawingEngine()->DrawBitmap(layerBitmap, layerBitmap->Bounds(),
|
GetDrawingEngine()->DrawBitmap(layerBitmap, layerBitmap->Bounds(),
|
||||||
|
|||||||
Reference in New Issue
Block a user