Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
ganesh
PathRendererChain.h
Go to the documentation of this file.
1
/*
2
* Copyright 2011 Google Inc.
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 PathRendererChain_DEFINED
9
#define PathRendererChain_DEFINED
10
11
#include "
src/gpu/ganesh/PathRenderer.h
"
12
13
#include "
include/core/SkTypes.h
"
14
#include "
include/private/base/SkNoncopyable.h
"
15
#include "
include/private/base/SkTArray.h
"
16
#include "
include/private/gpu/ganesh/GrTypesPriv.h
"
17
18
namespace
skgpu::ganesh
{
19
20
class
AtlasPathRenderer;
21
22
/**
23
* Keeps track of an ordered list of path renderers. When a path needs to be
24
* drawn this list is scanned to find the most preferred renderer. To add your
25
* path renderer to the list implement the GrPathRenderer::AddPathRenderers
26
* function.
27
*/
28
class
PathRendererChain
:
public
SkNoncopyable
{
29
public
:
30
struct
Options
{
31
bool
fAllowPathMaskCaching
=
false
;
32
GpuPathRenderers
fGpuPathRenderers
=
GpuPathRenderers::kDefault
;
33
};
34
PathRendererChain
(
GrRecordingContext
*,
const
Options
&);
35
36
/** Documents how the caller plans to use a GrPathRenderer to draw a path. It affects the PR
37
returned by getPathRenderer */
38
enum class
DrawType
{
39
kColor
,
// draw to the color buffer, no AA
40
kStencil
,
// draw just to the stencil buffer
41
kStencilAndColor
,
// draw the stencil and color buffer, no AA
42
};
43
44
/** Returns a GrPathRenderer compatible with the request if one is available. If the caller
45
is drawing the path to the stencil buffer then stencilSupport can be used to determine
46
whether the path can be rendered with arbitrary stencil rules or not. See comments on
47
StencilSupport in GrPathRenderer.h. */
48
PathRenderer
*
getPathRenderer
(
const
PathRenderer::CanDrawPathArgs
&,
49
DrawType
,
50
PathRenderer::StencilSupport
*);
51
52
/** Returns a direct pointer to the atlas path renderer, or null if it is not in the
53
chain. */
54
skgpu::ganesh::AtlasPathRenderer
*
getAtlasPathRenderer
() {
return
fAtlasPathRenderer; }
55
56
/** Returns a direct pointer to the tessellation path renderer, or null if it is not in the
57
chain. */
58
PathRenderer
*
getTessellationPathRenderer
() {
59
return
fTessellationPathRenderer;
60
}
61
62
private
:
63
enum
{
64
kPreAllocCount = 8,
65
};
66
skia_private::STArray<kPreAllocCount, sk_sp<PathRenderer>
> fChain;
67
AtlasPathRenderer* fAtlasPathRenderer =
nullptr
;
68
PathRenderer* fTessellationPathRenderer =
nullptr
;
69
};
70
71
}
// namespace skgpu::ganesh
72
73
#endif
// PathRendererChain_DEFINED
DrawType
DrawType
Definition
AlternatingColorPatternBench.cpp:35
GrTypesPriv.h
GpuPathRenderers
GpuPathRenderers
Definition
GrTypesPriv.h:505
GpuPathRenderers::kDefault
@ kDefault
PathRenderer.h
SkNoncopyable.h
SkTArray.h
SkTypes.h
GrRecordingContext
Definition
GrRecordingContext.h:42
SkNoncopyable
Definition
SkNoncopyable.h:18
skgpu::ganesh::AtlasPathRenderer
Definition
AtlasPathRenderer.h:27
skgpu::ganesh::PathRendererChain
Definition
PathRendererChain.h:28
skgpu::ganesh::PathRendererChain::getPathRenderer
PathRenderer * getPathRenderer(const PathRenderer::CanDrawPathArgs &, DrawType, PathRenderer::StencilSupport *)
Definition
PathRendererChain.cpp:72
skgpu::ganesh::PathRendererChain::getTessellationPathRenderer
PathRenderer * getTessellationPathRenderer()
Definition
PathRendererChain.h:58
skgpu::ganesh::PathRendererChain::getAtlasPathRenderer
skgpu::ganesh::AtlasPathRenderer * getAtlasPathRenderer()
Definition
PathRendererChain.h:54
skgpu::ganesh::PathRendererChain::DrawType
DrawType
Definition
PathRendererChain.h:38
skgpu::ganesh::PathRendererChain::DrawType::kStencilAndColor
@ kStencilAndColor
skgpu::ganesh::PathRendererChain::DrawType::kStencil
@ kStencil
skgpu::ganesh::PathRendererChain::DrawType::kColor
@ kColor
skgpu::ganesh::PathRenderer
Definition
PathRenderer.h:36
skgpu::ganesh::PathRenderer::StencilSupport
StencilSupport
Definition
PathRenderer.h:60
skia_private::STArray
Definition
SkTArray.h:744
skgpu::ganesh
Definition
TessellateBench.cpp:24
skgpu::ganesh::PathRendererChain::Options
Definition
PathRendererChain.h:30
skgpu::ganesh::PathRendererChain::Options::fAllowPathMaskCaching
bool fAllowPathMaskCaching
Definition
PathRendererChain.h:31
skgpu::ganesh::PathRendererChain::Options::fGpuPathRenderers
GpuPathRenderers fGpuPathRenderers
Definition
PathRendererChain.h:32
skgpu::ganesh::PathRenderer::CanDrawPathArgs
Definition
PathRenderer.h:81
Generated on Fri Apr 26 2024 06:17:11 for Flutter Engine by
1.9.8