Flutter Engine
The Flutter Engine
GrMockSurfaceProxy.h
Go to the documentation of this file.
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 GrMockSurfaceProxy_DEFINED
9#define GrMockSurfaceProxy_DEFINED
10
12#include "include/core/SkSize.h"
22
23#include <cstddef>
24#include <string_view>
25#include <utility>
26
28class GrSurface;
29
31public:
32 GrMockSurfaceProxy(SkString name, std::string_view label)
35 SkISize::Make(1, 1),
41 label) {
42 SkDEBUGCODE(this->setDebugName(std::move(name)));
43 }
44
45 bool instantiate(GrResourceProvider*) override { return false; }
46 SkDEBUGCODE(void onValidateSurface(const GrSurface*) override {} )
47 size_t onUninstantiatedGpuMemorySize() const override { return 0; }
48
49protected:
50 sk_sp<GrSurface> createSurface(GrResourceProvider*) const override { return nullptr; }
51
52private:
53 LazySurfaceDesc callbackDesc() const override { SkUNREACHABLE; }
54};
55
56#endif
GrColorType
Definition: GrTypesPriv.h:540
GrInternalSurfaceFlags
Definition: GrTypesPriv.h:436
#define SkUNREACHABLE
Definition: SkAssert.h:135
SkBackingFit
Definition: SkBackingFit.h:16
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
SkTextureCompressionType
sk_sp< GrSurface > createSurface(GrResourceProvider *) const override
bool instantiate(GrResourceProvider *) override
GrMockSurfaceProxy(SkString name, std::string_view label)
SkDEBUGCODE(void onValidateSurface(const GrSurface *) override {}) size_t onUninstantiatedGpuMemorySize() const override
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
Definition: GpuTools.h:21
Budgeted
Definition: GpuTypes.h:35
Protected
Definition: GpuTypes.h:61
Definition: SkSize.h:16