Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GrDDLTask.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrDDLTask_DEFINED
9#define GrDDLTask_DEFINED
10
13
16
17/**
18 * This render task isolates the DDL's tasks from the rest of the DAG. This means that
19 * the DDL's tasks cannot be reordered by the topological sort and are always executed
20 * as a single block.
21 * It almost entirely just forwards calls down to the DDL's render tasks.
22 */
23class GrDDLTask final : public GrRenderTask {
24public:
28
29 ~GrDDLTask() override;
30
31 // The render tasks w/in the DDL don't appear in the DAG so need explicit notification
32 // when they can free their contents.
33 bool requiresExplicitCleanup() const override { return true; }
34
35 void endFlush(GrDrawingManager*) override;
36
37 void disown(GrDrawingManager*) override;
38
39private:
40 bool onIsUsed(GrSurfaceProxy*) const override;
41
42 void gatherProxyIntervals(GrResourceAllocator*) const override;
43
44 ExpectedOutcome onMakeClosed(GrRecordingContext*, SkIRect* targetUpdateBounds) override;
45
47 // This entry point is only called when a DDL is snapped off of a recorder.
48 // Since DDL tasks should never recursively appear within a DDL this should never
49 // be called.
50 SkASSERT(0);
51 }
52
53 void onPrepare(GrOpFlushState*) override;
54
55 bool onExecute(GrOpFlushState*) override;
56
57#if defined(GR_TEST_UTILS)
58 void dump(const SkString& label,
59 SkString indent,
60 bool printDependencies,
61 bool close) const final;
62 const char* name() const final { return "DDL"; }
63#endif
64#ifdef SK_DEBUG
65 void visitProxies_debugOnly(const GrVisitProxyFunc&) const override {}
66#endif
67
70
71 typedef GrRenderTask INHERITED;
72};
73
74#endif
std::function< void(GrSurfaceProxy *, skgpu::Mipmapped)> GrVisitProxyFunc
#define SkASSERT(cond)
Definition SkAssert.h:116
static void dump(const float m[20], SkYUVColorSpace cs, bool rgb2yuv)
ExpectedOutcome onMakeClosed(GrRecordingContext *, SkIRect *targetUpdateBounds) override
Definition GrDDLTask.cpp:75
void onPrepare(GrOpFlushState *) override
Definition GrDDLTask.cpp:81
bool onExecute(GrOpFlushState *) override
Definition GrDDLTask.cpp:87
void onPrePrepare(GrRecordingContext *) override
Definition GrDDLTask.h:46
bool onIsUsed(GrSurfaceProxy *) const override
Definition GrDDLTask.cpp:51
~GrDDLTask() override
Definition GrDDLTask.cpp:33
void disown(GrDrawingManager *) override
Definition GrDDLTask.cpp:43
void gatherProxyIntervals(GrResourceAllocator *) const override
Definition GrDDLTask.cpp:65
bool requiresExplicitCleanup() const override
Definition GrDDLTask.h:33
void endFlush(GrDrawingManager *) override
Definition GrDDLTask.cpp:35
const char * name
Definition fuchsia.cc:50