Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
12
17
18namespace skgpu::ganesh {
19
20class 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 */
29public:
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. */
51
52 /** Returns a direct pointer to the atlas path renderer, or null if it is not in the
53 chain. */
55
56 /** Returns a direct pointer to the tessellation path renderer, or null if it is not in the
57 chain. */
59 return fTessellationPathRenderer;
60 }
61
62private:
63 enum {
64 kPreAllocCount = 8,
65 };
67 AtlasPathRenderer* fAtlasPathRenderer = nullptr;
68 PathRenderer* fTessellationPathRenderer = nullptr;
69};
70
71} // namespace skgpu::ganesh
72
73#endif // PathRendererChain_DEFINED
GpuPathRenderers
PathRenderer * getPathRenderer(const PathRenderer::CanDrawPathArgs &, DrawType, PathRenderer::StencilSupport *)
skgpu::ganesh::AtlasPathRenderer * getAtlasPathRenderer()