Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
ganesh
tessellate
GrTessellationShader.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 GrTessellationShader_DEFINED
9
#define GrTessellationShader_DEFINED
10
11
#include "
src/base/SkArenaAlloc.h
"
12
#include "
src/gpu/BufferWriter.h
"
13
#include "
src/gpu/ganesh/GrGeometryProcessor.h
"
14
#include "
src/gpu/ganesh/GrProgramInfo.h
"
15
16
class
SkArenaAlloc
;
17
18
// This is a common base class for shaders in the GPU tessellator.
19
class
GrTessellationShader
:
public
GrGeometryProcessor
{
20
public
:
21
GrTessellationShader
(
ClassID
classID
,
GrPrimitiveType
primitiveType
,
22
const
SkMatrix
&
viewMatrix
,
23
const
SkPMColor4f
&
color
)
24
:
GrGeometryProcessor
(
classID
)
25
, fPrimitiveType(
primitiveType
)
26
, fViewMatrix(
viewMatrix
)
27
, fColor(
color
) {
28
}
29
30
GrPrimitiveType
primitiveType
()
const
{
return
fPrimitiveType; }
31
const
SkMatrix
&
viewMatrix
()
const
{
return
fViewMatrix; }
32
const
SkPMColor4f
&
color
()
const
{
return
fColor;}
33
34
struct
ProgramArgs
{
35
SkArenaAlloc
*
fArena
;
36
const
GrSurfaceProxyView
&
fWriteView
;
37
bool
fUsesMSAASurface
;
38
const
GrDstProxyView
*
fDstProxyView
;
39
GrXferBarrierFlags
fXferBarrierFlags
;
40
GrLoadOp
fColorLoadOp
;
41
const
GrCaps
*
fCaps
;
42
};
43
44
static
const
GrPipeline
*
MakePipeline
(
const
ProgramArgs
&,
GrAAType
,
45
GrAppliedClip
&&,
GrProcessorSet
&&);
46
47
static
GrProgramInfo
*
MakeProgram
(
const
ProgramArgs
&
args
,
48
const
GrTessellationShader
* shader,
49
const
GrPipeline
* pipeline,
50
const
GrUserStencilSettings
* stencil) {
51
return
args
.fArena->make<
GrProgramInfo
>(*
args
.fCaps,
args
.fWriteView,
args
.fUsesMSAASurface,
52
pipeline, stencil, shader, shader->fPrimitiveType,
53
args
.fXferBarrierFlags,
args
.fColorLoadOp);
54
}
55
56
// SkSL functions that calculate Wang's formula for cubics or conics.
57
static
const
char
*
WangsFormulaSkSL
();
58
59
private
:
60
const
GrPrimitiveType
fPrimitiveType;
61
const
SkMatrix
fViewMatrix;
62
const
SkPMColor4f
fColor;
63
};
64
65
#endif
BufferWriter.h
GrGeometryProcessor.h
GrProgramInfo.h
GrPrimitiveType
GrPrimitiveType
Definition
GrTypesPriv.h:42
GrAAType
GrAAType
Definition
GrTypesPriv.h:199
GrLoadOp
GrLoadOp
Definition
GrTypesPriv.h:154
GrXferBarrierFlags
GrXferBarrierFlags
Definition
GrXferProcessor.h:45
SkArenaAlloc.h
GrAppliedClip
Definition
GrAppliedClip.h:94
GrCaps
Definition
GrCaps.h:57
GrDstProxyView
Definition
GrDstProxyView.h:20
GrGeometryProcessor
Definition
GrGeometryProcessor.h:53
GrPipeline
Definition
GrPipeline.h:36
GrProcessorSet
Definition
GrProcessorSet.h:21
GrProcessor::classID
ClassID classID() const
Definition
GrProcessor.h:129
GrProcessor::ClassID
ClassID
Definition
GrProcessor.h:24
GrProgramInfo
Definition
GrProgramInfo.h:17
GrSurfaceProxyView
Definition
GrSurfaceProxyView.h:34
GrTessellationShader
Definition
GrTessellationShader.h:19
GrTessellationShader::primitiveType
GrPrimitiveType primitiveType() const
Definition
GrTessellationShader.h:30
GrTessellationShader::WangsFormulaSkSL
static const char * WangsFormulaSkSL()
Definition
GrTessellationShader.cpp:27
GrTessellationShader::color
const SkPMColor4f & color() const
Definition
GrTessellationShader.h:32
GrTessellationShader::MakePipeline
static const GrPipeline * MakePipeline(const ProgramArgs &, GrAAType, GrAppliedClip &&, GrProcessorSet &&)
Definition
GrTessellationShader.cpp:12
GrTessellationShader::viewMatrix
const SkMatrix & viewMatrix() const
Definition
GrTessellationShader.h:31
GrTessellationShader::GrTessellationShader
GrTessellationShader(ClassID classID, GrPrimitiveType primitiveType, const SkMatrix &viewMatrix, const SkPMColor4f &color)
Definition
GrTessellationShader.h:21
GrTessellationShader::MakeProgram
static GrProgramInfo * MakeProgram(const ProgramArgs &args, const GrTessellationShader *shader, const GrPipeline *pipeline, const GrUserStencilSettings *stencil)
Definition
GrTessellationShader.h:47
SkArenaAlloc
Definition
SkArenaAlloc.h:105
SkMatrix
Definition
SkMatrix.h:54
args
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
Definition
fl_event_channel.h:89
GrTessellationShader::ProgramArgs
Definition
GrTessellationShader.h:34
GrTessellationShader::ProgramArgs::fXferBarrierFlags
GrXferBarrierFlags fXferBarrierFlags
Definition
GrTessellationShader.h:39
GrTessellationShader::ProgramArgs::fWriteView
const GrSurfaceProxyView & fWriteView
Definition
GrTessellationShader.h:36
GrTessellationShader::ProgramArgs::fUsesMSAASurface
bool fUsesMSAASurface
Definition
GrTessellationShader.h:37
GrTessellationShader::ProgramArgs::fArena
SkArenaAlloc * fArena
Definition
GrTessellationShader.h:35
GrTessellationShader::ProgramArgs::fCaps
const GrCaps * fCaps
Definition
GrTessellationShader.h:41
GrTessellationShader::ProgramArgs::fColorLoadOp
GrLoadOp fColorLoadOp
Definition
GrTessellationShader.h:40
GrTessellationShader::ProgramArgs::fDstProxyView
const GrDstProxyView * fDstProxyView
Definition
GrTessellationShader.h:38
GrUserStencilSettings
Definition
GrUserStencilSettings.h:112
SkRGBA4f< kPremul_SkAlphaType >
Generated on Fri Apr 26 2024 06:17:13 for Flutter Engine by
1.9.8