1 /* 2 * Copyright 2019 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 #include "include/private/GrImageContext.h" 9 10 #include "src/gpu/GrCaps.h" 11 #include "src/gpu/GrImageContextPriv.h" 12 #include "src/gpu/GrProxyProvider.h" 13 #include "src/gpu/GrSkSLFPFactoryCache.h" 14 15 #define ASSERT_SINGLE_OWNER \ 16 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(this->singleOwner());) 17 18 /////////////////////////////////////////////////////////////////////////////////////////////////// GrImageContext(GrBackendApi backend,const GrContextOptions & options,uint32_t contextID)19GrImageContext::GrImageContext(GrBackendApi backend, 20 const GrContextOptions& options, 21 uint32_t contextID) 22 : INHERITED(backend, options, contextID) { 23 fProxyProvider.reset(new GrProxyProvider(this)); 24 } 25 ~GrImageContext()26GrImageContext::~GrImageContext() {} 27 abandonContext()28void GrImageContext::abandonContext() { 29 ASSERT_SINGLE_OWNER 30 31 fAbandoned = true; 32 } 33 abandoned() const34bool GrImageContext::abandoned() const { 35 ASSERT_SINGLE_OWNER 36 37 return fAbandoned; 38 } 39 40 /////////////////////////////////////////////////////////////////////////////////////////////////// refCaps() const41sk_sp<const GrCaps> GrImageContextPriv::refCaps() const { 42 return fContext->refCaps(); 43 } 44 fpFactoryCache()45sk_sp<GrSkSLFPFactoryCache> GrImageContextPriv::fpFactoryCache() { 46 return fContext->fpFactoryCache(); 47 } 48