blob: d2ceed887090154667fa0fe3d55c156f52e77d9a [file] [log] [blame]
Robert Phillips4217ea72019-01-30 13:08:28 -05001/*
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
John Stilesfbd050b2020-08-03 13:21:46 -04008#include <memory>
9
Mike Kleinc0bd9f92019-04-23 12:05:21 -050010#include "include/private/GrImageContext.h"
Robert Phillips4217ea72019-01-30 13:08:28 -050011
Mike Kleinc0bd9f92019-04-23 12:05:21 -050012#include "src/gpu/GrCaps.h"
Adlai Holler43b15792020-06-01 10:11:49 -040013#include "src/gpu/GrContextThreadSafeProxyPriv.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050014#include "src/gpu/GrImageContextPriv.h"
15#include "src/gpu/GrProxyProvider.h"
Robert Phillips7f11fb52019-12-03 13:35:19 -050016#include "src/gpu/effects/GrSkSLFP.h"
Robert Phillipsa41c6852019-02-07 10:44:10 -050017
Robert Phillipsa9162df2019-02-11 14:12:03 -050018///////////////////////////////////////////////////////////////////////////////////////////////////
Adlai Hollere219d1c2020-06-02 11:23:16 -040019GrImageContext::GrImageContext(sk_sp<GrContextThreadSafeProxy> proxy)
20 : INHERITED(std::move(proxy)) {
John Stilesfbd050b2020-08-03 13:21:46 -040021 fProxyProvider = std::make_unique<GrProxyProvider>(this);
Robert Phillips4217ea72019-01-30 13:08:28 -050022}
23
24GrImageContext::~GrImageContext() {}
Robert Phillipsa41c6852019-02-07 10:44:10 -050025
Robert Phillipsa9162df2019-02-11 14:12:03 -050026void GrImageContext::abandonContext() {
Adlai Holler43b15792020-06-01 10:11:49 -040027 fThreadSafeProxy->priv().abandonContext();
Robert Phillipsa9162df2019-02-11 14:12:03 -050028}
29
Greg Daniel6e35a002020-04-01 13:29:59 -040030bool GrImageContext::abandoned() {
Adlai Holler43b15792020-06-01 10:11:49 -040031 return fThreadSafeProxy->priv().abandoned();
Robert Phillipsa9162df2019-02-11 14:12:03 -050032}
33
Robert Phillipsa41c6852019-02-07 10:44:10 -050034///////////////////////////////////////////////////////////////////////////////////////////////////
35sk_sp<const GrCaps> GrImageContextPriv::refCaps() const {
36 return fContext->refCaps();
37}