blob: ba5a1d400f5e5192722e610f2cf7bf0012e5a6c0 [file] [log] [blame]
* Copyright 2011 Google Inc.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#ifndef GrGLMtlAttachment_DEFINED
#define GrGLMtlAttachment_DEFINED
#include "include/gpu/gl/GrGLInterface.h"
#include "src/gpu/GrAttachment.h"
class GrGLAttachment : public GrAttachment {
struct IDDesc {
IDDesc() : fRenderbufferID(0) {}
GrGLuint fRenderbufferID;
GrGpu* gpu, const IDDesc& idDesc, SkISize dimensions, UsageFlags supportedUsages,
int sampleCnt, GrGLFormat format)
: GrAttachment(gpu, dimensions, supportedUsages, sampleCnt, GrProtected::kNo)
, fFormat(format)
, fRenderbufferID(idDesc.fRenderbufferID) {
SkASSERT(supportedUsages == UsageFlags::kStencilAttachment);
GrBackendFormat backendFormat() const override;
GrGLuint renderbufferID() const { return fRenderbufferID; }
GrGLFormat format() const { return fFormat; }
// overrides of GrResource
void onRelease() override;
void onAbandon() override;
void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump,
const SkString& dumpName) const override;
GrGLFormat fFormat;
// may be zero for external SBs associated with external RTs
// (we don't require the client to give us the id, just tell
// us how many bits of stencil there are).
GrGLuint fRenderbufferID;
using INHERITED = GrAttachment;