skia2/include/private/GrImageContext.h
Adlai Holler e219d1c94c Make GrContextThreadSafeProxy not a GrContext_Base
Once this API is retracted, we can rename it to something more sane.
The code base has some `fContextInfo` ivars of this type, suggesting it
was previously named ContextInfo. It could be a ContextGroup or something else.

Bug: skia:10318
Change-Id: I3471e2172f46163f98a94780f0d7eb3431894cda
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293556
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-06-02 16:14:48 +00:00

53 lines
1.5 KiB
C++

/*
* Copyright 2019 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrImageContext_DEFINED
#define GrImageContext_DEFINED
#include "include/private/GrContext_Base.h"
#include "include/private/GrSingleOwner.h"
class GrImageContextPriv;
class GrProxyProvider;
class GrImageContext : public GrContext_Base {
public:
~GrImageContext() override;
// Provides access to functions that aren't part of the public API.
GrImageContextPriv priv();
const GrImageContextPriv priv() const;
protected:
friend class GrImageContextPriv; // for hidden functions
GrImageContext(sk_sp<GrContextThreadSafeProxy>);
SK_API virtual void abandonContext();
SK_API virtual bool abandoned();
GrProxyProvider* proxyProvider() { return fProxyProvider.get(); }
const GrProxyProvider* proxyProvider() const { return fProxyProvider.get(); }
/** This is only useful for debug purposes */
GrSingleOwner* singleOwner() const { return &fSingleOwner; }
GrImageContext* asImageContext() override { return this; }
private:
std::unique_ptr<GrProxyProvider> fProxyProvider;
// In debug builds we guard against improper thread handling
// This guard is passed to the GrDrawingManager and, from there to all the
// GrRenderTargetContexts. It is also passed to the GrResourceProvider and SkGpuDevice.
mutable GrSingleOwner fSingleOwner;
typedef GrContext_Base INHERITED;
};
#endif