diff options
author | Robert Phillips <robertphillips@google.com> | 2017-06-12 10:58:31 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-12 15:24:44 +0000 |
commit | c9c06d45863e64ae99ef54c8c56014c855f1ca65 (patch) | |
tree | a828ad6919680cdc9f924f03a8c226127a2b1725 /src/gpu | |
parent | 03a787968a11bdd3b55d771d348702d0db51fd43 (diff) |
Remove GrTGpuResourceRef specializations
This template is only used for GrBuffers now.
Change-Id: Ia9e95576b01124657e64007231fbc0a83276e13f
Reviewed-on: https://skia-review.googlesource.com/19484
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/GrPipeline.cpp | 8 | ||||
-rw-r--r-- | src/gpu/GrPipeline.h | 9 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLXferProcessor.cpp | 1 | ||||
-rw-r--r-- | src/gpu/ops/GrDrawOp.cpp | 41 | ||||
-rw-r--r-- | src/gpu/ops/GrDrawOp.h | 31 |
5 files changed, 53 insertions, 37 deletions
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp index 9d8b2ef984..134466b24a 100644 --- a/src/gpu/GrPipeline.cpp +++ b/src/gpu/GrPipeline.cpp @@ -112,6 +112,14 @@ void GrPipeline::addDependenciesTo(GrRenderTargetProxy* rtp) const { } } +GrXferBarrierType GrPipeline::xferBarrierType(const GrCaps& caps) const { + if (fDstTextureProxy.get() && + fDstTextureProxy.get()->priv().peekTexture() == fRenderTarget.get()->asTexture()) { + return kTexture_GrXferBarrierType; + } + return this->getXferProcessor().xferBarrierType(caps); +} + GrPipeline::GrPipeline(GrRenderTarget* rt, ScissorState scissorState, SkBlendMode blendmode) : fRenderTarget(rt) , fScissorState() diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h index 3fd518985d..8d2f245e8d 100644 --- a/src/gpu/GrPipeline.h +++ b/src/gpu/GrPipeline.h @@ -15,6 +15,7 @@ #include "GrProcessorSet.h" #include "GrProgramDesc.h" #include "GrRect.h" +#include "GrRenderTarget.h" #include "GrScissorState.h" #include "GrUserStencilSettings.h" #include "GrWindowRectsState.h" @@ -235,13 +236,7 @@ public: } bool isBad() const { return SkToBool(fFlags & kIsBad_Flag); } - GrXferBarrierType xferBarrierType(const GrCaps& caps) const { - if (fDstTextureProxy.get() && - fDstTextureProxy.get()->priv().peekTexture() == fRenderTarget.get()->asTexture()) { - return kTexture_GrXferBarrierType; - } - return this->getXferProcessor().xferBarrierType(caps); - } + GrXferBarrierType xferBarrierType(const GrCaps& caps) const; private: void markAsBad() { fFlags |= kIsBad_Flag; } diff --git a/src/gpu/glsl/GrGLSLXferProcessor.cpp b/src/gpu/glsl/GrGLSLXferProcessor.cpp index 41a467753c..5af0f05680 100644 --- a/src/gpu/glsl/GrGLSLXferProcessor.cpp +++ b/src/gpu/glsl/GrGLSLXferProcessor.cpp @@ -8,6 +8,7 @@ #include "glsl/GrGLSLXferProcessor.h" #include "GrShaderCaps.h" +#include "GrTexture.h" #include "GrXferProcessor.h" #include "glsl/GrGLSLFragmentShaderBuilder.h" #include "glsl/GrGLSLProgramDataManager.h" diff --git a/src/gpu/ops/GrDrawOp.cpp b/src/gpu/ops/GrDrawOp.cpp new file mode 100644 index 0000000000..4bbb80e397 --- /dev/null +++ b/src/gpu/ops/GrDrawOp.cpp @@ -0,0 +1,41 @@ +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "GrDrawOp.h" + +#include "GrRenderTarget.h" + +SkString GrDrawOp::DumpPipelineInfo(const GrPipeline& pipeline) { + SkString string; + string.appendf("RT: %d\n", pipeline.getRenderTarget()->uniqueID().asUInt()); + string.append("ColorStages:\n"); + for (int i = 0; i < pipeline.numColorFragmentProcessors(); i++) { + string.appendf("\t\t%s\n\t\t%s\n", + pipeline.getColorFragmentProcessor(i).name(), + pipeline.getColorFragmentProcessor(i).dumpInfo().c_str()); + } + string.append("CoverageStages:\n"); + for (int i = 0; i < pipeline.numCoverageFragmentProcessors(); i++) { + string.appendf("\t\t%s\n\t\t%s\n", + pipeline.getCoverageFragmentProcessor(i).name(), + pipeline.getCoverageFragmentProcessor(i).dumpInfo().c_str()); + } + string.appendf("XP: %s\n", pipeline.getXferProcessor().name()); + + bool scissorEnabled = pipeline.getScissorState().enabled(); + string.appendf("Scissor: "); + if (scissorEnabled) { + string.appendf("[L: %d, T: %d, R: %d, B: %d]\n", + pipeline.getScissorState().rect().fLeft, + pipeline.getScissorState().rect().fTop, + pipeline.getScissorState().rect().fRight, + pipeline.getScissorState().rect().fBottom); + } else { + string.appendf("<disabled>\n"); + } + return string; +} diff --git a/src/gpu/ops/GrDrawOp.h b/src/gpu/ops/GrDrawOp.h index dbdd9d87a0..d7887b689a 100644 --- a/src/gpu/ops/GrDrawOp.h +++ b/src/gpu/ops/GrDrawOp.h @@ -82,36 +82,7 @@ public: virtual bool xpRequiresDstTexture(const GrCaps&, const GrAppliedClip*) = 0; protected: - static SkString DumpPipelineInfo(const GrPipeline& pipeline) { - SkString string; - string.appendf("RT: %d\n", pipeline.getRenderTarget()->uniqueID().asUInt()); - string.append("ColorStages:\n"); - for (int i = 0; i < pipeline.numColorFragmentProcessors(); i++) { - string.appendf("\t\t%s\n\t\t%s\n", - pipeline.getColorFragmentProcessor(i).name(), - pipeline.getColorFragmentProcessor(i).dumpInfo().c_str()); - } - string.append("CoverageStages:\n"); - for (int i = 0; i < pipeline.numCoverageFragmentProcessors(); i++) { - string.appendf("\t\t%s\n\t\t%s\n", - pipeline.getCoverageFragmentProcessor(i).name(), - pipeline.getCoverageFragmentProcessor(i).dumpInfo().c_str()); - } - string.appendf("XP: %s\n", pipeline.getXferProcessor().name()); - - bool scissorEnabled = pipeline.getScissorState().enabled(); - string.appendf("Scissor: "); - if (scissorEnabled) { - string.appendf("[L: %d, T: %d, R: %d, B: %d]\n", - pipeline.getScissorState().rect().fLeft, - pipeline.getScissorState().rect().fTop, - pipeline.getScissorState().rect().fRight, - pipeline.getScissorState().rect().fBottom); - } else { - string.appendf("<disabled>\n"); - } - return string; - } + static SkString DumpPipelineInfo(const GrPipeline& pipeline); struct QueuedUpload { QueuedUpload(DeferredUploadFn&& upload, GrDrawOpUploadToken token) |