Flutter Engine
The Flutter Engine
SharedContext.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2021 Google LLC
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
9
17
18namespace skgpu::graphite {
19
20SharedContext::SharedContext(std::unique_ptr<const Caps> caps, BackendApi backend)
21 : fCaps(std::move(caps))
22 , fBackend(backend)
23 , fGlobalCache()
24 , fShaderDictionary() {}
25
27 // TODO: add disconnect?
28
29 // TODO: destroyResources instead?
30}
31
32Protected SharedContext::isProtected() const { return Protected(fCaps->protectedSupport()); }
33
34void SharedContext::setRendererProvider(std::unique_ptr<RendererProvider> rendererProvider) {
35 // Should only be called once and be non-null
36 SkASSERT(rendererProvider && !fRendererProvider);
37 fRendererProvider = std::move(rendererProvider);
38}
39
40} // namespace skgpu::graphite
const char * backend
#define SkASSERT(cond)
Definition: SkAssert.h:116
SharedContext(std::unique_ptr< const Caps >, BackendApi)
const RendererProvider * rendererProvider() const
Definition: SharedContext.h:47
BackendApi
Definition: GpuTypes.h:22
Protected
Definition: GpuTypes.h:61
Definition: ref_ptr.h:256