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