diff options
author | brianosman <brianosman@google.com> | 2016-06-24 12:50:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-24 12:50:19 -0700 |
commit | a4535a34d1b317543307df6901debfefe7132569 (patch) | |
tree | c15e99990ff4bccd09e56e35ccf8441d55e0c83e /src/gpu/GrPaint.cpp | |
parent | e2cddc5342d5aacacce4429441c94d1e0ff67d8c (diff) |
GrColor4f is yet another 4f color type, unfortunately.
- Sk4f would be my choice, but it's not allowed in include/
- SkColor4f and SkPM4f are specified to be unpremultiplied/premultiplied, whereas GrColor (and GrColor4f) are either, depending on context.
This adds 12 bytes to GrPaint. Not sure if we want to pay that price. The precision loss for a single value (vs. in a gradient, etc...) may not justify changing the storage type here. Easy enough to back that part out, while still keeping the 4f intermediate type for the helper math that it adds, and for storage and parameter passing in other locations.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2088303002
Review-Url: https://codereview.chromium.org/2088303002
Diffstat (limited to 'src/gpu/GrPaint.cpp')
-rw-r--r-- | src/gpu/GrPaint.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gpu/GrPaint.cpp b/src/gpu/GrPaint.cpp index fd78f9f819..02518c0464 100644 --- a/src/gpu/GrPaint.cpp +++ b/src/gpu/GrPaint.cpp @@ -16,7 +16,7 @@ GrPaint::GrPaint() : fAntiAlias(false) , fDisableOutputConversionToSRGB(false) , fAllowSRGBInputs(false) - , fColor(GrColor_WHITE) {} + , fColor(GrColor4f::FromGrColor(GrColor_WHITE)) {} void GrPaint::setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage) { fXPFactory = GrCoverageSetOpXPFactory::Make(regionOp, invertCoverage); @@ -46,7 +46,7 @@ bool GrPaint::isConstantBlendedColor(GrColor* color) const { GrProcOptInfo colorProcInfo; colorProcInfo.calcWithInitialValues( sk_sp_address_as_pointer_address(fColorFragmentProcessors.begin()), - this->numColorFragmentProcessors(), fColor, kRGBA_GrColorComponentFlags, false); + this->numColorFragmentProcessors(), this->getColor(), kRGBA_GrColorComponentFlags, false); GrXPFactory::InvariantBlendedColor blendedColor; if (fXPFactory) { |