Initialize OpacityLayer's matrix to identity (flutter/engine#8467)
Should have https://github.com/flutter/flutter/issues/30586 fixed once the engine rolls.
This commit is contained in:
@@ -20,6 +20,13 @@ void OpacityLayer::EnsureSingleChild() {
|
||||
}
|
||||
|
||||
auto new_child = std::make_shared<flow::TransformLayer>();
|
||||
|
||||
// Be careful: SkMatrix's default constructor doesn't initialize the matrix to
|
||||
// identity. Hence we have to explicitly call SkMatrix::setIdentity.
|
||||
SkMatrix identity;
|
||||
identity.setIdentity();
|
||||
|
||||
new_child->set_transform(identity);
|
||||
for (auto& child : layers()) {
|
||||
new_child->Add(child);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
namespace flow {
|
||||
|
||||
// Be careful that SkMatrix's default constructor doesn't initialize the matrix
|
||||
// at all. Hence |set_transform| must be called with an initialized SkMatrix.
|
||||
class TransformLayer : public ContainerLayer {
|
||||
public:
|
||||
TransformLayer();
|
||||
|
||||
Reference in New Issue
Block a user