提交 8dcac738 编写于 作者: A Adam Barth 提交者: GitHub

Fix Mozart blends of child views (#3248)

We need to compute the paint bounds of ChildViewLayers during Preroll.
Also, we need to allocate a BlendPtr before writing into it.
上级 9383817e
......@@ -19,6 +19,13 @@ void ChildSceneLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
transform_.preTranslate(offset_.x(), offset_.y());
float inverse_device_pixel_ratio = 1.f / device_pixel_ratio_;
transform_.preScale(inverse_device_pixel_ratio, inverse_device_pixel_ratio);
SkRect bounds = SkRect::MakeXYWH(
offset_.x(), offset_.y(),
physical_size_.width() * inverse_device_pixel_ratio,
physical_size_.height() * inverse_device_pixel_ratio);
set_paint_bounds(bounds);
context->child_paint_bounds = bounds;
}
void ChildSceneLayer::Paint(PaintContext& context) {
......
......@@ -23,6 +23,7 @@ void OpacityLayer::UpdateScene(SceneUpdateContext& context,
node->op = mozart::NodeOp::New();
node->op->set_layer(mozart::LayerNodeOp::New());
node->op->get_layer()->layer_rect = mozart::RectF::From(paint_bounds());
node->op->get_layer()->blend = mozart::Blend::New();
node->op->get_layer()->blend->alpha = alpha_;
UpdateSceneChildrenInsideNode(context, container, std::move(node));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册