Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
graphite
Image_Graphite.h
Go to the documentation of this file.
1
/*
2
* Copyright 2021 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_Image_Graphite_DEFINED
9
#define skgpu_graphite_Image_Graphite_DEFINED
10
11
#include "
src/gpu/graphite/Image_Base_Graphite.h
"
12
13
#include "
src/gpu/graphite/TextureProxyView.h
"
14
15
namespace
skgpu
{
16
class
RefCntedCallback;
17
}
18
19
namespace
skgpu::graphite
{
20
21
class
Context
;
22
class
Device;
23
class
Recorder
;
24
25
class
Image
final :
public
Image_Base
{
26
public
:
27
Image
(
TextureProxyView
,
const
SkColorInfo
&);
28
~Image
()
override
;
29
30
// Create an Image that wraps the Device and automatically flushes or references the Device's
31
// pending tasks when the Image is used in a draw to another canvas.
32
static
sk_sp<Image>
WrapDevice
(
sk_sp<Device>
device
);
33
34
// Create an Image by copying the provided texture proxy view into a new texturable proxy.
35
// The source texture does not have to be texturable if it is blittable.
36
static
sk_sp<Image>
Copy
(
Recorder
*,
37
const
TextureProxyView
& srcView,
38
const
SkColorInfo
&,
39
const
SkIRect
& subset,
40
Budgeted
,
41
Mipmapped
,
42
SkBackingFit
);
43
44
const
TextureProxyView
&
textureProxyView
()
const
{
return
fTextureProxyView; }
45
46
SkImage_Base::Type
type
()
const override
{
return
SkImage_Base::Type::kGraphite
; }
47
48
bool
onHasMipmaps
()
const override
{
49
return
fTextureProxyView.
proxy
()->
mipmapped
() == Mipmapped::kYes;
50
}
51
52
bool
onIsProtected
()
const override
{
53
return
fTextureProxyView.
proxy
()->
isProtected
();
54
}
55
56
size_t
textureSize
()
const override
;
57
58
sk_sp<Image>
copyImage
(
Recorder
*,
const
SkIRect
& subset,
59
Budgeted
,
Mipmapped
,
SkBackingFit
)
const override
;
60
61
sk_sp<SkImage>
onReinterpretColorSpace
(
sk_sp<SkColorSpace>
)
const override
;
62
63
#if defined(GRAPHITE_TEST_UTILS)
64
bool
onReadPixelsGraphite(
Recorder
*,
65
const
SkPixmap
& dst,
66
int
srcX,
67
int
srcY)
const override
;
68
#endif
69
70
private
:
71
72
TextureProxyView
fTextureProxyView;
73
};
74
75
}
// namespace skgpu::graphite
76
77
#endif
// skgpu_graphite_Image_Graphite_DEFINED
Image_Base_Graphite.h
SkBackingFit
SkBackingFit
Definition
SkBackingFit.h:16
TextureProxyView.h
SkColorInfo
Definition
SkImageInfo.h:111
SkImage_Base::Type
Type
Definition
SkImage_Base.h:132
SkImage_Base::Type::kGraphite
@ kGraphite
SkPixmap
Definition
SkPixmap.h:40
sk_sp
Definition
SkRefCnt.h:220
skgpu::graphite::Image_Base
Definition
Image_Base_Graphite.h:26
skgpu::graphite::Image
Definition
Image_Graphite.h:25
skgpu::graphite::Image::~Image
~Image() override
skgpu::graphite::Image::textureSize
size_t textureSize() const override
Definition
Image_Graphite.cpp:114
skgpu::graphite::Image::onReinterpretColorSpace
sk_sp< SkImage > onReinterpretColorSpace(sk_sp< SkColorSpace >) const override
Definition
Image_Graphite.cpp:136
skgpu::graphite::Image::onIsProtected
bool onIsProtected() const override
Definition
Image_Graphite.h:52
skgpu::graphite::Image::Copy
static sk_sp< Image > Copy(Recorder *, const TextureProxyView &srcView, const SkColorInfo &, const SkIRect &subset, Budgeted, Mipmapped, SkBackingFit)
Definition
Image_Graphite.cpp:56
skgpu::graphite::Image::onHasMipmaps
bool onHasMipmaps() const override
Definition
Image_Graphite.h:48
skgpu::graphite::Image::textureProxyView
const TextureProxyView & textureProxyView() const
Definition
Image_Graphite.h:44
skgpu::graphite::Image::type
SkImage_Base::Type type() const override
Definition
Image_Graphite.h:46
skgpu::graphite::Image::WrapDevice
static sk_sp< Image > WrapDevice(sk_sp< Device > device)
Definition
Image_Graphite.cpp:42
skgpu::graphite::Image::copyImage
sk_sp< Image > copyImage(Recorder *, const SkIRect &subset, Budgeted, Mipmapped, SkBackingFit) const override
Definition
Image_Graphite.cpp:126
skgpu::graphite::Recorder
Definition
Recorder.h:74
skgpu::graphite::TextureProxyView
Definition
TextureProxyView.h:23
skgpu::graphite::TextureProxyView::proxy
TextureProxy * proxy() const
Definition
TextureProxyView.h:63
skgpu::graphite::TextureProxy::mipmapped
Mipmapped mipmapped() const
Definition
TextureProxy.h:34
skgpu::graphite::TextureProxy::isProtected
bool isProtected() const
Definition
TextureProxy.cpp:72
device
VkDevice device
Definition
main.cc:53
skgpu::graphite
Definition
BoundsManagerBench.cpp:27
skgpu
Definition
GpuTools.h:21
skgpu::Budgeted
Budgeted
Definition
GpuTypes.h:35
skgpu::Mipmapped
Mipmapped
Definition
GpuTypes.h:53
Context
Definition
SerialProcsTest.cpp:126
SkIRect
Definition
SkRect.h:32
Generated on Fri Apr 26 2024 06:17:18 for Flutter Engine by
1.9.8