diff options
author | 2014-10-07 08:37:36 -0700 | |
---|---|---|
committer | 2014-10-07 08:37:36 -0700 | |
commit | d909759832d5a6bb476597098e05bbe7ba0ccbd2 (patch) | |
tree | 2e839fd7b211ae385dc81d1b301b082a4499b6bb /src | |
parent | 07a255310aca9f3e83bf741dc663a58818ad681c (diff) |
Revert of gl programs rewrite (patchset #10 id:180001 of https://codereview.chromium.org/628633003/)
Reason for revert:
breaks angle bot
Original issue's description:
> gl programs rewrite
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/07a255310aca9f3e83bf741dc663a58818ad681c
TBR=bsalomon@google.com,egdaniel@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/631183003
Diffstat (limited to 'src')
-rw-r--r-- | src/effects/SkColorFilters.cpp | 8 | ||||
-rw-r--r-- | src/gpu/GrDrawState.cpp | 7 | ||||
-rw-r--r-- | src/gpu/GrDrawState.h | 5 | ||||
-rw-r--r-- | src/gpu/GrDrawTarget.h | 15 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL_program.cpp | 18 |
5 files changed, 21 insertions, 32 deletions
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp index 8e10d73a0e..ba62817f56 100644 --- a/src/effects/SkColorFilters.cpp +++ b/src/effects/SkColorFilters.cpp @@ -406,13 +406,7 @@ GrFragmentProcessor* ModeColorFilterEffect::TestCreate(SkRandom* rand, while (SkXfermode::kDst_Mode == mode) { mode = static_cast<SkXfermode::Mode>(rand->nextRangeU(0, SkXfermode::kLastCoeffMode)); } - - // pick a random premul color - uint8_t alpha = rand->nextULessThan(256); - GrColor color = GrColorPackRGBA(rand->nextRangeU(0, alpha), - rand->nextRangeU(0, alpha), - rand->nextRangeU(0, alpha), - alpha); + GrColor color = rand->nextU(); return ModeColorFilterEffect::Create(color, mode); } diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp index 07243fc9a8..f967a6fa76 100644 --- a/src/gpu/GrDrawState.cpp +++ b/src/gpu/GrDrawState.cpp @@ -404,7 +404,7 @@ bool GrDrawState::hasSolidCoverage() const { if (this->hasCoverageVertexAttribute()) { inout.fValidFlags = 0; } else { - inout.fColor = this->getCoverageColor(); + inout.fColor = fCoverage; inout.fValidFlags = kRGBA_GrColorComponentFlags; } @@ -413,7 +413,6 @@ bool GrDrawState::hasSolidCoverage() const { const GrGeometryProcessor* gp = fGeometryProcessor->getGeometryProcessor(); gp->computeInvariantOutput(&inout); } - for (int s = 0; s < this->numCoverageStages(); ++s) { const GrProcessor* processor = this->getCoverageStage(s).getProcessor(); processor->computeInvariantOutput(&inout); @@ -641,8 +640,8 @@ GrDrawState::~GrDrawState() { //////////////////////////////////////////////////////////////////////////////// GrDrawState::BlendOptFlags GrDrawState::getBlendOpts(bool forceCoverage, - GrBlendCoeff* srcCoeff, - GrBlendCoeff* dstCoeff) const { + GrBlendCoeff* srcCoeff, + GrBlendCoeff* dstCoeff) const { GrBlendCoeff bogusSrcCoeff, bogusDstCoeff; if (NULL == srcCoeff) { srcCoeff = &bogusSrcCoeff; diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h index a6115cc22d..9d653e6f5c 100644 --- a/src/gpu/GrDrawState.h +++ b/src/gpu/GrDrawState.h @@ -684,10 +684,7 @@ public: /// Hints that when provided can enable optimizations. //// - enum Hints { - kVertexColorsAreOpaque_Hint = 0x1, - kLast_Hint = kVertexColorsAreOpaque_Hint - }; + enum Hints { kVertexColorsAreOpaque_Hint = 0x1, }; void setHint(Hints hint, bool value) { fHints = value ? (fHints | hint) : (fHints & ~hint); } diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h index 552314bca3..dd2224bdbd 100644 --- a/src/gpu/GrDrawTarget.h +++ b/src/gpu/GrDrawTarget.h @@ -855,14 +855,6 @@ protected: GrDeviceCoordTexture fDstCopy; }; - // Makes a copy of the dst if it is necessary for the draw. Returns false if a copy is required - // but couldn't be made. Otherwise, returns true. This method needs to be protected because it - // needs to be accessed by GLPrograms to setup a correct drawstate - bool setupDstReadIfNecessary(DrawInfo* info) { - return this->setupDstReadIfNecessary(&info->fDstCopy, info->getDevBounds()); - } - bool setupDstReadIfNecessary(GrDeviceCoordTexture* dstCopy, const SkRect* drawBounds); - private: // A subclass can optionally overload this function to be notified before // vertex and index space is reserved. @@ -921,6 +913,13 @@ private: void releasePreviousVertexSource(); void releasePreviousIndexSource(); + // Makes a copy of the dst if it is necessary for the draw. Returns false if a copy is required + // but couldn't be made. Otherwise, returns true. + bool setupDstReadIfNecessary(DrawInfo* info) { + return this->setupDstReadIfNecessary(&info->fDstCopy, info->getDevBounds()); + } + bool setupDstReadIfNecessary(GrDeviceCoordTexture* dstCopy, const SkRect* drawBounds); + // Check to see if this set of draw commands has been sent out virtual bool isIssued(uint32_t drawID) { return true; } diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp index 3e45423075..4529a1c22e 100644 --- a/src/gpu/gl/GrGpuGL_program.cpp +++ b/src/gpu/gl/GrGpuGL_program.cpp @@ -239,15 +239,15 @@ bool GrGpuGL::flushGraphicsState(DrawType type, const GrDeviceCoordTexture* dstC SkSTArray<8, const GrFragmentStage*, true> coverageStages; GrGLProgramDesc desc; if (!GrGLProgramDesc::Build(*optState.get(), - type, - srcCoeff, - dstCoeff, - this, - dstCopy, - &geometryProcessor, - &colorStages, - &coverageStages, - &desc)) { + type, + srcCoeff, + dstCoeff, + this, + dstCopy, + &geometryProcessor, + &colorStages, + &coverageStages, + &desc)) { SkDEBUGFAIL("Failed to generate GL program descriptor"); return false; } |