Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GrGLAttachment.h
Go to the documentation of this file.
1/*
2 * Copyright 2011 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#ifndef GrGLMtlAttachment_DEFINED
9#define GrGLMtlAttachment_DEFINED
10
13
14class GrGLGpu;
15
17public:
20 int sampleCnt,
22
25 int sampleCnt,
27
32 int sampleCnt,
36 /*label=*/"MakeWrappedRenderBuffer"));
37 }
38
39 GrBackendFormat backendFormat() const override;
40
41 GrGLuint renderbufferID() const { return fRenderbufferID; }
42
43 GrGLFormat format() const { return fFormat; }
44
45protected:
46 // overrides of GrResource
47 void onRelease() override;
48 void onAbandon() override;
49 void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump,
50 const SkString& dumpName) const override;
51
52private:
57 int sampleCnt,
59 std::string_view label)
60 : GrAttachment(gpu,
63 sampleCnt,
66 label)
67 , fFormat(format)
68 , fRenderbufferID(renderbufferID) {
72 }
73
74 void onSetLabel() override;
75
76 GrGLFormat fFormat;
77
78 // may be zero for external SBs associated with external RTs
79 // (we don't require the client to give us the id, just tell
80 // us how many bits of stencil there are).
81 GrGLuint fRenderbufferID;
82
83 using INHERITED = GrAttachment;
84};
85
86#endif
GrGLFormat
Definition GrGLTypes.h:59
unsigned int GrGLuint
Definition GrGLTypes.h:113
#define SkASSERT(cond)
Definition SkAssert.h:116
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
UsageFlags supportedUsages() const
void onSetLabel() override
void setMemoryBacking(SkTraceMemoryDump *traceMemoryDump, const SkString &dumpName) const override
GrGLuint renderbufferID() const
static sk_sp< GrGLAttachment > MakeStencil(GrGLGpu *gpu, SkISize dimensions, int sampleCnt, GrGLFormat format)
static sk_sp< GrGLAttachment > MakeMSAA(GrGLGpu *gpu, SkISize dimensions, int sampleCnt, GrGLFormat format)
static sk_sp< GrGLAttachment > MakeWrappedRenderBuffer(GrGpu *gpu, GrGLuint renderbufferID, SkISize dimensions, UsageFlags supportedUsages, int sampleCnt, GrGLFormat format)
GrGLFormat format() const
GrBackendFormat backendFormat() const override
void onRelease() override
void onAbandon() override
void registerWithCache(skgpu::Budgeted)
Definition GrGpu.h:62
SkISize dimensions() const
Definition GrSurface.h:27
Mipmapped
Definition GpuTypes.h:53
Protected
Definition GpuTypes.h:61