• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "GrImageContext.h"
9 
10 #include "GrCaps.h"
11 #include "GrImageContextPriv.h"
12 #include "GrProxyProvider.h"
13 #include "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)19 GrImageContext::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()26 GrImageContext::~GrImageContext() {}
27 
abandonContext()28 void GrImageContext::abandonContext() {
29     ASSERT_SINGLE_OWNER
30 
31     fAbandoned = true;
32 }
33 
abandoned() const34 bool GrImageContext::abandoned() const {
35     ASSERT_SINGLE_OWNER
36 
37     return fAbandoned;
38 }
39 
40 ///////////////////////////////////////////////////////////////////////////////////////////////////
refCaps() const41 sk_sp<const GrCaps> GrImageContextPriv::refCaps() const {
42     return fContext->refCaps();
43 }
44 
fpFactoryCache()45 sk_sp<GrSkSLFPFactoryCache> GrImageContextPriv::fpFactoryCache() {
46     return fContext->fpFactoryCache();
47 }
48