Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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#include <memory>
9#include <optional>
10
11#include "flutter/display_list/display_list.h"
12#include "flutter/flow/embedded_views.h"
13#include "flutter/flow/raster_cache_item.h"
16
17namespace flutter {
18
20 public:
22 const SkPoint& offset,
23 bool is_complex = true,
24 bool will_change = false);
25
26 static std::unique_ptr<DisplayListRasterCacheItem> Make(
27 const sk_sp<DisplayList>&,
28 const SkPoint& offset,
29 bool is_complex,
30 bool will_change);
31
32 void PrerollSetup(PrerollContext* context, const SkMatrix& matrix) override;
33
34 void PrerollFinalize(PrerollContext* context,
35 const SkMatrix& matrix) override;
36
37 bool Draw(const PaintContext& context, const DlPaint* paint) const override;
38
39 bool Draw(const PaintContext& context,
40 DlCanvas* canvas,
41 const DlPaint* paint) const override;
42
43 bool TryToPrepareRasterCache(const PaintContext& context,
44 bool parent_cached = false) const override;
45
48 }
49
50 const DisplayList* display_list() const { return display_list_.get(); }
51
52 private:
53 SkMatrix transformation_matrix_;
54 sk_sp<DisplayList> display_list_;
55 SkPoint offset_;
56 bool is_complex_;
57 bool will_change_;
58};
59
60} // namespace flutter
61
62#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
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:37
const Paint & paint
Point offset