Flutter Engine
The Flutter Engine
GrTextureRenderTargetProxy.h
Go to the documentation of this file.
1/*
2 * Copyright 2016 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#ifndef GrTextureRenderTargetProxy_DEFINED
8#define GrTextureRenderTargetProxy_DEFINED
9
11#include "include/gpu/GrTypes.h"
16
17#include <cstddef>
18#include <string_view>
19
20class GrBackendFormat;
22class GrSurface;
23enum class GrDDLProvider : bool;
24enum class GrInternalSurfaceFlags;
25enum class GrMipmapStatus;
26enum class SkBackingFit;
27struct SkISize;
28
29namespace skgpu {
30enum class Budgeted : bool;
31enum class Mipmapped : bool;
32} // namespace skgpu
33
34#ifdef SK_BUILD_FOR_WIN
35// Windows gives warnings about inheriting asTextureProxy/asRenderTargetProxy via dominance.
36#pragma warning(push)
37#pragma warning(disable: 4250)
38#endif
39
40// This class delays the acquisition of RenderTargets that are also textures until
41// they are actually required
42// Beware: the uniqueID of the TextureRenderTargetProxy will usually be different than
43// the uniqueID of the RenderTarget/Texture it represents!
45private:
46 // DDL TODO: rm the GrSurfaceProxy friending
47 friend class GrSurfaceProxy; // for ctors
48 friend class GrProxyProvider; // for ctors
49
50 // Deferred version
52 const GrBackendFormat&,
53 SkISize,
54 int sampleCnt,
62 GrDDLProvider creatingProvider,
63 std::string_view label);
64
65 // Lazy-callback version
68 const GrBackendFormat&,
69 SkISize,
70 int sampleCnt,
78 GrDDLProvider creatingProvider,
79 std::string_view label);
80
81 // Wrapped version
84 GrDDLProvider creatingProvider);
85
86 void initSurfaceFlags(const GrCaps&);
87
88 bool instantiate(GrResourceProvider*) override;
89 sk_sp<GrSurface> createSurface(GrResourceProvider*) const override;
90
91 size_t onUninstantiatedGpuMemorySize() const override;
92 LazySurfaceDesc callbackDesc() const override;
93 SkDEBUGCODE(void onValidateSurface(const GrSurface*) override;)
94};
95
96#ifdef SK_BUILD_FOR_WIN
97#pragma warning(pop)
98#endif
99
100#endif
GrDDLProvider
Definition: GrTypesPriv.h:71
GrMipmapStatus
Definition: GrTypesPriv.h:523
GrInternalSurfaceFlags
Definition: GrTypesPriv.h:436
SkBackingFit
Definition: SkBackingFit.h:16
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
Definition: GrCaps.h:57
std::function< LazyCallbackResult(GrResourceProvider *, const LazySurfaceDesc &)> LazyInstantiateCallback
Definition: GpuTools.h:21
Budgeted
Definition: GpuTypes.h:35
Mipmapped
Definition: GpuTypes.h:53
Protected
Definition: GpuTypes.h:61
Definition: SkSize.h:16