*/
virtual bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const = 0;
- /**
- * Depending on 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 known color and coverage input into the xfer processor and
- * certain state information (colorWriteDisabled) to determine whether
- * coverage can be handled correctly.
- */
- virtual bool canApplyCoverage(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI) const = 0;
-
-
struct InvariantOutput {
bool fWillBlendWithDst;
GrColor fBlendedColor;
return true;
}
- bool canApplyCoverage(const GrProcOptInfo& /*colorPOI*/,
- const GrProcOptInfo& /*coveragePOI*/) const SK_OVERRIDE {
- return true;
- }
-
bool canTweakAlphaForCoverage() const SK_OVERRIDE { return false; }
void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI,
bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const SK_OVERRIDE;
- bool canApplyCoverage(const GrProcOptInfo& /*colorPOI*/,
- const GrProcOptInfo& /*coveragePOI*/) const SK_OVERRIDE {
- return true;
- }
-
bool canTweakAlphaForCoverage() const SK_OVERRIDE;
void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI,
return true;
}
- bool canApplyCoverage(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI) const SK_OVERRIDE {
- return true;
- }
-
bool canTweakAlphaForCoverage() const SK_OVERRIDE {
return false;
}
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;
}
return false;
}
- if (!pipelineBuilder->canTweakAlphaForCoverage() &&
- !pipelineBuilder->canUseFracCoveragePrimProc(color, *target->caps())) {
- return false;
- }
-
SkPath::Direction dirs[2];
if (!path.isNestedRects(rects, dirs)) {
return false;
// 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 =
const SkStrokeRec& stroke)
{
bool useCoverageAA = useAA &&
- !pipelineBuilder->getRenderTarget()->isMultisampled() &&
- pipelineBuilder->canUseFracCoveragePrimProc(color, *target->caps());
+ !pipelineBuilder->getRenderTarget()->isMultisampled();
if (!useCoverageAA) {
return false;
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);
}
bool useCoverageAA = useAA &&
- !pipelineBuilder->getRenderTarget()->isMultisampled() &&
- pipelineBuilder->canUseFracCoveragePrimProc(color, *target->caps());
+ !pipelineBuilder->getRenderTarget()->isMultisampled();
// only anti-aliased rrects for now
if (!useCoverageAA) {
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,
/// @}
- /**
- * 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.
return true;
}
- bool canApplyCoverage(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI) const SK_OVERRIDE {
- return true;
- }
-
bool canTweakAlphaForCoverage() const SK_OVERRIDE {
return false;
}
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,