Flutter Engine
shader_mask_layer.h
Go to the documentation of this file.
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_SHADER_MASK_LAYER_H_
6 #define FLUTTER_FLOW_LAYERS_SHADER_MASK_LAYER_H_
7 
8 #include "flutter/flow/layers/container_layer.h"
9 #include "third_party/skia/include/core/SkShader.h"
10 
11 namespace flutter {
12 
14  public:
15  ShaderMaskLayer(sk_sp<SkShader> shader,
16  const SkRect& mask_rect,
17  SkBlendMode blend_mode);
18 
19 #ifdef FLUTTER_ENABLE_DIFF_CONTEXT
20 
21  void Diff(DiffContext* context, const Layer* old_layer) override;
22 
23 #endif // FLUTTER_ENABLE_DIFF_CONTEXT
24 
25  void Preroll(PrerollContext* context, const SkMatrix& matrix) override;
26 
27  void Paint(PaintContext& context) const override;
28 
29  private:
30  sk_sp<SkShader> shader_;
31  SkRect mask_rect_;
32  SkBlendMode blend_mode_;
33 
34  FML_DISALLOW_COPY_AND_ASSIGN(ShaderMaskLayer);
35 };
36 
37 } // namespace flutter
38 
39 #endif // FLUTTER_FLOW_LAYERS_SHADER_MASK_LAYER_H_
ShaderMaskLayer(sk_sp< SkShader > shader, const SkRect &mask_rect, SkBlendMode blend_mode)
void Paint(PaintContext &context) const override
void Preroll(PrerollContext *context, const SkMatrix &matrix) override