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

Unified Diff: include/gpu/GrPaint.h

Issue 22558003: Add blend optimization helpers and use to convert rect draws to clears. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: suppress warning Created 7 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 | « include/core/SkRect.h ('k') | include/gpu/GrSurface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrPaint.h
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h
index 9e326f049525c4c5b092570571ef0c417399dbb7..59343e70ec1d4f2b043ca9636c569b583fdfc42d 100644
--- a/include/gpu/GrPaint.h
+++ b/include/gpu/GrPaint.h
@@ -174,7 +174,28 @@ public:
this->resetColorFilter();
}
+ /**
+ * Determines whether the drawing with this paint is opaque with respect to both color blending
+ * and fractional coverage. It does not consider whether AA has been enabled on the paint or
+ * not. Depending upon whether multisampling or coverage-based AA is in use, AA may make the
+ * result only apply to the interior of primitives.
+ *
+ */
+ bool isOpaque() const;
+
+ /**
+ * Returns true if isOpaque would return true and the paint represents a solid constant color
+ * draw. If the result is true, constantColor will be updated to contain the constant color.
+ */
+ bool isOpaqueAndConstantColor(GrColor* constantColor) const;
+
private:
+
+ /**
+ * Helper for isOpaque and isOpaqueAndConstantColor.
+ */
+ bool getOpaqueAndKnownColor(GrColor* solidColor, uint32_t* solidColorKnownComponents) const;
+
/**
* Called when the source coord system from which geometry is rendered changes. It ensures that
* the local coordinates seen by effects remains unchanged. oldToNew gives the transformation
« no previous file with comments | « include/core/SkRect.h ('k') | include/gpu/GrSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698