1 /* 2 * Copyright 2021 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 GrMtlFramebuffer_DEFINED 9 #define GrMtlFramebuffer_DEFINED 10 11 #include "include/gpu/GrTypes.h" 12 #include "include/gpu/mtl/GrMtlTypes.h" 13 #include "include/private/GrTypesPriv.h" 14 15 class GrMtlAttachment; 16 17 class GrMtlFramebuffer : public SkRefCnt { 18 public: 19 static sk_sp<const GrMtlFramebuffer> Make(GrMtlAttachment* colorAttachment, 20 GrMtlAttachment* resolveAttachment, 21 GrMtlAttachment* stencilAttachment); 22 colorAttachment()23 GrMtlAttachment* colorAttachment() { return fColorAttachment.get(); } resolveAttachment()24 GrMtlAttachment* resolveAttachment() { return fResolveAttachment.get(); } stencilAttachment()25 GrMtlAttachment* stencilAttachment() { return fStencilAttachment.get(); } 26 27 private: 28 GrMtlFramebuffer(sk_sp<GrMtlAttachment> colorAttachment, 29 sk_sp<GrMtlAttachment> resolveAttachment, 30 sk_sp<GrMtlAttachment> stencilAttachment); 31 ~GrMtlFramebuffer()32 ~GrMtlFramebuffer() override {} 33 34 sk_sp<GrMtlAttachment> fColorAttachment; 35 sk_sp<GrMtlAttachment> fResolveAttachment; 36 sk_sp<GrMtlAttachment> fStencilAttachment; 37 }; 38 39 #endif 40