aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPipeline.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-05-29 15:05:15 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-29 19:26:26 +0000
commitbb581ce30f55360fd3a12e7f5aa1fe324b16d085 (patch)
tree6ca8902e7c72278a3e796c9b3c2d3de02aa620b2 /src/gpu/GrPipeline.h
parent9bee2e5894bb8dd374392f238bc429e16f239583 (diff)
Convert DstTexture to DstProxy (take 2)
The last GrTexture-based TextureSampler::reset call must be removed before the TextureSamplers can become purely GrTextureProxy-backed Reland of: https://skia-review.googlesource.com/c/16908/ (Convert DstTexture to DstProxy) Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler)) Change-Id: I3a497b6a950fad899f23882c0a9552894ef640f8 Reviewed-on: https://skia-review.googlesource.com/17205 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrPipeline.h')
-rw-r--r--src/gpu/GrPipeline.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h
index 41f6d59a8e..4f2f010188 100644
--- a/src/gpu/GrPipeline.h
+++ b/src/gpu/GrPipeline.h
@@ -76,7 +76,7 @@ public:
GrRenderTarget* fRenderTarget = nullptr;
const GrCaps* fCaps = nullptr;
GrResourceProvider* fResourceProvider = nullptr;
- GrXferProcessor::DstTexture fDstTexture;
+ GrXferProcessor::DstProxy fDstProxy;
};
/**
@@ -158,11 +158,19 @@ public:
* If the GrXferProcessor uses a texture to access the dst color, then this returns that
* texture and the offset to the dst contents within that texture.
*/
- GrTexture* dstTexture(SkIPoint* offset = nullptr) const {
+ GrTextureProxy* dstTextureProxy(SkIPoint* offset = nullptr) const {
if (offset) {
*offset = fDstTextureOffset;
}
- return fDstTexture.get();
+ return fDstTextureProxy.get();
+ }
+
+ GrTexture* peekDstTexture(SkIPoint* offset = nullptr) const {
+ if (GrTextureProxy* dstProxy = this->dstTextureProxy(offset)) {
+ return dstProxy->priv().peekTexture();
+ }
+
+ return nullptr;
}
const GrFragmentProcessor& getColorFragmentProcessor(int idx) const {
@@ -216,7 +224,8 @@ public:
bool isBad() const { return SkToBool(fFlags & kIsBad_Flag); }
GrXferBarrierType xferBarrierType(const GrCaps& caps) const {
- if (fDstTexture.get() && fDstTexture.get() == fRenderTarget.get()->asTexture()) {
+ if (fDstTextureProxy.get() &&
+ fDstTextureProxy.get()->priv().peekTexture() == fRenderTarget.get()->asTexture()) {
return kTexture_GrXferBarrierType;
}
return this->getXferProcessor().xferBarrierType(caps);
@@ -234,11 +243,11 @@ private:
};
using RenderTarget = GrPendingIOResource<GrRenderTarget, kWrite_GrIOType>;
- using DstTexture = GrPendingIOResource<GrTexture, kRead_GrIOType>;
+ using DstTextureProxy = GrPendingIOResource<GrTextureProxy, kRead_GrIOType>;
using PendingFragmentProcessor = GrPendingProgramElement<const GrFragmentProcessor>;
using FragmentProcessorArray = SkAutoSTArray<8, PendingFragmentProcessor>;
- DstTexture fDstTexture;
+ DstTextureProxy fDstTextureProxy;
SkIPoint fDstTextureOffset;
RenderTarget fRenderTarget;
GrScissorState fScissorState;