Flutter Engine
clip_rrect_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_CLIP_RRECT_LAYER_H_
6 #define FLUTTER_FLOW_LAYERS_CLIP_RRECT_LAYER_H_
7 
8 #include "flutter/flow/layers/container_layer.h"
9 
10 namespace flutter {
11 
13  public:
14  ClipRRectLayer(const SkRRect& clip_rrect, Clip clip_behavior);
15 
16 #ifdef FLUTTER_ENABLE_DIFF_CONTEXT
17 
18  void Diff(DiffContext* context, const Layer* old_layer) override;
19 
20 #endif // FLUTTER_ENABLE_DIFF_CONTEXT
21 
22  void Preroll(PrerollContext* context, const SkMatrix& matrix) override;
23 
24  void Paint(PaintContext& context) const override;
25 
26  bool UsesSaveLayer() const {
27  return clip_behavior_ == Clip::antiAliasWithSaveLayer;
28  }
29 
30  private:
31  SkRRect clip_rrect_;
32  Clip clip_behavior_;
33 
34  FML_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer);
35 };
36 
37 } // namespace flutter
38 
39 #endif // FLUTTER_FLOW_LAYERS_CLIP_RRECT_LAYER_H_
void Preroll(PrerollContext *context, const SkMatrix &matrix) override
void Paint(PaintContext &context) const override
ClipRRectLayer(const SkRRect &clip_rrect, Clip clip_behavior)
Clip
Definition: layer.h:40