aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2015-02-23 12:12:54 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-23 12:12:54 -0800
commit0bdeec9640640922eb6b0a9f798bcd85eb898f29 (patch)
treeff1418ee571a44ed2d9b82050539580145f9c4dd /src
parentb8de1f46594c3cd9c537f0b128c6d6eb30a9f463 (diff)
Remove canApplyCoverage from XP and all related functions in gpu code.
Diffstat (limited to 'src')
-rw-r--r--src/effects/SkArithmeticMode_gpu.h5
-rwxr-xr-xsrc/gpu/GrContext.cpp16
-rw-r--r--src/gpu/GrOvalRenderer.cpp9
-rw-r--r--src/gpu/GrPipelineBuilder.cpp17
-rw-r--r--src/gpu/GrPipelineBuilder.h12
-rw-r--r--src/gpu/effects/GrCustomXfermodePriv.h5
-rw-r--r--src/gpu/effects/GrDisableColorXP.h5
7 files changed, 4 insertions, 65 deletions
diff --git a/src/effects/SkArithmeticMode_gpu.h b/src/effects/SkArithmeticMode_gpu.h
index 546902dd50..8fb58a1796 100644
--- a/src/effects/SkArithmeticMode_gpu.h
+++ b/src/effects/SkArithmeticMode_gpu.h
@@ -81,11 +81,6 @@ public:
return true;
}
- bool canApplyCoverage(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI) const SK_OVERRIDE {
- return true;
- }
-
bool canTweakAlphaForCoverage() const SK_OVERRIDE {
return false;
}
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 98e78d9926..c444b66baa 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -460,14 +460,6 @@ static bool apply_aa_to_rect(GrDrawTarget* target,
SkScalar strokeWidth,
const SkMatrix& combinedMatrix,
GrColor color) {
- if (!pipelineBuilder->canTweakAlphaForCoverage() &&
- !pipelineBuilder->canUseFracCoveragePrimProc(color, *target->caps())) {
-#ifdef SK_DEBUG
- //SkDebugf("Turning off AA to correctly apply blend.\n");
-#endif
- return false;
- }
-
if (pipelineBuilder->getRenderTarget()->isMultisampled()) {
return false;
}
@@ -869,11 +861,6 @@ static bool is_nested_rects(GrDrawTarget* target,
return false;
}
- if (!pipelineBuilder->canTweakAlphaForCoverage() &&
- !pipelineBuilder->canUseFracCoveragePrimProc(color, *target->caps())) {
- return false;
- }
-
SkPath::Direction dirs[2];
if (!path.isNestedRects(rects, dirs)) {
return false;
@@ -1008,8 +995,7 @@ void GrContext::internalDrawPath(GrDrawTarget* target,
// aa. If we have some future driver-mojo path AA that can do the right
// thing WRT to the blend then we'll need some query on the PR.
bool useCoverageAA = useAA &&
- !pipelineBuilder->getRenderTarget()->isMultisampled() &&
- pipelineBuilder->canUseFracCoveragePrimProc(color, *target->caps());
+ !pipelineBuilder->getRenderTarget()->isMultisampled();
GrPathRendererChain::DrawType type =
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index d7f88fe137..14f8fdec4a 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -658,8 +658,7 @@ bool GrOvalRenderer::drawOval(GrDrawTarget* target,
const SkStrokeRec& stroke)
{
bool useCoverageAA = useAA &&
- !pipelineBuilder->getRenderTarget()->isMultisampled() &&
- pipelineBuilder->canUseFracCoveragePrimProc(color, *target->caps());
+ !pipelineBuilder->getRenderTarget()->isMultisampled();
if (!useCoverageAA) {
return false;
@@ -1555,8 +1554,7 @@ bool GrOvalRenderer::drawDRRect(GrDrawTarget* target,
const SkRRect& origOuter,
const SkRRect& origInner) {
bool applyAA = useAA &&
- !pipelineBuilder->getRenderTarget()->isMultisampled() &&
- pipelineBuilder->canUseFracCoveragePrimProc(color, *target->caps());
+ !pipelineBuilder->getRenderTarget()->isMultisampled();
GrPipelineBuilder::AutoRestoreEffects are;
if (!origInner.isEmpty()) {
SkTCopyOnFirstWrite<SkRRect> inner(origInner);
@@ -2044,8 +2042,7 @@ bool GrOvalRenderer::drawRRect(GrDrawTarget* target,
}
bool useCoverageAA = useAA &&
- !pipelineBuilder->getRenderTarget()->isMultisampled() &&
- pipelineBuilder->canUseFracCoveragePrimProc(color, *target->caps());
+ !pipelineBuilder->getRenderTarget()->isMultisampled();
// only anti-aliased rrects for now
if (!useCoverageAA) {
diff --git a/src/gpu/GrPipelineBuilder.cpp b/src/gpu/GrPipelineBuilder.cpp
index 6885eb0dd8..9117a1fea3 100644
--- a/src/gpu/GrPipelineBuilder.cpp
+++ b/src/gpu/GrPipelineBuilder.cpp
@@ -82,23 +82,6 @@ void GrPipelineBuilder::setFromPaint(const GrPaint& paint, GrRenderTarget* rt) {
fCoverageCache = GrColor_ILLEGAL;
}
-////////////////////////////////////////////////////////////////////////////////
-
-bool GrPipelineBuilder::canUseFracCoveragePrimProc(GrColor color,
- const GrDrawTargetCaps& caps) const {
- if (caps.dualSourceBlendingSupport()) {
- return true;
- }
-
- this->calcColorInvariantOutput(color);
-
- // The coverage isn't actually white, its unknown, but this will produce the same effect
- // TODO we want to cache the result of this call, but we can probably clean up the interface
- // so we don't have to pass in a seemingly known coverage
- this->calcCoverageInvariantOutput(GrColor_WHITE);
- return this->getXPFactory()->canApplyCoverage(fColorProcInfo, fCoverageProcInfo);
-}
-
//////////////////////////////////////////////////////////////////////////////s
bool GrPipelineBuilder::willXPNeedDstCopy(const GrDrawTargetCaps& caps,
diff --git a/src/gpu/GrPipelineBuilder.h b/src/gpu/GrPipelineBuilder.h
index ad509e14f8..904d38250c 100644
--- a/src/gpu/GrPipelineBuilder.h
+++ b/src/gpu/GrPipelineBuilder.h
@@ -49,18 +49,6 @@ public:
/// @}
/**
- * Depending on features available in the underlying 3D API and the color blend mode requested
- * it may or may not be possible to correctly blend with fractional pixel coverage generated by
- * the fragment shader.
- *
- * This function considers the current GrPipelineBuilder and the draw target's capabilities to
- * determine whether coverage can be handled correctly. This function assumes that the caller
- * intends to specify fractional pixel coverage via a primitive processor but may not have
- * specified it yet.
- */
- bool canUseFracCoveragePrimProc(GrColor color, const GrDrawTargetCaps& caps) const;
-
- /**
* This function returns true if the render target destination pixel values will be read for
* blending during draw.
*/
diff --git a/src/gpu/effects/GrCustomXfermodePriv.h b/src/gpu/effects/GrCustomXfermodePriv.h
index 8672529e45..85092a9892 100644
--- a/src/gpu/effects/GrCustomXfermodePriv.h
+++ b/src/gpu/effects/GrCustomXfermodePriv.h
@@ -64,11 +64,6 @@ public:
return true;
}
- bool canApplyCoverage(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI) const SK_OVERRIDE {
- return true;
- }
-
bool canTweakAlphaForCoverage() const SK_OVERRIDE {
return false;
}
diff --git a/src/gpu/effects/GrDisableColorXP.h b/src/gpu/effects/GrDisableColorXP.h
index 00675884a9..fb855ee520 100644
--- a/src/gpu/effects/GrDisableColorXP.h
+++ b/src/gpu/effects/GrDisableColorXP.h
@@ -23,11 +23,6 @@ public:
return true;
}
- bool canApplyCoverage(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI) const SK_OVERRIDE {
- return true;
- }
-
bool canTweakAlphaForCoverage() const SK_OVERRIDE { return true; }
void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI,