chromium/third_party/skia/src/gpu/graphite/ContextPriv.h

/*
 * Copyright 2021 Google LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef skgpu_graphite_ContextPriv_DEFINED
#define skgpu_graphite_ContextPriv_DEFINED

#include "include/gpu/graphite/Context.h"
#include "src/gpu/graphite/QueueManager.h"
#include "src/gpu/graphite/SharedContext.h"

#if defined(GPU_TEST_UTILS)
#include "src/gpu/graphite/ContextOptionsPriv.h"
#endif

namespace skgpu::graphite {

class Caps;
class GlobalCache;
class RendererProvider;
class ResourceProvider;
class ShaderCodeDictionary;

/** Class that adds methods to Context that are only intended for use internal to Skia.
    This class is purely a privileged window into Context. It should never have additional
    data members or virtual methods. */
class ContextPriv {};

inline ContextPriv Context::priv() {}

// NOLINTNEXTLINE(readability-const-return-type)
inline const ContextPriv Context::priv() const {}

// This class is friended by the Context and allows the backend ContextFactory functions to
// trampoline through this to call the private Context ctor. We can't directly friend the factory
// functions in Context because they are in a different namespace and we don't want to declare the
// functions in Context.h
class ContextCtorAccessor {};

} // namespace skgpu::graphite

#endif // skgpu_graphite_ContextPriv_DEFINED