• 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 <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 
GrImageContext(sk_sp<GrContextThreadSafeProxy> proxy)18 GrImageContext::GrImageContext(sk_sp<GrContextThreadSafeProxy> proxy)
19             : INHERITED(std::move(proxy)) {
20 }
21 
~GrImageContext()22 GrImageContext::~GrImageContext() {}
23 
abandonContext()24 void GrImageContext::abandonContext() {
25     fThreadSafeProxy->priv().abandonContext();
26 }
27 
abandoned()28 bool GrImageContext::abandoned() {
29     return fThreadSafeProxy->priv().abandoned();
30 }
31 
MakeForPromiseImage(sk_sp<GrContextThreadSafeProxy> tsp)32 sk_sp<GrImageContext> GrImageContext::MakeForPromiseImage(sk_sp<GrContextThreadSafeProxy> tsp) {
33     return sk_sp<GrImageContext>(new GrImageContext(std::move(tsp)));
34 }
35