Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
graphite
geom
SubRunData.h
Go to the documentation of this file.
1
/*
2
* Copyright 2022 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_geom_SubRunData_DEFINED
9
#define skgpu_graphite_geom_SubRunData_DEFINED
10
11
#include "
include/core/SkM44.h
"
12
#include "
src/gpu/graphite/geom/Rect.h
"
13
#include "
src/text/gpu/SubRunContainer.h
"
14
15
namespace
sktext::gpu
{
class
AtlasSubRun
; }
16
17
namespace
skgpu::graphite
{
18
19
class
Recorder
;
20
21
/**
22
* SubRunData represents an AtlasSubRun subspan for which per-pixel coverage data comes from a
23
* persistent glyph atlas texture.
24
*
25
* The bounds() represent the bounds of the entire AtlasSubRun and does not directly map to the
26
* local coordinates of this particular subspan. Rather, the dimensions and offset coordinates of a
27
* subspan are defined in a coordinate space that is partially transformed by a decomposition of
28
* the local-to-device matrix computed by the AtlasSubRun per instance. The transform of the draw is
29
* the rest of the decomposed transform (often only a translation) that maps this intermediate space
30
* to the device-space coordinates of the draw.
31
*
32
* The local coordinates used in shading are derived by transforming the final device coordinates
33
* using the inverse of the local-to-device matrix.
34
*/
35
class
SubRunData
{
36
public
:
37
SubRunData
() =
delete
;
38
SubRunData
(
const
SubRunData
&
subRun
) =
default
;
39
SubRunData
(
SubRunData
&&) =
delete
;
40
41
SubRunData
(
const
sktext::gpu::AtlasSubRun
*
subRun
,
42
sk_sp<SkRefCnt>
supportDataKeepAlive,
43
Rect
deviceBounds,
44
const
SkM44
&
deviceToLocal
,
45
int
startGlyphIndex
,
46
int
glyphCount
,
47
Recorder
*
recorder
,
48
sktext::gpu::RendererData
rendererData
)
49
: fSubRun(
subRun
)
50
, fSupportDataKeepAlive(
std
::move(supportDataKeepAlive))
51
, fBounds(deviceBounds)
52
, fDeviceToLocal(
deviceToLocal
)
53
, fStartGlyphIndex(
startGlyphIndex
)
54
, fGlyphCount(
glyphCount
)
55
, fRecorder(
recorder
)
56
, fRendererData(
rendererData
) {}
57
58
~SubRunData
() =
default
;
59
60
// NOTE: None of the geometry types benefit from move semantics, so we don't bother
61
// defining a move assignment operator for SubRunData.
62
SubRunData
&
operator=
(
SubRunData
&&) =
delete
;
63
SubRunData
&
operator=
(
const
SubRunData
& that) =
default
;
64
65
// The bounding box of the originating AtlasSubRun.
66
Rect
bounds
()
const
{
return
fBounds; }
67
68
// The inverse local-to-device matrix.
69
const
SkM44
&
deviceToLocal
()
const
{
return
fDeviceToLocal; }
70
71
// Access the individual elements of the subrun data.
72
const
sktext::gpu::AtlasSubRun
*
subRun
()
const
{
return
fSubRun; }
73
int
startGlyphIndex
()
const
{
return
fStartGlyphIndex; }
74
int
glyphCount
()
const
{
return
fGlyphCount; }
75
Recorder
*
recorder
()
const
{
return
fRecorder; }
76
const
sktext::gpu::RendererData
&
rendererData
()
const
{
return
fRendererData; }
77
78
private
:
79
const
sktext::gpu::AtlasSubRun
* fSubRun;
80
// Keep the TextBlob or Slug alive until we're done with the Geometry.
81
sk_sp<SkRefCnt>
fSupportDataKeepAlive;
82
83
Rect
fBounds;
// bounds of the data stored in the SubRun
84
SkM44
fDeviceToLocal;
85
int
fStartGlyphIndex;
86
int
fGlyphCount;
87
Recorder
* fRecorder;
// this SubRun can only be associated with this Recorder's atlas
88
sktext::gpu::RendererData
fRendererData;
89
};
90
91
}
// namespace skgpu::graphite
92
93
#endif
// skgpu_graphite_geom_SubRunData_DEFINED
Rect.h
SkM44.h
SubRunContainer.h
SkM44
Definition
SkM44.h:150
sk_sp
Definition
SkRefCnt.h:220
skgpu::graphite::Recorder
Definition
Recorder.h:74
skgpu::graphite::Rect
Definition
Rect.h:27
skgpu::graphite::SubRunData
Definition
SubRunData.h:35
skgpu::graphite::SubRunData::SubRunData
SubRunData(const sktext::gpu::AtlasSubRun *subRun, sk_sp< SkRefCnt > supportDataKeepAlive, Rect deviceBounds, const SkM44 &deviceToLocal, int startGlyphIndex, int glyphCount, Recorder *recorder, sktext::gpu::RendererData rendererData)
Definition
SubRunData.h:41
skgpu::graphite::SubRunData::subRun
const sktext::gpu::AtlasSubRun * subRun() const
Definition
SubRunData.h:72
skgpu::graphite::SubRunData::SubRunData
SubRunData()=delete
skgpu::graphite::SubRunData::operator=
SubRunData & operator=(SubRunData &&)=delete
skgpu::graphite::SubRunData::~SubRunData
~SubRunData()=default
skgpu::graphite::SubRunData::startGlyphIndex
int startGlyphIndex() const
Definition
SubRunData.h:73
skgpu::graphite::SubRunData::deviceToLocal
const SkM44 & deviceToLocal() const
Definition
SubRunData.h:69
skgpu::graphite::SubRunData::operator=
SubRunData & operator=(const SubRunData &that)=default
skgpu::graphite::SubRunData::SubRunData
SubRunData(const SubRunData &subRun)=default
skgpu::graphite::SubRunData::bounds
Rect bounds() const
Definition
SubRunData.h:66
skgpu::graphite::SubRunData::glyphCount
int glyphCount() const
Definition
SubRunData.h:74
skgpu::graphite::SubRunData::recorder
Recorder * recorder() const
Definition
SubRunData.h:75
skgpu::graphite::SubRunData::SubRunData
SubRunData(SubRunData &&)=delete
skgpu::graphite::SubRunData::rendererData
const sktext::gpu::RendererData & rendererData() const
Definition
SubRunData.h:76
sktext::gpu::AtlasSubRun
Definition
SubRunContainer.h:82
skgpu::graphite
Definition
BoundsManagerBench.cpp:27
sktext::gpu
Definition
SkCanvas.h:81
std
Definition
ref_ptr.h:256
sktext::gpu::RendererData
Definition
SubRunContainer.h:63
Generated on Fri Apr 26 2024 06:17:17 for Flutter Engine by
1.9.8