Flutter Engine
The Flutter Engine
display_list_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_DISPLAY_LIST_LAYER_H_
6#define FLUTTER_FLOW_LAYERS_DISPLAY_LIST_LAYER_H_
7
8#include <memory>
9
10#include "flutter/common/macros.h"
11#include "flutter/display_list/display_list.h"
12#include "flutter/flow/layers/display_list_raster_cache_item.h"
13#include "flutter/flow/layers/layer.h"
14#include "flutter/flow/raster_cache_item.h"
15
16namespace flutter {
17
18class DisplayListLayer : public Layer {
19 public:
20 static constexpr size_t kMaxBytesToCompare = 10000;
21
24 bool is_complex,
25 bool will_change);
26
27 DisplayList* display_list() const { return display_list_.get(); }
28
29 bool IsReplacing(DiffContext* context, const Layer* layer) const override;
30
31 void Diff(DiffContext* context, const Layer* old_layer) override;
32
33 const DisplayListLayer* as_display_list_layer() const override {
34 return this;
35 }
36
37 void Preroll(PrerollContext* frame) override;
38
39 void Paint(PaintContext& context) const override;
40
41#if !SLIMPELLER
43 return display_list_raster_cache_item_.get();
44 }
45
49 }
50#endif // !SLIMPELLER
51
52 private:
53 NOT_SLIMPELLER(std::unique_ptr<DisplayListRasterCacheItem>
54 display_list_raster_cache_item_);
55
56 SkPoint offset_;
57 SkRect bounds_;
58
59 sk_sp<DisplayList> display_list_;
60
61 static bool Compare(DiffContext::Statistics& statistics,
62 const DisplayListLayer* l1,
63 const DisplayListLayer* l2);
64
65 FML_DISALLOW_COPY_AND_ASSIGN(DisplayListLayer);
66};
67
68} // namespace flutter
69
70#endif // FLUTTER_FLOW_LAYERS_DISPLAY_LIST_LAYER_H_
bool IsReplacing(DiffContext *context, const Layer *layer) const override
void Preroll(PrerollContext *frame) override
void Diff(DiffContext *context, const Layer *old_layer) override
const DisplayListRasterCacheItem * raster_cache_item() const
DisplayList * display_list() const
const DisplayListLayer * as_display_list_layer() const override
DisplayListLayer(const SkPoint &offset, sk_sp< DisplayList > display_list, bool is_complex, bool will_change)
static constexpr size_t kMaxBytesToCompare
void Paint(PaintContext &context) const override
RasterCacheKeyID caching_key_id() const override
uint64_t unique_id() const
Definition: layer.h:251
double frame
Definition: examples.cpp:31
SeparatedVector2 offset