Flutter Engine
The Flutter Engine
GrVkTextureRenderTarget.h
Go to the documentation of this file.
1/*
2 * Copyright 2015 Google Inc.
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
9#ifndef GrVkTextureRenderTarget_DEFINED
10#define GrVkTextureRenderTarget_DEFINED
11
15
16class GrVkGpu;
17
18#ifdef SK_BUILD_FOR_WIN
19// Windows gives bogus warnings about inheriting asTexture/asRenderTarget via dominance.
20#pragma warning(push)
21#pragma warning(disable: 4250)
22#endif
23
24class GrVkImageView;
25struct GrVkImageInfo;
26
28public:
30 skgpu::Budgeted budgeted,
33 uint32_t mipLevels,
34 int sampleCnt,
37 std::string_view label);
38
40 GrVkGpu*,
42 int sampleCnt,
45 const GrVkImageInfo&,
47
49
50protected:
51 void onAbandon() override {
52 // In order to correctly handle calling texture idle procs, GrVkTexture must go first.
55 }
56
57 void onRelease() override {
58 // In order to correctly handle calling texture idle procs, GrVkTexture must go first.
61 }
62
63private:
65 skgpu::Budgeted budgeted,
71 std::string_view label);
72
80 std::string_view label);
81
82 size_t onGpuMemorySize() const override;
83
84 void onSetLabel() override{}
85
86 // In Vulkan we call the release proc after we are finished with the underlying
87 // GrVkImage::Resource object (which occurs after the GPU has finished all work on it).
88 void onSetRelease(sk_sp<RefCntedReleaseProc> releaseHelper) override {
89 // Forward the release proc on to GrVkImage
90 GrVkTexture::onSetRelease(std::move(releaseHelper));
91 }
92};
93
94#ifdef SK_BUILD_FOR_WIN
95#pragma warning(pop)
96#endif
97
98#endif
GrWrapCacheable
Definition: GrTypesPriv.h:85
GrMipmapStatus
Definition: GrTypesPriv.h:523
GrWrapOwnership
Definition: GrTypesPriv.h:77
SkISize dimensions() const
Definition: GrSurface.h:27
bool isProtected() const
Definition: GrSurface.h:87
GrMipmapStatus mipmapStatus() const
Definition: GrTexture.h:66
void onAbandon() override
GrVkImage * colorAttachment() const
void onRelease() override
GrVkImage * resolveAttachment() const
GrBackendFormat backendFormat() const override
static sk_sp< GrVkTextureRenderTarget > MakeNewTextureRenderTarget(GrVkGpu *gpu, skgpu::Budgeted budgeted, SkISize dimensions, VkFormat format, uint32_t mipLevels, int sampleCnt, GrMipmapStatus mipmapStatus, GrProtected isProtected, std::string_view label)
static sk_sp< GrVkTextureRenderTarget > MakeWrappedTextureRenderTarget(GrVkGpu *, SkISize dimensions, int sampleCnt, GrWrapOwnership, GrWrapCacheable, const GrVkImageInfo &, sk_sp< skgpu::MutableTextureState >)
void onRelease() override
GrBackendFormat backendFormat() const override
Definition: GrVkTexture.h:46
void onAbandon() override
void onSetRelease(sk_sp< RefCntedReleaseProc > releaseHelper) override
Definition: GrVkTexture.h:80
uint32_t uint32_t * format
FlTexture * texture
Budgeted
Definition: GpuTypes.h:35
Protected
Definition: GpuTypes.h:61
Definition: SkSize.h:16
VkFormat
Definition: vulkan_core.h:1458