/src/skia/src/gpu/GrContext_Base.cpp
Line | Count | Source (jump to first uncovered line) |
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/GrContext_Base.h" |
9 | | |
10 | | #include "src/gpu/GrBaseContextPriv.h" |
11 | | #include "src/gpu/GrCaps.h" |
12 | | #include "src/gpu/GrContextThreadSafeProxyPriv.h" |
13 | | #include "src/gpu/GrShaderUtils.h" |
14 | | #include "src/gpu/effects/GrSkSLFP.h" |
15 | | |
16 | | GrContext_Base::GrContext_Base(sk_sp<GrContextThreadSafeProxy> proxy) |
17 | 1.32k | : fThreadSafeProxy(std::move(proxy)) { |
18 | 1.32k | } |
19 | | |
20 | 1.32k | GrContext_Base::~GrContext_Base() { } |
21 | | |
22 | 1.32k | bool GrContext_Base::init() { |
23 | 1.32k | SkASSERT(fThreadSafeProxy->isValid()); |
24 | | |
25 | 1.32k | return true; |
26 | 1.32k | } |
27 | | |
28 | 92.7k | uint32_t GrContext_Base::contextID() const { return fThreadSafeProxy->priv().contextID(); } |
29 | 70.5k | GrBackendApi GrContext_Base::backend() const { return fThreadSafeProxy->priv().backend(); } |
30 | | |
31 | 68.0k | const GrContextOptions& GrContext_Base::options() const { |
32 | 68.0k | return fThreadSafeProxy->priv().options(); |
33 | 68.0k | } |
34 | | |
35 | 1.64M | const GrCaps* GrContext_Base::caps() const { return fThreadSafeProxy->priv().caps(); } |
36 | 1.32k | sk_sp<const GrCaps> GrContext_Base::refCaps() const { return fThreadSafeProxy->priv().refCaps(); } |
37 | | |
38 | | GrBackendFormat GrContext_Base::defaultBackendFormat(SkColorType skColorType, |
39 | 0 | GrRenderable renderable) const { |
40 | 0 | return fThreadSafeProxy->defaultBackendFormat(skColorType, renderable); |
41 | 0 | } |
42 | | |
43 | 0 | GrBackendFormat GrContext_Base::compressedBackendFormat(SkImage::CompressionType c) const { |
44 | 0 | return fThreadSafeProxy->compressedBackendFormat(c); |
45 | 0 | } |
46 | | |
47 | 0 | sk_sp<GrContextThreadSafeProxy> GrContext_Base::threadSafeProxy() { return fThreadSafeProxy; } |
48 | | |
49 | | /////////////////////////////////////////////////////////////////////////////////////////////////// |
50 | 1.32k | sk_sp<const GrCaps> GrBaseContextPriv::refCaps() const { |
51 | 1.32k | return this->context()->refCaps(); |
52 | 1.32k | } |
53 | | |
54 | 0 | GrContextOptions::ShaderErrorHandler* GrBaseContextPriv::getShaderErrorHandler() const { |
55 | 0 | const GrContextOptions& options(this->options()); |
56 | 0 | return options.fShaderErrorHandler ? options.fShaderErrorHandler |
57 | 0 | : GrShaderUtils::DefaultShaderErrorHandler(); |
58 | 0 | } |