Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
12
14
15namespace skgpu {
16 class RefCntedCallback;
17}
18
19namespace skgpu::graphite {
20
21class Context;
22class Device;
23class Recorder;
24
25class Image final : public Image_Base {
26public:
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.
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.
37 const TextureProxyView& srcView,
38 const SkColorInfo&,
39 const SkIRect& subset,
43
44 const TextureProxyView& textureProxyView() const { return fTextureProxyView; }
45
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
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
70private:
71
72 TextureProxyView fTextureProxyView;
73};
74
75} // namespace skgpu::graphite
76
77#endif // skgpu_graphite_Image_Graphite_DEFINED
SkBackingFit
size_t textureSize() const override
sk_sp< SkImage > onReinterpretColorSpace(sk_sp< SkColorSpace >) const override
bool onIsProtected() const override
static sk_sp< Image > Copy(Recorder *, const TextureProxyView &srcView, const SkColorInfo &, const SkIRect &subset, Budgeted, Mipmapped, SkBackingFit)
bool onHasMipmaps() const override
const TextureProxyView & textureProxyView() const
SkImage_Base::Type type() const override
static sk_sp< Image > WrapDevice(sk_sp< Device > device)
sk_sp< Image > copyImage(Recorder *, const SkIRect &subset, Budgeted, Mipmapped, SkBackingFit) const override
Mipmapped mipmapped() const
VkDevice device
Definition main.cc:53
Budgeted
Definition GpuTypes.h:35
Mipmapped
Definition GpuTypes.h:53