提交 0edcbb7d 编写于 作者: J Jason Simmons 提交者: GitHub

Allow translucent background colors in PhysicalModel (#3452)

Set the TransparentOccluder shadow flag if the color is not opaque
上级 113f6e3c
......@@ -50,19 +50,23 @@ void PhysicalModelLayer::Paint(PaintContext& context) {
path.addRRect(rrect_);
if (elevation_ != 0) {
SkShadowFlags flags = SkColorGetA(color_) == 0xff ?
SkShadowFlags::kNone_ShadowFlag :
SkShadowFlags::kTransparentOccluder_ShadowFlag;
SkShadowUtils::DrawShadow(&context.canvas, path,
elevation_ * 4,
SkPoint3::Make(0.0f, -700.0f, 2800.0f),
2800.0f,
0.25f, 0.25f,
SK_ColorBLACK);
SK_ColorBLACK,
flags);
}
if (needs_system_composite())
return;
SkPaint paint;
paint.setColor(SkColorSetA(color_, 0xFF));
paint.setColor(color_);
context.canvas.drawPath(path, paint);
SkAutoCanvasRestore save(&context.canvas, false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册