Flutter Engine
flutter::Layer::AutoSaveLayer Class Reference

#include <layer.h>

Public Types

enum  SaveMode {
  kInternalNodesCanvas,
  kLeafNodesCanvas
}
 

Public Member Functions

 ~AutoSaveLayer ()
 

Static Public Member Functions

static AutoSaveLayer Create (const PaintContext &paint_context, const SkRect &bounds, const SkPaint *paint, SaveMode save_mode=SaveMode::kInternalNodesCanvas)
 
static AutoSaveLayer Create (const PaintContext &paint_context, const SkCanvas::SaveLayerRec &layer_rec, SaveMode save_mode=SaveMode::kInternalNodesCanvas)
 

Detailed Description

Definition at line 158 of file layer.h.

Member Enumeration Documentation

◆ SaveMode

Enumerator
kInternalNodesCanvas 
kLeafNodesCanvas 

Definition at line 167 of file layer.h.

167  {
168  // The layer is saved on the internal_nodes_canvas.
170  // The layer is saved on the leaf_nodes_canvas.
172  };

Constructor & Destructor Documentation

◆ ~AutoSaveLayer()

flutter::Layer::AutoSaveLayer::~AutoSaveLayer ( )

Definition at line 97 of file layer.cc.

References flutter::DrawCheckerboard().

97  {
98  if (paint_context_.checkerboard_offscreen_layers) {
99  DrawCheckerboard(&canvas_, bounds_);
100  }
101  canvas_.restore();
102 }
const bool checkerboard_offscreen_layers
Definition: layer.h:152
void DrawCheckerboard(SkCanvas *canvas, SkColor c1, SkColor c2, int size)
Definition: paint_utils.cc:29

Member Function Documentation

◆ Create() [1/2]

Layer::AutoSaveLayer flutter::Layer::AutoSaveLayer::Create ( const PaintContext paint_context,
const SkRect &  bounds,
const SkPaint *  paint,
SaveMode  save_mode = SaveMode::kInternalNodesCanvas 
)
static

Definition at line 82 of file layer.cc.

Referenced by flutter::BackdropFilterLayer::Paint(), flutter::ColorFilterLayer::Paint(), flutter::ImageFilterLayer::Paint(), flutter::ShaderMaskLayer::Paint(), flutter::OpacityLayer::Paint(), and flutter::testing::TEST_F().

86  {
87  return Layer::AutoSaveLayer(paint_context, bounds, paint, save_mode);
88 }

◆ Create() [2/2]

Layer::AutoSaveLayer flutter::Layer::AutoSaveLayer::Create ( const PaintContext paint_context,
const SkCanvas::SaveLayerRec &  layer_rec,
SaveMode  save_mode = SaveMode::kInternalNodesCanvas 
)
static

Definition at line 90 of file layer.cc.

93  {
94  return Layer::AutoSaveLayer(paint_context, layer_rec, save_mode);
95 }

The documentation for this class was generated from the following files: