xref: /third_party/skia/src/gpu/mock/GrMockAttachment.h (revision cb93a386)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/skia/src/gpu/mock/
1/*
2 * Copyright 2017 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 GrMockAttachment_DEFINED
9#define GrMockAttachment_DEFINED
10
11#include "src/gpu/GrAttachment.h"
12#include "src/gpu/GrBackendUtils.h"
13#include "src/gpu/mock/GrMockGpu.h"
14
15class GrMockAttachment : public GrAttachment {
16public:
17    GrMockAttachment(GrMockGpu* gpu, SkISize dimensions, UsageFlags supportedUsages, int sampleCnt)
18            : INHERITED(gpu, dimensions, supportedUsages, sampleCnt, GrMipmapped::kNo,
19                        GrProtected::kNo) {
20        SkASSERT(supportedUsages == UsageFlags::kStencilAttachment);
21        this->registerWithCache(SkBudgeted::kYes);
22    }
23
24    GrBackendFormat backendFormat() const override {
25        return GrBackendFormat::MakeMock(GrColorType::kUnknown, SkImage::CompressionType::kNone,
26                                         /*isStencilFormat*/ true);
27    }
28
29private:
30    using INHERITED = GrAttachment;
31};
32
33#endif
34

Indexes created Thu Nov 07 10:32:03 CST 2024