blob: 226192281f569f498502b9c3b73524ed8946e7ec [file] [log] [blame]
/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrMockAttachment_DEFINED
#define GrMockAttachment_DEFINED
#include "src/gpu/ganesh/GrAttachment.h"
#include "src/gpu/ganesh/GrBackendUtils.h"
#include "src/gpu/ganesh/mock/GrMockGpu.h"
class GrMockAttachment : public GrAttachment {
public:
GrMockAttachment(GrMockGpu* gpu,
SkISize dimensions,
UsageFlags supportedUsages,
int sampleCnt,
std::string_view label)
: INHERITED(gpu, dimensions, supportedUsages, sampleCnt, GrMipmapped::kNo,
GrProtected::kNo, label) {
SkASSERT(supportedUsages == UsageFlags::kStencilAttachment);
this->registerWithCache(SkBudgeted::kYes);
}
GrBackendFormat backendFormat() const override {
return GrBackendFormat::MakeMock(GrColorType::kUnknown, SkImage::CompressionType::kNone,
/*isStencilFormat*/ true);
}
private:
using INHERITED = GrAttachment;
};
#endif