| 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 <memory> | 
| 9 | |
| 10 | #include "include/private/GrImageContext.h" | 
| 11 | |
| 12 | #include "src/gpu/GrCaps.h" | 
| 13 | #include "src/gpu/GrContextThreadSafeProxyPriv.h" | 
| 14 | #include "src/gpu/GrImageContextPriv.h" | 
| 15 | #include "src/gpu/GrProxyProvider.h" | 
| 16 | #include "src/gpu/effects/GrSkSLFP.h" | 
| 17 | |
| 18 | /////////////////////////////////////////////////////////////////////////////////////////////////// | 
| 19 | GrImageContext::GrImageContext(sk_sp<GrContextThreadSafeProxy> proxy) | 
| 20 | : INHERITED(std::move(proxy)) { | 
| 21 | fProxyProvider = std::make_unique<GrProxyProvider>(this); | 
| 22 | } | 
| 23 | |
| 24 | GrImageContext::~GrImageContext() {} | 
| 25 | |
| 26 | void GrImageContext::abandonContext() { | 
| 27 | fThreadSafeProxy->priv().abandonContext(); | 
| 28 | } | 
| 29 | |
| 30 | bool GrImageContext::abandoned() { | 
| 31 | return fThreadSafeProxy->priv().abandoned(); | 
| 32 | } | 
| 33 | |
| 34 | /////////////////////////////////////////////////////////////////////////////////////////////////// | 
| 35 | sk_sp<const GrCaps> GrImageContextPriv::refCaps() const { | 
| 36 | return fContext->refCaps(); | 
| 37 | } | 
| 38 | 
