Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
ganesh
GrMeshBuffers.h
Go to the documentation of this file.
1
/*
2
* Copyright 2023 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 GrMeshBuffers_DEFINED
9
#define GrMeshBuffers_DEFINED
10
11
#include "
include/core/SkRefCnt.h
"
12
#include "
include/gpu/GrDirectContext.h
"
13
#include "
include/private/base/SkAssert.h
"
14
#include "
include/private/gpu/ganesh/GrTypesPriv.h
"
15
#include "
src/core/SkMeshPriv.h
"
16
#include "
src/gpu/ganesh/GrGpuBuffer.h
"
17
18
#include <cstddef>
19
20
template
<
typename
Base, GrGpuBufferType>
class
GrMeshBuffer
final :
public
Base {
21
public
:
22
GrMeshBuffer
() =
default
;
23
24
~GrMeshBuffer
()
override
;
25
26
static
sk_sp<Base>
Make
(
GrDirectContext
*,
const
void
*
data
,
size_t
size
);
27
28
size_t
size
()
const override
{
29
SkASSERT
(fBuffer);
30
return
fBuffer->
size
();
31
}
32
33
bool
isGaneshBacked
()
const override
{
return
true
; }
34
35
sk_sp<const GrGpuBuffer>
asGpuBuffer
()
const
{
return
fBuffer; }
36
37
private
:
38
bool
onUpdate(
GrDirectContext
*,
const
void
*
data
,
size_t
offset
,
size_t
size
)
override
;
39
40
sk_sp<GrGpuBuffer>
fBuffer;
41
GrDirectContext::DirectContextID
fContextID;
42
};
43
44
namespace
SkMeshPriv
{
45
using
GaneshIndexBuffer
=
GrMeshBuffer<SkMeshPriv::IB, GrGpuBufferType::kIndex >
;
46
using
GaneshVertexBuffer
=
GrMeshBuffer<SkMeshPriv::VB, GrGpuBufferType::kVertex>
;
47
}
// namespace SkMeshPriv
48
49
#endif
GrDirectContext.h
GrGpuBuffer.h
GrTypesPriv.h
SkAssert.h
SkASSERT
#define SkASSERT(cond)
Definition:
SkAssert.h:116
SkMeshPriv.h
SkRefCnt.h
GrDirectContext::DirectContextID
Definition:
GrDirectContext.h:886
GrDirectContext
Definition:
GrDirectContext.h:60
GrGpuBuffer::size
size_t size() const final
Definition:
GrGpuBuffer.h:34
GrMeshBuffer
Definition:
GrMeshBuffers.h:20
GrMeshBuffer::isGaneshBacked
bool isGaneshBacked() const override
Definition:
GrMeshBuffers.h:33
GrMeshBuffer::GrMeshBuffer
GrMeshBuffer()=default
GrMeshBuffer::size
size_t size() const override
Definition:
GrMeshBuffers.h:28
GrMeshBuffer::~GrMeshBuffer
~GrMeshBuffer() override
Definition:
GrMeshBuffers.cpp:29
GrMeshBuffer::Make
static sk_sp< Base > Make(GrDirectContext *, const void *data, size_t size)
Definition:
GrMeshBuffers.cpp:34
GrMeshBuffer::asGpuBuffer
sk_sp< const GrGpuBuffer > asGpuBuffer() const
Definition:
GrMeshBuffers.h:35
sk_sp
Definition:
SkRefCnt.h:220
SkMeshPriv
Definition:
SkMeshPriv.h:81
offset
SeparatedVector2 offset
Definition:
stroke_path_geometry.cc:311
data
std::shared_ptr< const fml::Mapping > data
Definition:
texture_gles.cc:63
Generated on Sun Jun 23 2024 21:56:20 for Flutter Engine by
1.9.4