Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
PublicPrecompile.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 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 skgpu_graphite_PublicPrecompile_DEFINED
9#define skgpu_graphite_PublicPrecompile_DEFINED
10
12
13// TODO: this header should be moved to include/gpu/graphite once the precompilation API
14// is made public
15namespace skgpu::graphite {
16
17class Context;
18class GraphicsPipelineDesc;
19class PaintOptions;
20struct RenderPassDesc;
21class RuntimeEffectDictionary;
22
23/**
24 * Precompilation allows clients to create pipelines ahead of time based on what they expect
25 * to draw. This can reduce performance hitches, due to inline compilation, during the actual
26 * drawing. Graphite will always be able to perform an inline compilation if some SkPaint
27 * combination was omitted from precompilation.
28 *
29 * @param context the Context to which the actual draws will be submitted
30 * @param paintOptions captures a set of SkPaints that will be drawn
31 * @param drawTypes communicates which primitives those paints will be drawn with
32 */
33void Precompile(Context*, const PaintOptions&, DrawTypeFlags = kMostCommon);
34
35/*
36 * TODO: Rather than passing in a pipelineDesc and renderPassDesc we need to add an
37 * opaque serializable object that contains the same information.
38 */
40 RuntimeEffectDictionary* rteDict,
41 const GraphicsPipelineDesc& pipelineDesc,
42 const RenderPassDesc& renderPassDesc);
43
44} // namespace skgpu::graphite
45
46#endif // skgpu_graphite_PublicPrecompile_DEFINED
bool Precompile(Context *context, RuntimeEffectDictionary *rteDict, const GraphicsPipelineDesc &pipelineDesc, const RenderPassDesc &renderPassDesc)