• 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 SKSL_RASTERPIPELINECODEGENERATOR
9 #define SKSL_RASTERPIPELINECODEGENERATOR
10 
11 #include "include/core/SkTypes.h"
12 #include <memory>
13 
14 namespace SkSL {
15 
16 class FunctionDefinition;
17 struct Program;
18 class SkRPDebugTrace;
19 namespace RP { class Program; }
20 
21 // Convert 'function' to Raster Pipeline stages, for use by blends, shaders, and color filters.
22 // The arguments to the function are passed in registers:
23 //   -- coordinates in src.rg for shaders
24 //   -- color in src.rgba for color filters
25 //   -- src/dst in src.rgba and dst.rgba for blenders
26 std::unique_ptr<RP::Program> MakeRasterPipelineProgram(const Program& program,
27                                                        const FunctionDefinition& function,
28                                                        SkRPDebugTrace* debugTrace = nullptr);
29 
30 }  // namespace SkSL
31 
32 #endif
33