Flutter Engine
The Flutter Engine
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 std::string_view label);
44
45 const TextureProxyView& textureProxyView() const { return fTextureProxyView; }
46
48
49 bool onHasMipmaps() const override {
50 return fTextureProxyView.proxy()->mipmapped() == Mipmapped::kYes;
51 }
52
53 bool onIsProtected() const override {
54 return fTextureProxyView.proxy()->isProtected();
55 }
56
57 size_t textureSize() const override;
58
60 const SkIRect& subset,
64 std::string_view label) const override;
65
67
68#if defined(GRAPHITE_TEST_UTILS)
69 bool onReadPixelsGraphite(Recorder*,
70 const SkPixmap& dst,
71 int srcX,
72 int srcY) const override;
73#endif
74
75private:
76
77 TextureProxyView fTextureProxyView;
78};
79
80} // namespace skgpu::graphite
81
82#endif // skgpu_graphite_Image_Graphite_DEFINED
SkBackingFit
Definition: SkBackingFit.h:16
static sk_sp< Image > Copy(Recorder *, const TextureProxyView &srcView, const SkColorInfo &, const SkIRect &subset, Budgeted, Mipmapped, SkBackingFit, std::string_view label)
Image(TextureProxyView, const SkColorInfo &)
size_t textureSize() const override
sk_sp< Image > copyImage(Recorder *, const SkIRect &subset, Budgeted, Mipmapped, SkBackingFit, std::string_view label) const override
sk_sp< SkImage > onReinterpretColorSpace(sk_sp< SkColorSpace >) const override
bool onIsProtected() const override
bool onHasMipmaps() const override
const TextureProxyView & textureProxyView() const
SkImage_Base::Type type() const override
static sk_sp< Image > WrapDevice(sk_sp< Device > device)
Mipmapped mipmapped() const
Definition: TextureProxy.h:35
VkDevice device
Definition: main.cc:53
dst
Definition: cp.py:12
Definition: GpuTools.h:21
Budgeted
Definition: GpuTypes.h:35
Mipmapped
Definition: GpuTypes.h:53
Definition: SkRect.h:32