Flutter Engine
The Flutter Engine
GrContextThreadSafeProxyPriv.h
Go to the documentation of this file.
1/*
2 * Copyright 2018 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#ifndef GrContextThreadSafeProxyPriv_DEFINED
9#define GrContextThreadSafeProxyPriv_DEFINED
10
13
16
17/**
18 * Class that adds methods to GrContextThreadSafeProxy that are only intended for use internal to
19 * Skia. This class is purely a privileged window into GrContextThreadSafeProxy. It should never
20 * have additional data members or virtual methods.
21 */
23public:
25
26 bool matches(GrContext_Base* candidate) const {
27 return fProxy == candidate->threadSafeProxy().get();
28 }
29
30 GrBackend backend() const { return fProxy->fBackend; }
31 const GrContextOptions& options() const { return fProxy->fOptions; }
32 uint32_t contextID() const { return fProxy->fContextID; }
33
34 const GrCaps* caps() const { return fProxy->fCaps.get(); }
35 sk_sp<const GrCaps> refCaps() const { return fProxy->fCaps; }
36
38 return fProxy->fTextBlobRedrawCoordinator.get();
39 }
41 return fProxy->fTextBlobRedrawCoordinator.get();
42 }
43
44 GrThreadSafeCache* threadSafeCache() { return fProxy->fThreadSafeCache.get(); }
45 const GrThreadSafeCache* threadSafeCache() const { return fProxy->fThreadSafeCache.get(); }
46
47 void abandonContext() { fProxy->abandonContext(); }
48 bool abandoned() const { return fProxy->abandoned(); }
49
50 // GrContextThreadSafeProxyPriv
52
53private:
54 explicit GrContextThreadSafeProxyPriv(GrContextThreadSafeProxy* proxy) : fProxy(proxy) {}
56
57 // No taking addresses of this type.
58 const GrContextThreadSafeProxyPriv* operator&() const = delete;
59 GrContextThreadSafeProxyPriv* operator&() = delete;
60
62
63 friend class GrContextThreadSafeProxy; // to construct/copy this type.
64};
65
68}
69
70inline const GrContextThreadSafeProxyPriv GrContextThreadSafeProxy::priv() const { // NOLINT(readability-const-return-type)
72}
73
74#endif
GrBackendApi
Definition: GrTypes.h:95
Definition: GrCaps.h:57
const GrThreadSafeCache * threadSafeCache() const
const GrContextOptions & options() const
bool matches(GrContext_Base *candidate) const
sk_sp< const GrCaps > refCaps() const
sktext::gpu::TextBlobRedrawCoordinator * getTextBlobRedrawCoordinator()
static sk_sp< GrContextThreadSafeProxy > Make(GrBackendApi, const GrContextOptions &)
void init(sk_sp< const GrCaps >, sk_sp< GrThreadSafePipelineBuilder >) const
const sktext::gpu::TextBlobRedrawCoordinator * getTextBlobRedrawCoordinator() const
GrContextThreadSafeProxyPriv priv()
sk_sp< GrContextThreadSafeProxy > threadSafeProxy()
T * get() const
Definition: SkRefCnt.h:303