Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
graphite
RasterPathUtils.h
Go to the documentation of this file.
1
/*
2
* Copyright 2024 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 skgpu_graphite_RasterPathUtils_DEFINED
9
#define skgpu_graphite_RasterPathUtils_DEFINED
10
11
#include "
include/private/base/SkNoncopyable.h
"
12
#include "
src/base/SkVx.h
"
13
#include "
src/core/SkAutoPixmapStorage.h
"
14
#include "
src/core/SkDrawBase.h
"
15
#include "
src/core/SkRasterClip.h
"
16
#include "
src/gpu/ResourceKey.h
"
17
18
namespace
skgpu::graphite
{
19
20
class
Shape
;
21
class
Transform
;
22
23
/**
24
* The RasterMaskHelper helps generate masks using the software rendering
25
* path. It is intended to be used as:
26
*
27
* RasterMaskHelper helper(pixmapstorage);
28
* helper.init(...);
29
* helper.drawShape(...);
30
*
31
* The result of this process will be the mask rendered in the Pixmap,
32
* at the upper left hand corner of the bounds.
33
*
34
* TODO: this could be extended to support clip masks, similar to GrSWMaskHelper.
35
*/
36
37
class
RasterMaskHelper
:
SkNoncopyable
{
38
public
:
39
RasterMaskHelper
(
SkAutoPixmapStorage
* pixels) : fPixels(pixels) {}
40
41
bool
init
(
SkISize
pixmapSize);
42
43
// Draw a single shape into the bitmap (as a path) at location resultBounds
44
void
drawShape
(
const
Shape
& shape,
45
const
Transform
&
transform
,
46
const
SkStrokeRec
& strokeRec,
47
const
SkIRect
& resultBounds);
48
49
private
:
50
SkAutoPixmapStorage
* fPixels;
51
SkDrawBase
fDraw;
52
SkRasterClip
fRasterClip;
53
};
54
55
skgpu::UniqueKey
GeneratePathMaskKey
(
const
Shape
& shape,
56
const
Transform
&
transform
,
57
const
SkStrokeRec
& strokeRec,
58
skvx::half2
maskSize);
59
}
// namespace skgpu::graphite
60
61
#endif
// skgpu_graphite_RasterPathUtils_DEFINED
ResourceKey.h
SkAutoPixmapStorage.h
SkDrawBase.h
SkNoncopyable.h
SkRasterClip.h
SkVx.h
Shape
Shape
Definition:
aaxfermodes.cpp:43
SkAutoPixmapStorage
Definition:
SkAutoPixmapStorage.h:21
SkDrawBase
Definition:
SkDrawBase.h:40
SkNoncopyable
Definition:
SkNoncopyable.h:18
SkRasterClip
Definition:
SkRasterClip.h:30
SkStrokeRec
Definition:
SkStrokeRec.h:22
skgpu::UniqueKey
Definition:
ResourceKey.h:241
skgpu::graphite::RasterMaskHelper
Definition:
RasterPathUtils.h:37
skgpu::graphite::RasterMaskHelper::init
bool init(SkISize pixmapSize)
Definition:
RasterPathUtils.cpp:19
skgpu::graphite::RasterMaskHelper::drawShape
void drawShape(const Shape &shape, const Transform &transform, const SkStrokeRec &strokeRec, const SkIRect &resultBounds)
Definition:
RasterPathUtils.cpp:41
skgpu::graphite::RasterMaskHelper::RasterMaskHelper
RasterMaskHelper(SkAutoPixmapStorage *pixels)
Definition:
RasterPathUtils.h:39
skgpu::graphite::Shape
Definition:
Shape.h:28
skgpu::graphite::Transform
Definition:
Transform_graphite.h:19
skgpu::graphite
Definition:
BoundsManagerBench.cpp:27
skgpu::graphite::GeneratePathMaskKey
skgpu::UniqueKey GeneratePathMaskKey(const Shape &shape, const Transform &transform, const SkStrokeRec &strokeRec, skvx::half2 maskSize)
Definition:
RasterPathUtils.cpp:69
sktext::gpu::Transform
skgpu::graphite::Transform Transform
Definition:
GraphiteVertexFiller.cpp:52
transform
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition:
p3.cpp:47
SkIRect
Definition:
SkRect.h:32
SkISize
Definition:
SkSize.h:16
skvx::Vec
Definition:
SkVx.h:83
Generated on Sun Jun 23 2024 21:56:27 for Flutter Engine by
1.9.4