flutter_flutter/flow/layers/elevated_container_layer.h
David Worsham d117ac979c
Wire up Opacity on Fuchsia, round 2 (#14024)
* Remove erroneous ChildView opacity

* Wire frame metrics through contexts

* Maintain layer stack inside of SceneBuilder

* Remove EnsureSingleChild

* Centralize system-composite and elevation logic

* Wire up OpacityLayer to Scenic
2019-12-04 19:29:31 -08:00

35 lines
978 B
C++

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FLOW_LAYERS_ELEVATED_CONTAINER_LAYER_H_
#define FLUTTER_FLOW_LAYERS_ELEVATED_CONTAINER_LAYER_H_
#include "flutter/flow/layers/container_layer.h"
namespace flutter {
class ElevatedContainerLayer : public ContainerLayer {
public:
ElevatedContainerLayer(float elevation);
~ElevatedContainerLayer() override = default;
void Preroll(PrerollContext* context, const SkMatrix& matrix) override;
float elevation() const { return clamped_elevation_; }
float total_elevation() const {
return parent_elevation_ + clamped_elevation_;
}
private:
float parent_elevation_ = 0.0f;
float elevation_ = 0.0f;
float clamped_elevation_ = 0.0f;
FML_DISALLOW_COPY_AND_ASSIGN(ElevatedContainerLayer);
};
} // namespace flutter
#endif // FLUTTER_FLOW_LAYERS_ELEVATED_CONTAINER_LAYER_H_