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

Unified Diff: include/gpu/GrPaint.h

Issue 2236423002: Inline fast path for GrPaint::isConstantBlendedColor when no color FPs and src-over blend. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 | « no previous file | src/gpu/GrPaint.cpp » ('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 ca9ba5981839f1357cc3207590808de088954e94..0085604caee91a7acd2d81724984f33831bfb700 100644
--- a/include/gpu/GrPaint.h
+++ b/include/gpu/GrPaint.h
@@ -166,9 +166,21 @@ public:
* coverage and color, so the actual values written to pixels with partial coverage may still
* not seem constant, even if this function returns true.
*/
- bool isConstantBlendedColor(GrColor* constantColor) const;
+ bool isConstantBlendedColor(GrColor* constantColor) const {
+ GrColor paintColor = this->getColor();
+ if (!fXPFactory && fColorFragmentProcessors.empty()) {
+ if (!GrColorIsOpaque(paintColor)) {
+ return false;
+ }
+ *constantColor = paintColor;
+ return true;
+ }
+ return this->internalIsConstantBlendedColor(paintColor, constantColor);
+ }
private:
+ bool internalIsConstantBlendedColor(GrColor paintColor, GrColor* constantColor) const;
+
mutable sk_sp<GrXPFactory> fXPFactory;
SkSTArray<4, sk_sp<GrFragmentProcessor>> fColorFragmentProcessors;
SkSTArray<2, sk_sp<GrFragmentProcessor>> fCoverageFragmentProcessors;
« no previous file with comments | « no previous file | src/gpu/GrPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698