• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 #include "include/gpu/graphite/GraphiteTypes.h"
12 
13 // TODO: this header should be moved to include/gpu/graphite once the precompilation API
14 // is made public
15 namespace skgpu::graphite {
16 
17 class Context;
18 class PaintOptions;
19 
20 /**
21  * Precompilation allows clients to create pipelines ahead of time based on what they expect
22  * to draw. This can reduce performance hitches, due to inline compilation, during the actual
23  * drawing. Graphite will always be able to perform an inline compilation if some SkPaint
24  * combination was omitted from precompilation.
25  *
26  *   @param context        the Context to which the actual draws will be submitted
27  *   @param paintOptions   captures a set of SkPaints that will be drawn
28  *   @param drawTypes      communicates which primitives those paints will be drawn with
29  */
30 void Precompile(Context*, const PaintOptions&, DrawTypeFlags = kMostCommon);
31 
32 } // namespace skgpu::graphite
33 
34 #endif // skgpu_graphite_PublicPrecompile_DEFINED
35