Flutter Engine
The Flutter Engine
GrBaseContextPriv.h
Go to the documentation of this file.
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#ifndef GrBaseContextPriv_DEFINED
9#define GrBaseContextPriv_DEFINED
10
13
14/** Class that exposes methods on GrContext_Base that are only intended for use internal to Skia.
15 This class is purely a privileged window into GrContext_Base. It should never have
16 additional data members or virtual methods. */
18public:
20 const GrContext_Base* context() const { return fContext; }
21
22 uint32_t contextID() const { return this->context()->contextID(); }
23
24 bool matches(GrContext_Base* candidate) const { return this->context()->matches(candidate); }
25
26 const GrContextOptions& options() const { return this->context()->options(); }
27
28 const GrCaps* caps() const { return this->context()->caps(); }
30
34
36
37protected:
39
41
42private:
43 GrBaseContextPriv& operator=(const GrBaseContextPriv&) = delete;
44
45 // No taking addresses of this type.
46 const GrBaseContextPriv* operator&() const;
47 GrBaseContextPriv* operator&();
48
49 friend class GrContext_Base; // to construct/copy this type.
50};
51
53
54inline const GrBaseContextPriv GrContext_Base::priv () const { // NOLINT(readability-const-return-type)
55 return GrBaseContextPriv(const_cast<GrContext_Base*>(this));
56}
57
58#endif
GrDirectContext * asDirectContext()
const GrContextOptions & options() const
GrContext_Base * fContext
const GrContext_Base * context() const
GrRecordingContext * asRecordingContext()
bool matches(GrContext_Base *candidate) const
GrContext_Base * context()
sk_sp< const GrCaps > refCaps() const
uint32_t contextID() const
GrContextOptions::ShaderErrorHandler * getShaderErrorHandler() const
GrImageContext * asImageContext()
const GrCaps * caps() const
GrBaseContextPriv(GrContext_Base *context)
Definition: GrCaps.h:57
virtual GrDirectContext * asDirectContext()
uint32_t contextID() const
const GrCaps * caps() const
GrBaseContextPriv priv()
virtual GrRecordingContext * asRecordingContext()
bool matches(GrContext_Base *candidate) const
const GrContextOptions & options() const
virtual GrImageContext * asImageContext()
friend class GrBaseContextPriv