diff options
author | 2017-07-26 15:48:41 -0400 | |
---|---|---|
committer | 2017-07-26 20:59:00 +0000 | |
commit | 2890fbfe1400b81e4d6af98d14dfe757fec93650 (patch) | |
tree | bbc22dc56d4cdb0b1f6b06740c68738808506f67 /src/gpu/GrPipeline.h | |
parent | 480c90afc4382d03fa7cda534a702459ace72953 (diff) |
Make GrPipeline hold a GrRenderTargetProxy (instead of a GrRenderTarget)
In a future world where GrSurface no longer has an origin it will be
useful for the GrPipeline to be holding the GrRenderTargetProxy (which will
still have an origin).
Change-Id: I743a8cc07b6b92f8116227fb77b7c37da43cde8a
Reviewed-on: https://skia-review.googlesource.com/26804
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrPipeline.h')
-rw-r--r-- | src/gpu/GrPipeline.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h index 3a194d6f63..b4423049fb 100644 --- a/src/gpu/GrPipeline.h +++ b/src/gpu/GrPipeline.h @@ -15,7 +15,7 @@ #include "GrProcessorSet.h" #include "GrProgramDesc.h" #include "GrRect.h" -#include "GrRenderTarget.h" +#include "GrRenderTargetProxy.h" #include "GrScissorState.h" #include "GrUserStencilSettings.h" #include "GrWindowRectsState.h" @@ -79,7 +79,7 @@ public: const GrProcessorSet* fProcessors = nullptr; // Must be finalized const GrUserStencilSettings* fUserStencil = &GrUserStencilSettings::kUnused; const GrAppliedClip* fAppliedClip = nullptr; - GrRenderTarget* fRenderTarget = nullptr; + GrRenderTargetProxy* fProxy = nullptr; const GrCaps* fCaps = nullptr; GrResourceProvider* fResourceProvider = nullptr; GrXferProcessor::DstProxy fDstProxy; @@ -105,7 +105,7 @@ public: * must be "Porter Duff" (<= kLastCoeffMode). If using ScissorState::kEnabled, the caller must * specify a scissor rectangle through the DynamicState struct. **/ - GrPipeline(GrRenderTarget*, ScissorState, SkBlendMode); + GrPipeline(GrRenderTargetProxy*, ScissorState, SkBlendMode); GrPipeline(const InitArgs& args) { this->init(args); } @@ -116,7 +116,7 @@ public: void init(const InitArgs&); /** True if the pipeline has been initialized. */ - bool isInitialized() const { return SkToBool(fRenderTarget.get()); } + bool isInitialized() const { return SkToBool(fProxy.get()); } /// @} @@ -212,7 +212,8 @@ public: * * @return The currently set render target. */ - GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); } + GrRenderTargetProxy* proxy() const { return fProxy.get(); } + GrRenderTarget* renderTarget() const { return fProxy.get()->priv().peekRenderTarget(); } const GrUserStencilSettings* getUserStencil() const { return fUserStencilSettings; } @@ -270,14 +271,14 @@ private: kIsBad_Flag = 0x40, }; - using RenderTarget = GrPendingIOResource<GrRenderTarget, kWrite_GrIOType>; + using RenderTargetProxy = GrPendingIOResource<GrRenderTargetProxy, kWrite_GrIOType>; using DstTextureProxy = GrPendingIOResource<GrTextureProxy, kRead_GrIOType>; using PendingFragmentProcessor = GrPendingProgramElement<const GrFragmentProcessor>; using FragmentProcessorArray = SkAutoSTArray<8, PendingFragmentProcessor>; DstTextureProxy fDstTextureProxy; SkIPoint fDstTextureOffset; - RenderTarget fRenderTarget; + RenderTargetProxy fProxy; GrScissorState fScissorState; GrWindowRectsState fWindowRectsState; const GrUserStencilSettings* fUserStencilSettings; |