Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
ganesh
ops
SoftwarePathRenderer.h
Go to the documentation of this file.
1
/*
2
* Copyright 2012 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 SoftwarePathRenderer_DEFINED
9
#define SoftwarePathRenderer_DEFINED
10
11
#include "
src/gpu/ganesh/GrSurfaceProxyView.h
"
12
#include "
src/gpu/ganesh/PathRenderer.h
"
13
14
class
GrProxyProvider
;
15
16
namespace
skgpu::ganesh
{
17
18
/**
19
* This class uses the software side to render a path to an SkBitmap and
20
* then uploads the result to the gpu
21
*/
22
class
SoftwarePathRenderer
final :
public
PathRenderer
{
23
public
:
24
const
char
*
name
()
const override
{
return
"SW"
; }
25
26
SoftwarePathRenderer
(
GrProxyProvider
* proxyProvider,
bool
allowCaching)
27
: fProxyProvider(proxyProvider)
28
, fAllowCaching(allowCaching) {
29
}
30
31
static
bool
GetShapeAndClipBounds
(
SurfaceDrawContext
*,
32
const
GrClip
*,
33
const
GrStyledShape
&,
34
const
SkMatrix
& viewMatrix,
35
SkIRect
* unclippedDevShapeBounds,
36
SkIRect
* clippedDevShapeBounds,
37
SkIRect
* devClipBounds);
38
39
private
:
40
static
void
DrawNonAARect(
SurfaceDrawContext
*,
41
GrPaint
&&,
42
const
GrUserStencilSettings
&,
43
const
GrClip
*,
44
const
SkMatrix
& viewMatrix,
45
const
SkRect
& rect,
46
const
SkMatrix
& localMatrix);
47
static
void
DrawAroundInvPath(
SurfaceDrawContext
*,
48
GrPaint
&&,
49
const
GrUserStencilSettings
&,
50
const
GrClip
*,
51
const
SkMatrix
& viewMatrix,
52
const
SkIRect
& devClipBounds,
53
const
SkIRect
& devPathBounds);
54
55
// This utility draws a path mask using a provided paint. The rectangle is drawn in device
56
// space. The 'viewMatrix' will be used to ensure the correct local coords are provided to
57
// any fragment processors in the paint.
58
static
void
DrawToTargetWithShapeMask(
GrSurfaceProxyView
,
59
SurfaceDrawContext
*,
60
GrPaint
&&,
61
const
GrUserStencilSettings
&,
62
const
GrClip
*,
63
const
SkMatrix
& viewMatrix,
64
const
SkIPoint
& textureOriginInDeviceSpace,
65
const
SkIRect
& deviceSpaceRectToDraw);
66
67
StencilSupport
onGetStencilSupport
(
const
GrStyledShape
&)
const override
{
68
return
PathRenderer::kNoSupport_StencilSupport
;
69
}
70
71
CanDrawPath
onCanDrawPath
(
const
CanDrawPathArgs&)
const override
;
72
73
bool
onDrawPath
(
const
DrawPathArgs&)
override
;
74
75
private
:
76
GrProxyProvider
* fProxyProvider;
77
bool
fAllowCaching;
78
};
79
80
}
// namespace skgpu::ganesh
81
82
#endif
// SoftwarePathRenderer_DEFINED
GrSurfaceProxyView.h
PathRenderer.h
GrClip
Definition
GrClip.h:29
GrPaint
Definition
GrPaint.h:40
GrProxyProvider
Definition
GrProxyProvider.h:28
GrStyledShape
Definition
GrStyledShape.h:48
GrSurfaceProxyView
Definition
GrSurfaceProxyView.h:34
SkMatrix
Definition
SkMatrix.h:54
skgpu::ganesh::PathRenderer
Definition
PathRenderer.h:36
skgpu::ganesh::PathRenderer::StencilSupport
StencilSupport
Definition
PathRenderer.h:60
skgpu::ganesh::PathRenderer::kNoSupport_StencilSupport
@ kNoSupport_StencilSupport
Definition
PathRenderer.h:61
skgpu::ganesh::PathRenderer::CanDrawPath
CanDrawPath
Definition
PathRenderer.h:75
skgpu::ganesh::SoftwarePathRenderer
Definition
SoftwarePathRenderer.h:22
skgpu::ganesh::SoftwarePathRenderer::onGetStencilSupport
StencilSupport onGetStencilSupport(const GrStyledShape &) const override
Definition
SoftwarePathRenderer.h:67
skgpu::ganesh::SoftwarePathRenderer::onCanDrawPath
CanDrawPath onCanDrawPath(const CanDrawPathArgs &) const override
Definition
SoftwarePathRenderer.cpp:115
skgpu::ganesh::SoftwarePathRenderer::name
const char * name() const override
Definition
SoftwarePathRenderer.h:24
skgpu::ganesh::SoftwarePathRenderer::SoftwarePathRenderer
SoftwarePathRenderer(GrProxyProvider *proxyProvider, bool allowCaching)
Definition
SoftwarePathRenderer.h:26
skgpu::ganesh::SoftwarePathRenderer::GetShapeAndClipBounds
static bool GetShapeAndClipBounds(SurfaceDrawContext *, const GrClip *, const GrStyledShape &, const SkMatrix &viewMatrix, SkIRect *unclippedDevShapeBounds, SkIRect *clippedDevShapeBounds, SkIRect *devClipBounds)
Definition
SoftwarePathRenderer.cpp:130
skgpu::ganesh::SoftwarePathRenderer::onDrawPath
bool onDrawPath(const DrawPathArgs &) override
Definition
SoftwarePathRenderer.cpp:238
skgpu::ganesh::SurfaceDrawContext
Definition
SurfaceDrawContext.h:65
skgpu::ganesh
Definition
TessellateBench.cpp:24
GrUserStencilSettings
Definition
GrUserStencilSettings.h:112
SkIPoint
Definition
SkPoint_impl.h:28
SkIRect
Definition
SkRect.h:32
SkRect
Definition
extension.cpp:13
Generated on Fri Apr 26 2024 06:17:10 for Flutter Engine by
1.9.8