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:
liyuqian
2019-04-05 18:34:05 -07:00
committed by GitHub
parent c6a6384258
commit ad93320b66
2 changed files with 9 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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();