Flutter Engine
The Flutter Engine
display_list_raster_cache_item.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_RASTER_CACHE_ITEM_H_
6#define FLUTTER_FLOW_LAYERS_DISPLAY_LIST_RASTER_CACHE_ITEM_H_
7
8#if !SLIMPELLER
9
10#include <memory>
11#include <optional>
12
13#include "flutter/display_list/display_list.h"
14#include "flutter/flow/embedded_views.h"
15#include "flutter/flow/raster_cache_item.h"
18
19namespace flutter {
20
22 public:
24 const SkPoint& offset,
25 bool is_complex = true,
26 bool will_change = false);
27
28 static std::unique_ptr<DisplayListRasterCacheItem> Make(
29 const sk_sp<DisplayList>&,
30 const SkPoint& offset,
31 bool is_complex,
32 bool will_change);
33
34 void PrerollSetup(PrerollContext* context, const SkMatrix& matrix) override;
35
36 void PrerollFinalize(PrerollContext* context,
37 const SkMatrix& matrix) override;
38
39 bool Draw(const PaintContext& context, const DlPaint* paint) const override;
40
41 bool Draw(const PaintContext& context,
42 DlCanvas* canvas,
43 const DlPaint* paint) const override;
44
45 bool TryToPrepareRasterCache(const PaintContext& context,
46 bool parent_cached = false) const override;
47
50 }
51
52 const DisplayList* display_list() const { return display_list_.get(); }
53
54 private:
55 SkMatrix transformation_matrix_;
56 sk_sp<DisplayList> display_list_;
57 SkPoint offset_;
58 bool is_complex_;
59 bool will_change_;
60};
61
62} // namespace flutter
63
64#else // !SLIMPELLER
65
66class DisplayListRasterCacheItem;
67
68#endif // !SLIMPELLER
69
70#endif // FLUTTER_FLOW_LAYERS_DISPLAY_LIST_RASTER_CACHE_ITEM_H_
SkMatrix & preTranslate(SkScalar dx, SkScalar dy)
Definition: SkMatrix.cpp:263
bool TryToPrepareRasterCache(const PaintContext &context, bool parent_cached=false) const override
static std::unique_ptr< DisplayListRasterCacheItem > Make(const sk_sp< DisplayList > &, const SkPoint &offset, bool is_complex, bool will_change)
void PrerollSetup(PrerollContext *context, const SkMatrix &matrix) override
DisplayListRasterCacheItem(const sk_sp< DisplayList > &display_list, const SkPoint &offset, bool is_complex=true, bool will_change=false)
void PrerollFinalize(PrerollContext *context, const SkMatrix &matrix) override
bool Draw(const PaintContext &context, const DlPaint *paint) const override
Developer-facing API for rendering anything within the engine.
Definition: dl_canvas.h:38
const Paint & paint
Definition: color_source.cc:38
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
SeparatedVector2 offset