Fix two issues in DashOp

1) Bitfield was too small on Windows for signed enum type
2) Check for unused stencil settings rather than null

Also makes bool bitfields adjacent for better packing on Windows.

Change-Id: I8115cc31c55e83aa7bd85d99c1fca72042617aa3
Reviewed-on: https://skia-review.googlesource.com/23120
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Brian Salomon 2017-07-13 11:25:18 -04:00 committed by Skia Commit-Bot
parent 0596909b05
commit 89717fcbf1

View File

@ -285,7 +285,7 @@ public:
if (AAMode::kCoverageWithMSAA == fAAMode) {
flags |= FixedFunctionFlags::kUsesHWAA;
}
if (fStencilSettings) {
if (fStencilSettings != &GrUserStencilSettings::kUnused) {
flags |= FixedFunctionFlags::kUsesStencil;
}
return flags;
@ -313,8 +313,8 @@ private:
, fColor(paint.getColor())
, fAllowsSRGBInputs(paint.getAllowSRGBInputs())
, fDisableSRGBOutputConversion(paint.getDisableOutputConversionToSRGB())
, fCap(cap)
, fFullDash(fullDash)
, fCap(cap)
, fAAMode(aaMode)
, fProcessorSet(std::move(paint))
, fStencilSettings(stencilSettings) {
@ -717,8 +717,9 @@ private:
bool fDisableSRGBOutputConversion : 1;
bool fDisallowCombineOnTouchOrOverlap : 1;
bool fUsesLocalCoords : 1;
SkPaint::Cap fCap : 2;
bool fFullDash : 1;
// We use 3 bits for this 3-value enum because MSVS makes the underlying types signed.
SkPaint::Cap fCap : 3;
AAMode fAAMode;
GrProcessorSet fProcessorSet;
const GrUserStencilSettings* fStencilSettings;