Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
tools
gpu
BackendTextureImageFactory.h
Go to the documentation of this file.
1
/*
2
* Copyright 2020 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
#include "
include/core/SkColor.h
"
9
#include "
include/core/SkImageInfo.h
"
10
#include "
include/core/SkRefCnt.h
"
11
#include "
include/gpu/GpuTypes.h
"
12
#include "
include/gpu/GrTypes.h
"
13
14
class
SkColorSpace
;
15
class
SkImage
;
16
class
SkPixmap
;
17
struct
SkISize
;
18
19
#ifdef SK_GANESH
20
class
GrDirectContext
;
21
#endif
22
23
#ifdef SK_GRAPHITE
24
namespace
skgpu::graphite
{
25
class
Recorder
;
26
}
27
using
Origin
=
skgpu::Origin
;
// TODO: Can we migrate Ganesh to use this?
28
#endif
29
30
namespace
sk_gpu_test
{
31
32
using
Mipmapped
=
skgpu::Mipmapped
;
33
using
Protected
=
skgpu::Protected
;
34
using
Renderable
=
skgpu::Renderable
;
35
36
#ifdef SK_GANESH
37
/**
38
* Creates a backend texture with pixmap contents and wraps it in a SkImage that safely deletes
39
* the texture when it goes away. Unlike using makeTextureImage() on a non-GPU image, this will
40
* fail rather than fallback if the pixmaps's color type doesn't map to a supported texture format.
41
* For testing purposes the texture can be made renderable to exercise different code paths for
42
* renderable textures/formats.
43
*/
44
sk_sp<SkImage>
MakeBackendTextureImage(
GrDirectContext
*,
45
const
SkPixmap
&,
46
Renderable
,
47
GrSurfaceOrigin
,
48
Protected
= Protected::kNo);
49
50
/** Creates a solid color image. */
51
sk_sp<SkImage>
MakeBackendTextureImage(
GrDirectContext
*,
52
const
SkImageInfo
&
info
,
53
SkColor4f
,
54
Mipmapped
= Mipmapped::kNo,
55
Renderable
= Renderable::kNo,
56
GrSurfaceOrigin
=
GrSurfaceOrigin::kTopLeft_GrSurfaceOrigin
,
57
Protected
isProtected = Protected::kNo);
58
#endif
// SK_GANESH
59
60
#ifdef SK_GRAPHITE
61
/*
62
* Graphite versions of MakeBackendTextureImage
63
*/
64
sk_sp<SkImage>
MakeBackendTextureImage(
skgpu::graphite::Recorder
*,
65
const
SkPixmap
&,
66
Mipmapped
,
67
Renderable
,
68
Origin,
69
Protected
= Protected::kNo);
70
71
/** Creates a solid color image. */
72
sk_sp<SkImage>
MakeBackendTextureImage(
skgpu::graphite::Recorder
*,
73
const
SkImageInfo
&,
74
SkColor4f
,
75
Mipmapped
,
76
Renderable
,
77
Origin,
78
Protected
= Protected::kNo);
79
80
#endif
// SK_GRAPHITE
81
82
}
// namespace sk_gpu_test
info
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition
DM.cpp:213
GpuTypes.h
GrTypes.h
GrSurfaceOrigin
GrSurfaceOrigin
Definition
GrTypes.h:147
kTopLeft_GrSurfaceOrigin
@ kTopLeft_GrSurfaceOrigin
Definition
GrTypes.h:148
SkColor.h
SkImageInfo.h
SkRefCnt.h
GrDirectContext
Definition
GrDirectContext.h:60
SkColorSpace
Definition
SkColorSpace.h:107
SkImage
Definition
SkImage.h:272
SkPixmap
Definition
SkPixmap.h:40
sk_sp
Definition
SkRefCnt.h:220
skgpu::graphite::Recorder
Definition
Recorder.h:74
sk_gpu_test
Definition
gm_bindings.cpp:339
skgpu::graphite
Definition
BoundsManagerBench.cpp:27
skgpu::Origin
Origin
Definition
GpuTypes.h:77
skgpu::Renderable
Renderable
Definition
GpuTypes.h:69
skgpu::Mipmapped
Mipmapped
Definition
GpuTypes.h:53
skgpu::Protected
Protected
Definition
GpuTypes.h:61
SkColor4f
SkISize
Definition
SkSize.h:16
SkImageInfo
Definition
SkImageInfo.h:208
Generated on Fri Apr 26 2024 06:18:10 for Flutter Engine by
1.9.8