aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-03-02 08:53:14 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-02 17:10:30 +0000
commitfde6fa0903b3cedc463c1a753268ffcf30ad7a38 (patch)
tree7dc2b1ee56d0a4d9ae22b467ef21823bf2f8dde8 /include
parente35a99ed706dcd0407c7ca4373ed97d21d988069 (diff)
Fix creation of extra GrContextThreadSafeProxies in DDL world
For the DDLContexts we simply want to reuse the threadSafeProxy from the main thread but we, obviously, still need to create one for the main DirectContext. TBR=bsalomon@google.com Change-Id: I99449bc375172c9004e2e80c21d95ab2d7708309 Reviewed-on: https://skia-review.googlesource.com/110781 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrContext.h17
-rw-r--r--include/private/SkSurfaceCharacterization.h1
2 files changed, 9 insertions, 9 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 1b43d99f2e..6578638183 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -356,15 +356,17 @@ public:
const GrContextPriv contextPriv() const;
protected:
- GrContext(GrContextThreadSafeProxy*);
- GrContext(GrBackend);
+ GrContext(GrBackend, int32_t id = SK_InvalidGenID);
- virtual bool init(const GrContextOptions&); // init must be called after either constructor.
+ bool initCommon(const GrContextOptions&);
+ virtual bool init(const GrContextOptions&) = 0; // must be called after the ctor!
virtual GrAtlasManager* onGetFullAtlasManager() = 0;
virtual GrRestrictedAtlasManager* onGetRestrictedAtlasManager() = 0;
+ const GrBackend fBackend;
sk_sp<const GrCaps> fCaps;
+ sk_sp<GrContextThreadSafeProxy> fThreadSafeProxy;
private:
sk_sp<GrGpu> fGpu;
@@ -372,7 +374,6 @@ private:
GrResourceProvider* fResourceProvider;
GrProxyProvider* fProxyProvider;
- sk_sp<GrContextThreadSafeProxy> fThreadSafeProxy;
GrGlyphCache* fGlyphCache;
std::unique_ptr<GrTextBlobCache> fTextBlobCache;
@@ -403,8 +404,6 @@ private:
GrAuditTrail fAuditTrail;
- const GrBackend fBackend;
-
GrContextOptions::PersistentCache* fPersistentCache;
// TODO: have the GrClipStackClip use renderTargetContexts and rm this friending
@@ -495,9 +494,9 @@ private:
const GrBackend fBackend;
const GrContextOptions fOptions;
- friend class GrContext;
- friend class GrContextPriv;
- friend class SkImage;
+ friend class GrDirectContext; // To construct this object
+ friend class GrContextPriv; // for access to 'fOptions' in MakeDDL
+ friend class GrDDLContext; // to implement the GrDDLContext ctor (access to all members)
typedef SkRefCnt INHERITED;
};
diff --git a/include/private/SkSurfaceCharacterization.h b/include/private/SkSurfaceCharacterization.h
index 48c22351b3..9327a538b6 100644
--- a/include/private/SkSurfaceCharacterization.h
+++ b/include/private/SkSurfaceCharacterization.h
@@ -55,6 +55,7 @@ public:
SkSurfaceCharacterization& operator=(const SkSurfaceCharacterization& other) = default;
GrContextThreadSafeProxy* contextInfo() const { return fContextInfo.get(); }
+ sk_sp<GrContextThreadSafeProxy> refContextInfo() const { return fContextInfo; }
size_t cacheMaxResourceBytes() const { return fCacheMaxResourceBytes; }
bool isValid() const { return kUnknown_GrPixelConfig != fConfig; }