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/effects/GrSkSLFP.h"
14
15#define ASSERT_SINGLE_OWNER \
16 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(this->singleOwner());)
17
18///////////////////////////////////////////////////////////////////////////////////////////////////
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
26GrImageContext::~GrImageContext() {}
27
28void GrImageContext::abandonContext() {
29 ASSERT_SINGLE_OWNER
30
31 fAbandoned = true;
32}
33
34bool GrImageContext::abandoned() {
35 ASSERT_SINGLE_OWNER
36
37 return fAbandoned;
38}
39
40///////////////////////////////////////////////////////////////////////////////////////////////////
41sk_sp<const GrCaps> GrImageContextPriv::refCaps() const {
42 return fContext->refCaps();
43}
44