diff options
author | robertphillips <robertphillips@google.com> | 2016-08-03 14:26:53 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-03 14:26:53 -0700 |
commit | 4fd74aec9f6c68c66483bcc6735793440b1ba184 (patch) | |
tree | 2dc927157414e8393d1e31dff5c3fbcd873a883d /include/gpu | |
parent | 4db3b7969f62f5ddbf32bd812b9510af018ece89 (diff) |
Move GrContext::makeDrawContext to new GrContextPriv object
We don't want external clients to be able to call the wrapping makeDrawContext. The "creating" makeDrawContext needs to be public for external image filters.
The 3 specialized drawContext creators on GrContextPriv (to wrap backend objects) are also to be kept from public use and will be used to remove SkSurface::MakeRenderTargetDirect.
Split out of: https://codereview.chromium.org/2176333002/ (Remove SkSurface::MakeRenderTargetDirect)
TBR=bsalomon@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2211473002
Review-Url: https://codereview.chromium.org/2211473002
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrContext.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index 667301e61d..2a7c1383a0 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -24,6 +24,7 @@ struct GrBatchAtlasConfig; class GrBatchFontCache; struct GrContextOptions; +class GrContextPriv; class GrContextThreadSafeProxy; class GrDrawingManager; class GrDrawContext; @@ -180,19 +181,6 @@ public: int getRecommendedSampleCount(GrPixelConfig config, SkScalar dpi) const; /** - * Returns a helper object to orchestrate draws. - * Callers assume the creation ref of the drawContext - * NULL will be returned if the context has been abandoned. - * - * @param rt the render target receiving the draws - * @param surfaceProps the surface properties (mainly defines text drawing) - * - * @return a draw context - */ - sk_sp<GrDrawContext> makeDrawContext(sk_sp<GrRenderTarget> rt, sk_sp<SkColorSpace> colorSpace, - const SkSurfaceProps* = nullptr); - - /** * Create both a GrRenderTarget and a matching GrDrawContext to wrap it. * We guarantee that "asTexture" will succeed for drawContexts created * via this entry point. @@ -379,6 +367,10 @@ public: /** This is only useful for debug purposes */ SkDEBUGCODE(GrSingleOwner* debugSingleOwner() const { return &fSingleOwner; } ) + // Provides access to functions that aren't part of the public API. + GrContextPriv contextPriv(); + const GrContextPriv contextPriv() const; + private: GrGpu* fGpu; const GrCaps* fCaps; @@ -434,6 +426,7 @@ private: // TODO: have the CMM use drawContexts and rm this friending friend class GrClipMaskManager; // the CMM is friended just so it can call 'drawingManager' friend class GrDrawingManager; // for access to drawingManager for ProgramUnitTest + friend class GrContextPriv; GrDrawingManager* drawingManager() { return fDrawingManager; } GrContext(); // init must be called after the constructor. |