1cb93a386Sopenharmony_ci/* 2cb93a386Sopenharmony_ci * Copyright 2019 Google Inc. 3cb93a386Sopenharmony_ci * 4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be 5cb93a386Sopenharmony_ci * found in the LICENSE file. 6cb93a386Sopenharmony_ci */ 7cb93a386Sopenharmony_ci 8cb93a386Sopenharmony_ci#include <memory> 9cb93a386Sopenharmony_ci 10cb93a386Sopenharmony_ci#include "include/private/GrImageContext.h" 11cb93a386Sopenharmony_ci 12cb93a386Sopenharmony_ci#include "src/gpu/GrCaps.h" 13cb93a386Sopenharmony_ci#include "src/gpu/GrContextThreadSafeProxyPriv.h" 14cb93a386Sopenharmony_ci#include "src/gpu/GrImageContextPriv.h" 15cb93a386Sopenharmony_ci#include "src/gpu/GrProxyProvider.h" 16cb93a386Sopenharmony_ci#include "src/gpu/effects/GrSkSLFP.h" 17cb93a386Sopenharmony_ci 18cb93a386Sopenharmony_ciGrImageContext::GrImageContext(sk_sp<GrContextThreadSafeProxy> proxy) 19cb93a386Sopenharmony_ci : INHERITED(std::move(proxy)) { 20cb93a386Sopenharmony_ci} 21cb93a386Sopenharmony_ci 22cb93a386Sopenharmony_ciGrImageContext::~GrImageContext() {} 23cb93a386Sopenharmony_ci 24cb93a386Sopenharmony_civoid GrImageContext::abandonContext() { 25cb93a386Sopenharmony_ci fThreadSafeProxy->priv().abandonContext(); 26cb93a386Sopenharmony_ci} 27cb93a386Sopenharmony_ci 28cb93a386Sopenharmony_cibool GrImageContext::abandoned() { 29cb93a386Sopenharmony_ci return fThreadSafeProxy->priv().abandoned(); 30cb93a386Sopenharmony_ci} 31cb93a386Sopenharmony_ci 32cb93a386Sopenharmony_cisk_sp<GrImageContext> GrImageContext::MakeForPromiseImage(sk_sp<GrContextThreadSafeProxy> tsp) { 33cb93a386Sopenharmony_ci return sk_sp<GrImageContext>(new GrImageContext(std::move(tsp))); 34cb93a386Sopenharmony_ci} 35