1 // Copyright 2013 The Flutter Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef FLUTTER_FLOW_LAYERS_TRANSFORM_LAYER_H_ 6 #define FLUTTER_FLOW_LAYERS_TRANSFORM_LAYER_H_ 7 8 #include "flutter/flow/layers/container_layer.h" 9 10 namespace flutter { 11 12 // Be careful that SkMatrix's default constructor doesn't initialize the matrix 13 // at all. Hence |set_transform| must be called with an initialized SkMatrix. 14 class TransformLayer : public ContainerLayer { 15 public: 16 TransformLayer(const SkMatrix& transform); 17 ~TransformLayer() override; 18 19 void Preroll(PrerollContext* context, const SkMatrix& matrix) override; 20 21 void Paint(PaintContext& context) const override; 22 23 #if defined(OS_FUCHSIA) 24 void UpdateScene(SceneUpdateContext& context) override; 25 #endif // defined(OS_FUCHSIA) 26 27 SkRect MapRect(const SkRect& rect) override; 28 29 void MergeParentHole() override; 30 31 private: 32 SkMatrix transform_; 33 34 FML_DISALLOW_COPY_AND_ASSIGN(TransformLayer); 35 }; 36 37 } // namespace flutter 38 39 #endif // FLUTTER_FLOW_LAYERS_TRANSFORM_LAYER_H_ 40