Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Unified Diff: src/gpu/GrDrawTarget.h

Issue 446953002: Add an opaqueness hint to GrDrawState. (Closed) Base URL: https://skia.googlesource.com/skia.git@greg
Patch Set: Address comments Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.h
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index befa81a0d49df4ecca517119d989d7a7640a28c0..b5487dc871b2f41187eca86b5a17dbc23fb1edc7 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -84,32 +84,13 @@ public:
*/
GrDrawState* drawState() { return fDrawState; }
- /**
- * Color alpha and coverage are two inputs to the drawing pipeline. For some
- * blend modes it is safe to fold the coverage into constant or per-vertex
- * color alpha value. For other blend modes they must be handled separately.
- * Depending on features available in the underlying 3D API this may or may
- * not be possible.
- *
- * This function considers the current draw state and the draw target's
- * capabilities to determine whether coverage can be handled correctly. The
- * following assumptions are made:
- * 1. The caller intends to somehow specify coverage. This can be
- * specified either by enabling a coverage stage on the GrDrawState or
- * via the vertex layout.
- * 2. Other than enabling coverage stages or enabling coverage in the
- * layout, the current configuration of the target's GrDrawState is as
- * it will be at draw time.
- */
- bool canApplyCoverage() const;
-
/** When we're using coverage AA but the blend is incompatible (given gpu
* limitations) we should disable AA. */
- bool shouldDisableCoverageAAForBlend() {
+ bool shouldDisableCoverageAAForBlend() const {
// Enable below if we should draw with AA even when it produces
// incorrect blending.
// return false;
- return !this->canApplyCoverage();
+ return !this->getDrawState().couldApplyCoverage(*this->caps());
}
/**
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698