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 11 #include "src/gpu/GrSurfaceProxy.h" 12 13 class GrMockSurfaceProxy : public GrSurfaceProxy { 14 public: GrMockSurfaceProxy(SkString name)15 GrMockSurfaceProxy(SkString name) : GrSurfaceProxy( 16 GrBackendFormat::MakeMock(GrColorType::kRGBA_8888, SkImage::CompressionType::kNone), 17 SkISize::Make(1, 1), 18 SkBackingFit::kExact, 19 SkBudgeted::kNo, 20 GrProtected::kNo, 21 GrInternalSurfaceFlags::kNone, 22 UseAllocator::kNo) { 23 SkDEBUGCODE(this->setDebugName(std::move(name))); 24 } 25 instantiate(GrResourceProvider *)26 bool instantiate(GrResourceProvider*) override { return false; } SkDEBUGCODE(void onValidateSurface (const GrSurface *)override{} )27 SkDEBUGCODE(void onValidateSurface(const GrSurface*) override {} ) 28 size_t onUninstantiatedGpuMemorySize() const override { return 0; } 29 30 protected: createSurface(GrResourceProvider *)31 sk_sp<GrSurface> createSurface(GrResourceProvider*) const override { return nullptr; } 32 33 private: callbackDesc()34 LazySurfaceDesc callbackDesc() const override { SkUNREACHABLE; } 35 }; 36 37 #endif 38