diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index d1ac17e13d..576761679f 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -512,7 +512,7 @@ Result CodecSrc::draw(SkCanvas* canvas) const { return Result::Skip( "Cannot decode frame %i to 565 (%s).", i, fPath.c_str()); } - // Fall through. + [[fallthrough]]; default: return Result::Fatal( "Couldn't getPixels for frame %i in %s.", i, fPath.c_str()); diff --git a/fuzz/FuzzMain.cpp b/fuzz/FuzzMain.cpp index a15aebe6fc..2dbeb581ae 100644 --- a/fuzz/FuzzMain.cpp +++ b/fuzz/FuzzMain.cpp @@ -464,6 +464,7 @@ static void fuzz_img(sk_sp bytes, uint8_t scale, uint8_t mode) { SkDebugf("Incompatible colortype conversion\n"); // Crash to allow afl-fuzz to know this was a bug. raise(SIGSEGV); + break; default: SkDebugf("[terminated] Couldn't getPixels.\n"); return; @@ -594,7 +595,7 @@ static void fuzz_img(sk_sp bytes, uint8_t scale, uint8_t mode) { return; } // If the first subset succeeded, a later one should not fail. - // fall through to failure + [[fallthrough]]; case SkCodec::kUnimplemented: if (0 == (x|y)) { // First subset is okay to return unimplemented. @@ -602,7 +603,7 @@ static void fuzz_img(sk_sp bytes, uint8_t scale, uint8_t mode) { return; } // If the first subset succeeded, why would a later one fail? - // fall through to failure + [[fallthrough]]; default: SkDebugf("[terminated] subset codec failed to decode (%d, %d, %d, %d) " "with dimensions (%d x %d)\t error %d\n", diff --git a/gm/dstreadshuffle.cpp b/gm/dstreadshuffle.cpp index 9e6a7addb0..1737009b88 100644 --- a/gm/dstreadshuffle.cpp +++ b/gm/dstreadshuffle.cpp @@ -100,6 +100,7 @@ protected: SkFont font(ToolUtils::create_portable_typeface(), 100); font.setEmbolden(true); canvas->drawString(text, 0.f, 100.f, font, *paint); + break; } default: break; diff --git a/gm/xfermodes.cpp b/gm/xfermodes.cpp index 6ddabe75c1..d98b7f010a 100644 --- a/gm/xfermodes.cpp +++ b/gm/xfermodes.cpp @@ -154,7 +154,7 @@ class XfermodesGM : public skiagm::GM { canvas->saveLayer(&bounds, &p); restoreNeeded = true; p.setBlendMode(SkBlendMode::kSrcOver); - // Fall through. + [[fallthrough]]; } case kQuarterClear_SrcType: { SkScalar halfW = SkIntToScalar(W) / 2; @@ -175,7 +175,7 @@ class XfermodesGM : public skiagm::GM { SkScalar h = SkIntToScalar(H); SkRect r = SkRect::MakeXYWH(x, y + h / 4, w, h * 23 / 60); canvas->clipRect(r); - // Fall through. + [[fallthrough]]; } case kRectangle_SrcType: { SkScalar w = SkIntToScalar(W); @@ -188,10 +188,10 @@ class XfermodesGM : public skiagm::GM { } case kSmallRectangleImageWithAlpha_SrcType: m.postScale(SK_ScalarHalf, SK_ScalarHalf, x, y); - // Fall through. + [[fallthrough]]; case kRectangleImageWithAlpha_SrcType: p.setAlpha(0x88); - // Fall through. + [[fallthrough]]; case kRectangleImage_SrcType: { SkAutoCanvasRestore acr(canvas, true); canvas->concat(m); diff --git a/modules/skparagraph/src/ParagraphImpl.cpp b/modules/skparagraph/src/ParagraphImpl.cpp index 9a562f1de6..71a96dad52 100644 --- a/modules/skparagraph/src/ParagraphImpl.cpp +++ b/modules/skparagraph/src/ParagraphImpl.cpp @@ -1055,8 +1055,12 @@ void ParagraphImpl::setState(InternalState state) { fBidiRegions.reset(); fGraphemes16.reset(); fCodepoints.reset(); + [[fallthrough]]; + case kShaped: fClusters.reset(); + [[fallthrough]]; + case kClusterized: case kMarked: case kLineBroken: @@ -1065,12 +1069,15 @@ void ParagraphImpl::setState(InternalState state) { this->computeEmptyMetrics(); this->resetShifts(); fLines.reset(); + [[fallthrough]]; + case kFormatted: fPicture = nullptr; + [[fallthrough]]; + case kDrawn: + default: break; - default: - break; } } diff --git a/samplecode/SampleAAGeometry.cpp b/samplecode/SampleAAGeometry.cpp index bc708ea8be..07e7285d46 100644 --- a/samplecode/SampleAAGeometry.cpp +++ b/samplecode/SampleAAGeometry.cpp @@ -278,6 +278,7 @@ static void set_path_verb(int index, SkPath::Verb v, SkPath* path, SkScalar w) { switch (v) { case SkPath::kConic_Verb: weight = w; + [[fallthrough]]; case SkPath::kQuad_Verb: pts[2] = pts[1]; pts[1].fX = (pts[0].fX + pts[2].fX) / 2; @@ -303,6 +304,7 @@ static void set_path_verb(int index, SkPath::Verb v, SkPath* path, SkScalar w) { break; case SkPath::kConic_Verb: weight = w; + [[fallthrough]]; case SkPath::kQuad_Verb: break; case SkPath::kCubic_Verb: { @@ -325,6 +327,7 @@ static void set_path_verb(int index, SkPath::Verb v, SkPath* path, SkScalar w) { break; case SkPath::kConic_Verb: weight = w; + [[fallthrough]]; case SkPath::kQuad_Verb: { SkDCubic dCubic; dCubic.set(pts); diff --git a/samplecode/SampleAnimatedImage.cpp b/samplecode/SampleAnimatedImage.cpp index da6ac28caa..1ca7ac1ef3 100644 --- a/samplecode/SampleAnimatedImage.cpp +++ b/samplecode/SampleAnimatedImage.cpp @@ -104,11 +104,10 @@ class SampleAnimatedImage : public Sample { switch (uni) { case kPauseKey: fRunning = !fRunning; - if (fImage->isFinished()) { - // fall through - } else { + if (!fImage->isFinished()) { return true; } + [[fallthrough]]; case kResetKey: fImage->reset(); fCurrentTime = fLastWallTime; diff --git a/src/codec/SkBmpCodec.cpp b/src/codec/SkBmpCodec.cpp index 615c8a4212..c113f6da15 100644 --- a/src/codec/SkBmpCodec.cpp +++ b/src/codec/SkBmpCodec.cpp @@ -394,7 +394,7 @@ SkCodec::Result SkBmpCodec::ReadHeader(SkStream* stream, bool inIco, inputFormat = kRLE_BmpInputFormat; break; } - // Fall through + [[fallthrough]]; case kPng_BmpCompressionMethod: // TODO: Decide if we intend to support this. // It is unsupported in the previous version and diff --git a/src/codec/SkPngCodec.cpp b/src/codec/SkPngCodec.cpp index c17070c07c..df77b3aac0 100644 --- a/src/codec/SkPngCodec.cpp +++ b/src/codec/SkPngCodec.cpp @@ -1018,8 +1018,7 @@ SkCodec::Result SkPngCodec::initializeXforms(const SkImageInfo& dstInfo, const O if (this->getEncodedInfo().bitsPerComponent() != 16) { break; } - - // Fall through + [[fallthrough]]; case SkEncodedInfo::kRGBA_Color: case SkEncodedInfo::kGray_Color: skipFormatConversion = this->colorXform(); diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp index fe8ea3b12a..e9019572cd 100644 --- a/src/codec/SkWebpCodec.cpp +++ b/src/codec/SkWebpCodec.cpp @@ -143,7 +143,7 @@ std::unique_ptr SkWebpCodec::MakeFromStream(std::unique_ptr s // sense to guess kBGRA which is likely closer to the final // output. Otherwise, we might end up converting // BGRA->YUVA->BGRA. - // Fallthrough: + [[fallthrough]]; case 2: // This is the lossless format (BGRA). if (hasAlpha) { diff --git a/src/core/SkBitmapProcState_matrixProcs.cpp b/src/core/SkBitmapProcState_matrixProcs.cpp index d444b56c91..8fa1a0ba87 100755 --- a/src/core/SkBitmapProcState_matrixProcs.cpp +++ b/src/core/SkBitmapProcState_matrixProcs.cpp @@ -64,7 +64,7 @@ static void decal_nofilter_scale(uint32_t dst[], SkFixed fx, SkFixed dx, int cou SkASSERT(count <= 2); switch (count) { - case 2: ((uint16_t*)dst)[1] = SkToU16((fx + dx) >> 16); + case 2: ((uint16_t*)dst)[1] = SkToU16((fx + dx) >> 16); [[fallthrough]]; case 1: ((uint16_t*)dst)[0] = SkToU16((fx + 0) >> 16); } } @@ -475,7 +475,7 @@ SkBitmapProcState::MatrixProc SkBitmapProcState::chooseMatrixProc(bool translate // Check for our special case translate methods when there is no scale/affine/perspective. if (translate_only_matrix && kNone_SkFilterQuality == fFilterQuality) { switch (fTileModeX) { - default: SkASSERT(false); + default: SkASSERT(false); [[fallthrough]]; case SkTileMode::kClamp: return clampx_nofilter_trans; case SkTileMode::kRepeat: return repeatx_nofilter_trans; case SkTileMode::kMirror: return mirrorx_nofilter_trans; diff --git a/src/core/SkBlurMF.cpp b/src/core/SkBlurMF.cpp index ecfe2984d2..9665ab4d6e 100644 --- a/src/core/SkBlurMF.cpp +++ b/src/core/SkBlurMF.cpp @@ -436,7 +436,7 @@ SkBlurMaskFilterImpl::filterRRectToNine(const SkRRect& rrect, const SkMatrix& ma case SkRRect::kRect_Type: // We should have caught this earlier. SkASSERT(false); - // Fall through. + [[fallthrough]]; case SkRRect::kOval_Type: // The nine patch special case does not handle ovals, and we // already have code for rectangles. diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp index fed7bf331b..0556b28313 100644 --- a/src/core/SkClipStack.cpp +++ b/src/core/SkClipStack.cpp @@ -392,7 +392,7 @@ void SkClipStack::Element::combineBoundsXOR(int combination, const SkRect& prevF // The only pixels that can survive are within the // union of the two bounding boxes since the extensions // to infinity of both clips cancel out - // fall through! + [[fallthrough]]; case kPrev_Cur_FillCombo: // The most conservative bound for xor is the // union of the two bounds. If the two clips exactly overlapped @@ -830,7 +830,7 @@ void SkClipStack::pushElement(const Element& element) { } break; } - // fallthrough + [[fallthrough]]; default: if (!SkRect::Intersects(prior->getBounds(), element.getBounds())) { prior->setEmpty(); diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index 99c8bd8284..48858d1c9b 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -511,7 +511,7 @@ void SkDraw::drawPoints(SkCanvas::PointMode mode, size_t count, break; } } - // couldn't take fast path so fall through! + [[fallthrough]]; // couldn't take fast path case SkCanvas::kPolygon_PointMode: { count -= 1; SkPath path; diff --git a/src/core/SkImageInfo.cpp b/src/core/SkImageInfo.cpp index 11789d10be..81994fb6ef 100644 --- a/src/core/SkImageInfo.cpp +++ b/src/core/SkImageInfo.cpp @@ -90,7 +90,7 @@ bool SkColorTypeValidateAlphaType(SkColorType colorType, SkAlphaType alphaType, if (kUnpremul_SkAlphaType == alphaType) { alphaType = kPremul_SkAlphaType; } - // fall-through + [[fallthrough]]; case kARGB_4444_SkColorType: case kRGBA_8888_SkColorType: case kBGRA_8888_SkColorType: diff --git a/src/core/SkMaskFilter.cpp b/src/core/SkMaskFilter.cpp index f408c01d90..222a5943e1 100644 --- a/src/core/SkMaskFilter.cpp +++ b/src/core/SkMaskFilter.cpp @@ -255,7 +255,7 @@ bool SkMaskFilterBase::filterPath(const SkPath& devPath, const SkMatrix& matrix, case kUnimplemented_FilterReturn: SkASSERT(nullptr == patch.fMask.fImage); - // fall through + // fall out break; } } diff --git a/src/core/SkModeColorFilter.cpp b/src/core/SkModeColorFilter.cpp index 1927c0f9dc..b98b4d02d8 100644 --- a/src/core/SkModeColorFilter.cpp +++ b/src/core/SkModeColorFilter.cpp @@ -44,6 +44,7 @@ uint32_t SkModeColorFilter::getFlags() const { case SkBlendMode::kDst: //!< [Da, Dc] case SkBlendMode::kSrcATop: //!< [Da, Sc * Da + (1 - Sa) * Dc] flags |= kAlphaUnchanged_Flag; + break; default: break; } diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index 09c061de51..6614b779a5 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -1815,7 +1815,7 @@ SkPath::Verb SkPath::Iter::next(SkPoint ptsParam[4]) { break; case kConic_Verb: fConicWeights += 1; - // fall-through + [[fallthrough]]; case kQuad_Verb: pts[0] = this->cons_moveTo(); memcpy(&pts[1], srcPts, 2 * sizeof(SkPoint)); @@ -2351,7 +2351,7 @@ void ContourIter::next() { break; case SkPath::kConic_Verb: fCurrConicWeight += 1; - // fall-through + [[fallthrough]]; case SkPath::kQuad_Verb: ptCount += 2; break; @@ -3348,6 +3348,7 @@ bool SkPathPriv::IsRectContour(const SkPath& path, bool allowPartial, int* currV savePts = pts; autoClose = true; insertClose = false; + [[fallthrough]]; case SkPath::kLine_Verb: { if (SkPath::kClose_Verb != verb) { lastPt = pts; diff --git a/src/core/SkPathRef.cpp b/src/core/SkPathRef.cpp index 68c8970b07..dca2b329d8 100644 --- a/src/core/SkPathRef.cpp +++ b/src/core/SkPathRef.cpp @@ -394,10 +394,12 @@ SkPoint* SkPathRef::growForRepeatedVerb(int /*SkPath::Verb*/ verb, break; case SkPath::kDone_Verb: SkDEBUGFAIL("growForRepeatedVerb called for kDone"); - // fall through + pCnt = 0; + break; default: SkDEBUGFAIL("default should not be reached"); pCnt = 0; + break; } fBoundsIsDirty = true; // this also invalidates fIsFinite @@ -444,10 +446,12 @@ SkPoint* SkPathRef::growForVerb(int /* SkPath::Verb*/ verb, SkScalar weight) { break; case SkPath::kDone_Verb: SkDEBUGFAIL("growForVerb called for kDone"); - // fall through + pCnt = 0; + break; default: SkDEBUGFAIL("default is not reached"); pCnt = 0; + break; } fSegmentMask |= mask; @@ -596,7 +600,7 @@ uint8_t SkPathRef::Iter::next(SkPoint pts[4]) { break; case SkPath::kConic_Verb: fConicWeights += 1; - // fall-through + [[fallthrough]]; case SkPath::kQuad_Verb: pts[0] = srcPts[-1]; pts[1] = srcPts[0]; diff --git a/src/core/SkPath_serial.cpp b/src/core/SkPath_serial.cpp index b1d85f451c..694ce77315 100644 --- a/src/core/SkPath_serial.cpp +++ b/src/core/SkPath_serial.cpp @@ -211,7 +211,7 @@ size_t SkPath::readFromMemory_EQ4Or5(const void* storage, size_t length) { case SerializationType::kRRect: return this->readAsRRect(storage, length); case SerializationType::kGeneral: - break; // fall through + break; // fall out default: return 0; } diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp index e041ba64f0..dbfb7aa69c 100644 --- a/src/core/SkPicture.cpp +++ b/src/core/SkPicture.cpp @@ -185,7 +185,7 @@ sk_sp SkPicture::MakeFromStream(SkStream* stream, const SkDeserialPro } return procs.fPictureProc(data->data(), size, procs.fPictureCtx); } - default: // fall through to error return + default: // fall out to error return break; } return nullptr; diff --git a/src/core/SkVM.cpp b/src/core/SkVM.cpp index f17d18c16c..eb8b519787 100644 --- a/src/core/SkVM.cpp +++ b/src/core/SkVM.cpp @@ -1234,32 +1234,35 @@ namespace skvm { }; switch (mode) { - default: SkASSERT(false); /*but also, for safety, fallthrough*/ + default: + SkASSERT(false); + [[fallthrough]]; /*but also, for safety, fallthrough*/ case SkBlendMode::kClear: return { splat(0.0f), splat(0.0f), splat(0.0f), splat(0.0f) }; case SkBlendMode::kSrc: return src; case SkBlendMode::kDst: return dst; - case SkBlendMode::kDstOver: std::swap(src, dst); // fall-through + case SkBlendMode::kDstOver: std::swap(src, dst); [[fallthrough]]; case SkBlendMode::kSrcOver: return apply_rgba([&](auto s, auto d) { return mad(d,1-src.a, s); }); - case SkBlendMode::kDstIn: std::swap(src, dst); // fall-through + case SkBlendMode::kDstIn: std::swap(src, dst); [[fallthrough]]; case SkBlendMode::kSrcIn: return apply_rgba([&](auto s, auto d) { return s * dst.a; }); - case SkBlendMode::kDstOut: std::swap(src, dst); // fall-through + case SkBlendMode::kDstOut: std::swap(src, dst); [[fallthrough]]; + case SkBlendMode::kSrcOut: return apply_rgba([&](auto s, auto d) { return s * (1-dst.a); }); - case SkBlendMode::kDstATop: std::swap(src, dst); // fall-through + case SkBlendMode::kDstATop: std::swap(src, dst); [[fallthrough]]; case SkBlendMode::kSrcATop: return apply_rgba([&](auto s, auto d) { return mma(s, dst.a, d, 1-src.a); diff --git a/src/effects/Sk1DPathEffect.cpp b/src/effects/Sk1DPathEffect.cpp index 360179d663..16dee4a90b 100644 --- a/src/effects/Sk1DPathEffect.cpp +++ b/src/effects/Sk1DPathEffect.cpp @@ -127,7 +127,7 @@ static void morphpath(SkPath* dst, const SkPath& src, SkPathMeasure& meas, srcP[2] = srcP[1]; srcP[1].set(SkScalarAve(srcP[0].fX, srcP[2].fX), SkScalarAve(srcP[0].fY, srcP[2].fY)); - // fall through to quad + [[fallthrough]]; case SkPath::kQuad_Verb: if (morphpoints(dstP, &srcP[1], 2, meas, dist)) { dst->quadTo(dstP[0], dstP[1]); diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp index 43b8996170..89a4b2ddb6 100644 --- a/src/gpu/GrCaps.cpp +++ b/src/gpu/GrCaps.cpp @@ -358,9 +358,11 @@ GrCaps::SupportedRead GrCaps::supportedReadPixelsColorType(GrColorType srcColorT // offset alignment is a multiple of 2 but not 4. case 2: read.fOffsetAlignmentForTransferBuffer *= 2; + break; // offset alignment is not a multiple of 2. default: read.fOffsetAlignmentForTransferBuffer *= 4; + break; } } return read; diff --git a/src/gpu/GrOpsTask.cpp b/src/gpu/GrOpsTask.cpp index 1642832f49..ec2c6c91bc 100644 --- a/src/gpu/GrOpsTask.cpp +++ b/src/gpu/GrOpsTask.cpp @@ -556,6 +556,7 @@ bool GrOpsTask::onExecute(GrOpFlushState* flushState) { // once finished, meaning the stencil values will always remain cleared after the // initial clear. Just fall through to reloading the existing (cleared) stencil values // from memory. + [[fallthrough]]; case StencilContent::kPreserved: SkASSERT(stencil); stencilLoadOp = GrLoadOp::kLoad; diff --git a/src/gpu/GrTriangulator.cpp b/src/gpu/GrTriangulator.cpp index b2b2af31ad..f695d6ee2d 100644 --- a/src/gpu/GrTriangulator.cpp +++ b/src/gpu/GrTriangulator.cpp @@ -2400,13 +2400,13 @@ int get_contour_count(const SkPath& path, SkScalar tolerance) { if (!first) { ++contourCnt; } - // fallthru. + [[fallthrough]]; case SkPath::kLine_Verb: case SkPath::kConic_Verb: case SkPath::kQuad_Verb: case SkPath::kCubic_Verb: hasPoints = true; - // fallthru to break. + break; default: break; } diff --git a/src/gpu/ccpr/GrCCFiller.cpp b/src/gpu/ccpr/GrCCFiller.cpp index ee9520f83b..9b30a708cd 100644 --- a/src/gpu/ccpr/GrCCFiller.cpp +++ b/src/gpu/ccpr/GrCCFiller.cpp @@ -433,7 +433,7 @@ bool GrCCFiller::prepareToDraw(GrOnFlushResourceProvider* onFlushRP) { SkASSERT(!currFan.empty()); currFan.pop_back(); } - // fallthru. + [[fallthrough]]; case Verb::kEndOpenContour: // endPt != startPt. SkASSERT(!currFanIsTessellated || currFan.empty()); if (!currFanIsTessellated && currFan.count() >= 3) { diff --git a/src/gpu/ccpr/GrCCStroker.cpp b/src/gpu/ccpr/GrCCStroker.cpp index 44f3db3362..8f0a7eefeb 100644 --- a/src/gpu/ccpr/GrCCStroker.cpp +++ b/src/gpu/ccpr/GrCCStroker.cpp @@ -649,10 +649,10 @@ bool GrCCStroker::prepareToDraw(GrOnFlushResourceProvider* onFlushRP) { case Verb::kRoundJoin: case Verb::kInternalRoundJoin: conicWeight = params[paramsIdx++].fConicWeight; - // fallthru + [[fallthrough]]; case Verb::kMiterJoin: miterCapHeightOverWidth = params[paramsIdx++].fMiterCapHeightOverWidth; - // fallthru + [[fallthrough]]; case Verb::kBevelJoin: case Verb::kInternalBevelJoin: builder.appendJoin(verb, pts[ptsIdx], normals[normalsIdx], normals[normalsIdx + 1], diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp index eb4cae7ac9..18dea8e2a0 100644 --- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp +++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp @@ -136,7 +136,7 @@ GrPathRenderer::CanDrawPath GrCoverageCountingPathRenderer::onCanDrawPath( // defined relative to device space. return CanDrawPath::kNo; } - // fallthru + [[fallthrough]]; case SkStrokeRec::kHairline_Style: { if (CoverageType::kFP16_CoverageCount != fCoverageType) { // Stroking is not yet supported in MSAA atlas mode. diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp index efcfbb34f8..ced8b4a1f5 100644 --- a/src/gpu/effects/GrConvexPolyEffect.cpp +++ b/src/gpu/effects/GrConvexPolyEffect.cpp @@ -130,6 +130,7 @@ std::unique_ptr GrConvexPolyEffect::Make(GrClipEdgeType typ switch (verb) { case SkPath::kMove_Verb: SkASSERT(n == 0); + break; case SkPath::kClose_Verb: break; case SkPath::kLine_Verb: { diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp index 640d027ed6..09299d8343 100644 --- a/src/gpu/effects/GrRRectEffect.cpp +++ b/src/gpu/effects/GrRRectEffect.cpp @@ -762,6 +762,7 @@ std::unique_ptr GrRRectEffect::Make(GrClipEdgeType edgeType // This rrect should have been caught in the simple case above. Though, it would // be correctly handled in the fallthrough code. SkASSERT(false); + [[fallthrough]]; case CircularRRectEffect::kTopLeft_CornerFlag: case CircularRRectEffect::kTopRight_CornerFlag: case CircularRRectEffect::kBottomRight_CornerFlag: diff --git a/src/gpu/geometry/GrPathUtils.cpp b/src/gpu/geometry/GrPathUtils.cpp index 625b9d6756..55d1207c4c 100644 --- a/src/gpu/geometry/GrPathUtils.cpp +++ b/src/gpu/geometry/GrPathUtils.cpp @@ -188,6 +188,7 @@ int GrPathUtils::worstCasePointCount(const SkPath& path, int* subpaths, SkScalar for (int i = 0; i < converter.countQuads(); ++i) { pointCount += quadraticPointCount(quadPts + 2*i, tol); } + [[fallthrough]]; } case SkPath::kQuad_Verb: pointCount += quadraticPointCount(pts, tol); @@ -806,7 +807,7 @@ SkCubicType GrPathUtils::getCubicKLM(const SkPoint src[4], SkMatrix* klm, double switch (type) { case SkCubicType::kCuspAtInfinity: SkASSERT(1 == t1 && 0 == s1); // Infinity. - // fallthru. + [[fallthrough]]; case SkCubicType::kLocalCusp: case SkCubicType::kSerpentine: calc_serp_kcoeffs(t0, s0, t1, s1, skipTerm, &klmCoeffs[0]); diff --git a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp index d4eb2af46e..0d63776976 100644 --- a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp +++ b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp @@ -44,11 +44,14 @@ void GrGLSLGeometryProcessor::emitCode(EmitArgs& args) { vBuilder->codeAppendf("sk_Position = float4(%s", gpArgs.fPositionVar.c_str()); switch (gpArgs.fPositionVar.getType()) { case kFloat_GrSLType: - vBuilder->codeAppend(", 0"); // fallthru. + vBuilder->codeAppend(", 0"); + [[fallthrough]]; case kFloat2_GrSLType: - vBuilder->codeAppend(", 0"); // fallthru. + vBuilder->codeAppend(", 0"); + [[fallthrough]]; case kFloat3_GrSLType: - vBuilder->codeAppend(", 1"); // fallthru. + vBuilder->codeAppend(", 1"); + [[fallthrough]]; case kFloat4_GrSLType: vBuilder->codeAppend(");"); break; @@ -171,6 +174,7 @@ void GrGLSLGeometryProcessor::emitTransformCode(GrGLSLVertexBuilder* vb, } vb->codeAppend(";\n"); vb->codeAppend("}\n"); + break; } default: break; diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp index 70eb0baaf7..ca11c0dd6c 100644 --- a/src/gpu/ops/GrAAConvexPathRenderer.cpp +++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp @@ -213,6 +213,7 @@ static void update_degenerate_test(DegenerateTestData* data, const SkPoint& pt) if (SkScalarAbs(data->fLineNormal.dot(pt) + data->fLineC) > kClose) { data->fStage = DegenerateTestData::kNonDegenerate; } + break; case DegenerateTestData::kNonDegenerate: break; default: diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp index b05fcdfcf1..88175db9d2 100644 --- a/src/gpu/ops/GrDefaultPathRenderer.cpp +++ b/src/gpu/ops/GrDefaultPathRenderer.cpp @@ -583,7 +583,7 @@ bool GrDefaultPathRenderer::internalDrawPath(GrRenderTargetContext* renderTarget switch (path.getFillType()) { case SkPathFillType::kInverseEvenOdd: reverse = true; - // fallthrough + [[fallthrough]]; case SkPathFillType::kEvenOdd: passes[0] = &gEOStencilPass; if (stencilOnly) { @@ -602,7 +602,7 @@ bool GrDefaultPathRenderer::internalDrawPath(GrRenderTargetContext* renderTarget case SkPathFillType::kInverseWinding: reverse = true; - // fallthrough + [[fallthrough]]; case SkPathFillType::kWinding: passes[0] = &gWindStencilPass; passCount = 2; diff --git a/src/opts/SkChecksum_opts.h b/src/opts/SkChecksum_opts.h index 78808476ca..67c3ba22ba 100644 --- a/src/opts/SkChecksum_opts.h +++ b/src/opts/SkChecksum_opts.h @@ -191,8 +191,8 @@ namespace SK_OPTS_NS { // Handle last 0-3 bytes. uint32_t k = 0; switch (bytes & 3) { - case 3: k ^= data[2] << 16; - case 2: k ^= data[1] << 8; + case 3: k ^= data[2] << 16; [[fallthrough]]; + case 2: k ^= data[1] << 8; [[fallthrough]]; case 1: k ^= data[0] << 0; k *= 0xcc9e2d51; k = (k << 15) | (k >> 17); diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h index 8c7969b06b..ad745a6b5e 100644 --- a/src/opts/SkRasterPipeline_opts.h +++ b/src/opts/SkRasterPipeline_opts.h @@ -625,13 +625,13 @@ namespace SK_OPTS_NS { F _04, _15, _26, _37; _04 = _15 = _26 = _37 = 0; switch (tail) { - case 0: _37 = _mm256_insertf128_ps(_37, _mm_loadu_ps(ptr+28), 1); - case 7: _26 = _mm256_insertf128_ps(_26, _mm_loadu_ps(ptr+24), 1); - case 6: _15 = _mm256_insertf128_ps(_15, _mm_loadu_ps(ptr+20), 1); - case 5: _04 = _mm256_insertf128_ps(_04, _mm_loadu_ps(ptr+16), 1); - case 4: _37 = _mm256_insertf128_ps(_37, _mm_loadu_ps(ptr+12), 0); - case 3: _26 = _mm256_insertf128_ps(_26, _mm_loadu_ps(ptr+ 8), 0); - case 2: _15 = _mm256_insertf128_ps(_15, _mm_loadu_ps(ptr+ 4), 0); + case 0: _37 = _mm256_insertf128_ps(_37, _mm_loadu_ps(ptr+28), 1); [[fallthrough]]; + case 7: _26 = _mm256_insertf128_ps(_26, _mm_loadu_ps(ptr+24), 1); [[fallthrough]]; + case 6: _15 = _mm256_insertf128_ps(_15, _mm_loadu_ps(ptr+20), 1); [[fallthrough]]; + case 5: _04 = _mm256_insertf128_ps(_04, _mm_loadu_ps(ptr+16), 1); [[fallthrough]]; + case 4: _37 = _mm256_insertf128_ps(_37, _mm_loadu_ps(ptr+12), 0); [[fallthrough]]; + case 3: _26 = _mm256_insertf128_ps(_26, _mm_loadu_ps(ptr+ 8), 0); [[fallthrough]]; + case 2: _15 = _mm256_insertf128_ps(_15, _mm_loadu_ps(ptr+ 4), 0); [[fallthrough]]; case 1: _04 = _mm256_insertf128_ps(_04, _mm_loadu_ps(ptr+ 0), 0); } @@ -1148,11 +1148,11 @@ SI V load(const T* src, size_t tail) { if (__builtin_expect(tail, 0)) { V v{}; // Any inactive lanes are zeroed. switch (tail) { - case 7: v[6] = src[6]; - case 6: v[5] = src[5]; - case 5: v[4] = src[4]; + case 7: v[6] = src[6]; [[fallthrough]]; + case 6: v[5] = src[5]; [[fallthrough]]; + case 5: v[4] = src[4]; [[fallthrough]]; case 4: memcpy(&v, src, 4*sizeof(T)); break; - case 3: v[2] = src[2]; + case 3: v[2] = src[2]; [[fallthrough]]; case 2: memcpy(&v, src, 2*sizeof(T)); break; case 1: memcpy(&v, src, 1*sizeof(T)); break; } @@ -1168,11 +1168,11 @@ SI void store(T* dst, V v, size_t tail) { __builtin_assume(tail < N); if (__builtin_expect(tail, 0)) { switch (tail) { - case 7: dst[6] = v[6]; - case 6: dst[5] = v[5]; - case 5: dst[4] = v[4]; + case 7: dst[6] = v[6]; [[fallthrough]]; + case 6: dst[5] = v[5]; [[fallthrough]]; + case 5: dst[4] = v[4]; [[fallthrough]]; case 4: memcpy(dst, &v, 4*sizeof(T)); break; - case 3: dst[2] = v[2]; + case 3: dst[2] = v[2]; [[fallthrough]]; case 2: memcpy(dst, &v, 2*sizeof(T)); break; case 1: memcpy(dst, &v, 1*sizeof(T)); break; } @@ -3403,20 +3403,20 @@ SI V load(const T* ptr, size_t tail) { switch (tail & (N-1)) { case 0: memcpy(&v, ptr, sizeof(v)); break; #if defined(JUMPER_IS_HSW) || defined(JUMPER_IS_SKX) - case 15: v[14] = ptr[14]; - case 14: v[13] = ptr[13]; - case 13: v[12] = ptr[12]; + case 15: v[14] = ptr[14]; [[fallthrough]]; + case 14: v[13] = ptr[13]; [[fallthrough]]; + case 13: v[12] = ptr[12]; [[fallthrough]]; case 12: memcpy(&v, ptr, 12*sizeof(T)); break; - case 11: v[10] = ptr[10]; - case 10: v[ 9] = ptr[ 9]; - case 9: v[ 8] = ptr[ 8]; + case 11: v[10] = ptr[10]; [[fallthrough]]; + case 10: v[ 9] = ptr[ 9]; [[fallthrough]]; + case 9: v[ 8] = ptr[ 8]; [[fallthrough]]; case 8: memcpy(&v, ptr, 8*sizeof(T)); break; #endif - case 7: v[ 6] = ptr[ 6]; - case 6: v[ 5] = ptr[ 5]; - case 5: v[ 4] = ptr[ 4]; + case 7: v[ 6] = ptr[ 6]; [[fallthrough]]; + case 6: v[ 5] = ptr[ 5]; [[fallthrough]]; + case 5: v[ 4] = ptr[ 4]; [[fallthrough]]; case 4: memcpy(&v, ptr, 4*sizeof(T)); break; - case 3: v[ 2] = ptr[ 2]; + case 3: v[ 2] = ptr[ 2]; [[fallthrough]]; case 2: memcpy(&v, ptr, 2*sizeof(T)); break; case 1: v[ 0] = ptr[ 0]; } @@ -3427,20 +3427,20 @@ SI void store(T* ptr, size_t tail, V v) { switch (tail & (N-1)) { case 0: memcpy(ptr, &v, sizeof(v)); break; #if defined(JUMPER_IS_HSW) || defined(JUMPER_IS_SKX) - case 15: ptr[14] = v[14]; - case 14: ptr[13] = v[13]; - case 13: ptr[12] = v[12]; + case 15: ptr[14] = v[14]; [[fallthrough]]; + case 14: ptr[13] = v[13]; [[fallthrough]]; + case 13: ptr[12] = v[12]; [[fallthrough]]; case 12: memcpy(ptr, &v, 12*sizeof(T)); break; - case 11: ptr[10] = v[10]; - case 10: ptr[ 9] = v[ 9]; - case 9: ptr[ 8] = v[ 8]; + case 11: ptr[10] = v[10]; [[fallthrough]]; + case 10: ptr[ 9] = v[ 9]; [[fallthrough]]; + case 9: ptr[ 8] = v[ 8]; [[fallthrough]]; case 8: memcpy(ptr, &v, 8*sizeof(T)); break; #endif - case 7: ptr[ 6] = v[ 6]; - case 6: ptr[ 5] = v[ 5]; - case 5: ptr[ 4] = v[ 4]; + case 7: ptr[ 6] = v[ 6]; [[fallthrough]]; + case 6: ptr[ 5] = v[ 5]; [[fallthrough]]; + case 5: ptr[ 4] = v[ 4]; [[fallthrough]]; case 4: memcpy(ptr, &v, 4*sizeof(T)); break; - case 3: ptr[ 2] = v[ 2]; + case 3: ptr[ 2] = v[ 2]; [[fallthrough]]; case 2: memcpy(ptr, &v, 2*sizeof(T)); break; case 1: ptr[ 0] = v[ 0]; } @@ -3513,12 +3513,12 @@ SI void load_8888_(const uint32_t* ptr, size_t tail, U16* r, U16* g, U16* b, U16 uint8x8x4_t rgba; switch (tail & (N-1)) { case 0: rgba = vld4_u8 ((const uint8_t*)(ptr+0) ); break; - case 7: rgba = vld4_lane_u8((const uint8_t*)(ptr+6), rgba, 6); - case 6: rgba = vld4_lane_u8((const uint8_t*)(ptr+5), rgba, 5); - case 5: rgba = vld4_lane_u8((const uint8_t*)(ptr+4), rgba, 4); - case 4: rgba = vld4_lane_u8((const uint8_t*)(ptr+3), rgba, 3); - case 3: rgba = vld4_lane_u8((const uint8_t*)(ptr+2), rgba, 2); - case 2: rgba = vld4_lane_u8((const uint8_t*)(ptr+1), rgba, 1); + case 7: rgba = vld4_lane_u8((const uint8_t*)(ptr+6), rgba, 6); [[fallthrough]]; + case 6: rgba = vld4_lane_u8((const uint8_t*)(ptr+5), rgba, 5); [[fallthrough]]; + case 5: rgba = vld4_lane_u8((const uint8_t*)(ptr+4), rgba, 4); [[fallthrough]]; + case 4: rgba = vld4_lane_u8((const uint8_t*)(ptr+3), rgba, 3); [[fallthrough]]; + case 3: rgba = vld4_lane_u8((const uint8_t*)(ptr+2), rgba, 2); [[fallthrough]]; + case 2: rgba = vld4_lane_u8((const uint8_t*)(ptr+1), rgba, 1); [[fallthrough]]; case 1: rgba = vld4_lane_u8((const uint8_t*)(ptr+0), rgba, 0); } *r = cast(rgba.val[0]); @@ -3539,12 +3539,12 @@ SI void store_8888_(uint32_t* ptr, size_t tail, U16 r, U16 g, U16 b, U16 a) { }}; switch (tail & (N-1)) { case 0: vst4_u8 ((uint8_t*)(ptr+0), rgba ); break; - case 7: vst4_lane_u8((uint8_t*)(ptr+6), rgba, 6); - case 6: vst4_lane_u8((uint8_t*)(ptr+5), rgba, 5); - case 5: vst4_lane_u8((uint8_t*)(ptr+4), rgba, 4); - case 4: vst4_lane_u8((uint8_t*)(ptr+3), rgba, 3); - case 3: vst4_lane_u8((uint8_t*)(ptr+2), rgba, 2); - case 2: vst4_lane_u8((uint8_t*)(ptr+1), rgba, 1); + case 7: vst4_lane_u8((uint8_t*)(ptr+6), rgba, 6); [[fallthrough]]; + case 6: vst4_lane_u8((uint8_t*)(ptr+5), rgba, 5); [[fallthrough]]; + case 5: vst4_lane_u8((uint8_t*)(ptr+4), rgba, 4); [[fallthrough]]; + case 4: vst4_lane_u8((uint8_t*)(ptr+3), rgba, 3); [[fallthrough]]; + case 3: vst4_lane_u8((uint8_t*)(ptr+2), rgba, 2); [[fallthrough]]; + case 2: vst4_lane_u8((uint8_t*)(ptr+1), rgba, 1); [[fallthrough]]; case 1: vst4_lane_u8((uint8_t*)(ptr+0), rgba, 0); } #else @@ -3669,12 +3669,12 @@ SI void load_88_(const uint16_t* ptr, size_t tail, U16* r, U16* g) { uint8x8x2_t rg; switch (tail & (N-1)) { case 0: rg = vld2_u8 ((const uint8_t*)(ptr+0) ); break; - case 7: rg = vld2_lane_u8((const uint8_t*)(ptr+6), rg, 6); - case 6: rg = vld2_lane_u8((const uint8_t*)(ptr+5), rg, 5); - case 5: rg = vld2_lane_u8((const uint8_t*)(ptr+4), rg, 4); - case 4: rg = vld2_lane_u8((const uint8_t*)(ptr+3), rg, 3); - case 3: rg = vld2_lane_u8((const uint8_t*)(ptr+2), rg, 2); - case 2: rg = vld2_lane_u8((const uint8_t*)(ptr+1), rg, 1); + case 7: rg = vld2_lane_u8((const uint8_t*)(ptr+6), rg, 6); [[fallthrough]]; + case 6: rg = vld2_lane_u8((const uint8_t*)(ptr+5), rg, 5); [[fallthrough]]; + case 5: rg = vld2_lane_u8((const uint8_t*)(ptr+4), rg, 4); [[fallthrough]]; + case 4: rg = vld2_lane_u8((const uint8_t*)(ptr+3), rg, 3); [[fallthrough]]; + case 3: rg = vld2_lane_u8((const uint8_t*)(ptr+2), rg, 2); [[fallthrough]]; + case 2: rg = vld2_lane_u8((const uint8_t*)(ptr+1), rg, 1); [[fallthrough]]; case 1: rg = vld2_lane_u8((const uint8_t*)(ptr+0), rg, 0); } *r = cast(rg.val[0]); @@ -3692,12 +3692,12 @@ SI void store_88_(uint16_t* ptr, size_t tail, U16 r, U16 g) { }}; switch (tail & (N-1)) { case 0: vst2_u8 ((uint8_t*)(ptr+0), rg ); break; - case 7: vst2_lane_u8((uint8_t*)(ptr+6), rg, 6); - case 6: vst2_lane_u8((uint8_t*)(ptr+5), rg, 5); - case 5: vst2_lane_u8((uint8_t*)(ptr+4), rg, 4); - case 4: vst2_lane_u8((uint8_t*)(ptr+3), rg, 3); - case 3: vst2_lane_u8((uint8_t*)(ptr+2), rg, 2); - case 2: vst2_lane_u8((uint8_t*)(ptr+1), rg, 1); + case 7: vst2_lane_u8((uint8_t*)(ptr+6), rg, 6); [[fallthrough]]; + case 6: vst2_lane_u8((uint8_t*)(ptr+5), rg, 5); [[fallthrough]]; + case 5: vst2_lane_u8((uint8_t*)(ptr+4), rg, 4); [[fallthrough]]; + case 4: vst2_lane_u8((uint8_t*)(ptr+3), rg, 3); [[fallthrough]]; + case 3: vst2_lane_u8((uint8_t*)(ptr+2), rg, 2); [[fallthrough]]; + case 2: vst2_lane_u8((uint8_t*)(ptr+1), rg, 1); [[fallthrough]]; case 1: vst2_lane_u8((uint8_t*)(ptr+0), rg, 0); } #else diff --git a/src/pathops/SkPathOpsCubic.cpp b/src/pathops/SkPathOpsCubic.cpp index ebf195d7b0..1275fababd 100644 --- a/src/pathops/SkPathOpsCubic.cpp +++ b/src/pathops/SkPathOpsCubic.cpp @@ -257,7 +257,7 @@ int SkDCubic::ComplexBreak(const SkPoint pointsPtr[4], SkScalar* t) { return (int) (t[0] > 0 && t[0] < 1); } } - // fall through if no t value found + [[fallthrough]]; // fall through if no t value found case SkCubicType::kSerpentine: case SkCubicType::kLocalCusp: case SkCubicType::kCuspAtInfinity: { @@ -313,9 +313,10 @@ int SkDCubic::ComplexBreak(const SkPoint pointsPtr[4], SkScalar* t) { } return resultCount; } + break; } default: - ; + break; } return 0; } diff --git a/src/sfnt/SkOTTable_name.cpp b/src/sfnt/SkOTTable_name.cpp index c9d47b8f82..ecb3ce4bdd 100644 --- a/src/sfnt/SkOTTable_name.cpp +++ b/src/sfnt/SkOTTable_name.cpp @@ -506,6 +506,7 @@ bool SkOTTableName::Iterator::next(SkOTTableName::Iterator::Record& record) { record.name.reset(); break; // continue? } + [[fallthrough]]; case SkOTTableName::Record::PlatformID::Unicode: case SkOTTableName::Record::PlatformID::ISO: SkString_from_UTF16BE(nameString, nameLength, record.name); diff --git a/src/shaders/gradients/Sk4fLinearGradient.cpp b/src/shaders/gradients/Sk4fLinearGradient.cpp index d75bec9655..944ac9fdb4 100644 --- a/src/shaders/gradients/Sk4fLinearGradient.cpp +++ b/src/shaders/gradients/Sk4fLinearGradient.cpp @@ -190,17 +190,17 @@ LinearGradient4fContext::shadePremulSpan(int x, int y, SkPMColor dst[], int coun const SkLinearGradient& shader = static_cast(fShader); switch (shader.fTileMode) { case SkTileMode::kDecal: - SkASSERT(false); // decal only supported via stages - // fall-through + SkASSERT(false); // decal only supported via stages + [[fallthrough]]; case SkTileMode::kClamp: this->shadeSpanInternal(x, y, dst, count, bias0, bias1); - break; + break; case SkTileMode::kRepeat: this->shadeSpanInternal(x, y, dst, count, bias0, bias1); - break; + break; case SkTileMode::kMirror: this->shadeSpanInternal(x, y, dst, count, bias0, bias1); - break; + break; } } diff --git a/src/shaders/gradients/SkGradientShader.cpp b/src/shaders/gradients/SkGradientShader.cpp index 205a18f05b..8d279c97d2 100644 --- a/src/shaders/gradients/SkGradientShader.cpp +++ b/src/shaders/gradients/SkGradientShader.cpp @@ -299,7 +299,8 @@ bool SkGradientShaderBase::onAppendStages(const SkStageRec& rec) const { decal_ctx->limit_x = SkBits2Float(SkFloat2Bits(1.0f) + 1); // reuse mask + limit_x stage, or create a custom decal_1 that just stores the mask p->append(SkRasterPipeline::decal_x, decal_ctx); - // fall-through to clamp + [[fallthrough]]; + case SkTileMode::kClamp: if (!fOrigPos) { // We clamp only when the stops are evenly spaced. diff --git a/src/sksl/SkSLByteCode.cpp b/src/sksl/SkSLByteCode.cpp index 65e4301c4b..de2e156106 100644 --- a/src/sksl/SkSLByteCode.cpp +++ b/src/sksl/SkSLByteCode.cpp @@ -273,20 +273,23 @@ static const uint8_t* DisassembleInstruction(const uint8_t* ip) { } #define VECTOR_BINARY_OP(base, field, op) \ - case ByteCodeInstruction::base ## 4: \ + case ByteCodeInstruction::base ## 4: { \ sp[-4] = sp[-4].field op sp[0].field; \ POP(); \ - /* fall through */ \ + [[fallthrough]]; \ + } \ case ByteCodeInstruction::base ## 3: { \ int count = (int)inst - (int)(ByteCodeInstruction::base) - 1; \ sp[count] = sp[count].field op sp[0].field; \ POP(); \ - } /* fall through */ \ + [[fallthrough]]; \ + } \ case ByteCodeInstruction::base ## 2: { \ int count = (int)inst - (int)(ByteCodeInstruction::base) - 1; \ sp[count] = sp[count].field op sp[0].field; \ POP(); \ - } /* fall through */ \ + [[fallthrough]]; \ + } \ case ByteCodeInstruction::base: { \ int count = (int)inst - (int)(ByteCodeInstruction::base) - 1; \ sp[count] = sp[count].field op sp[0].field; \ @@ -297,14 +300,15 @@ static const uint8_t* DisassembleInstruction(const uint8_t* ip) { // A naive implementation of / or % using skvx operations will likely crash with a divide by zero // in inactive vector lanes, so we need to be sure to avoid masked-off lanes. #define VECTOR_BINARY_MASKED_OP(base, field, op) \ - case ByteCodeInstruction::base ## 4: \ + case ByteCodeInstruction::base ## 4: { \ for (int i = 0; i < VecWidth; ++i) { \ if (mask()[i]) { \ sp[-4].field[i] op ## = sp[0].field[i]; \ } \ } \ POP(); \ - /* fall through */ \ + [[fallthrough]]; \ + } \ case ByteCodeInstruction::base ## 3: { \ int count = (int)inst - (int)(ByteCodeInstruction::base) - 1; \ for (int i = 0; i < VecWidth; ++i) { \ @@ -313,7 +317,8 @@ static const uint8_t* DisassembleInstruction(const uint8_t* ip) { } \ } \ POP(); \ - } /* fall through */ \ + [[fallthrough]]; \ + } \ case ByteCodeInstruction::base ## 2: { \ int count = (int)inst - (int)(ByteCodeInstruction::base) - 1; \ for (int i = 0; i < VecWidth; ++i) { \ @@ -322,7 +327,8 @@ static const uint8_t* DisassembleInstruction(const uint8_t* ip) { } \ } \ POP(); \ - } /* fall through */ \ + [[fallthrough]]; \ + } \ case ByteCodeInstruction::base: { \ int count = (int)inst - (int)(ByteCodeInstruction::base) - 1; \ for (int i = 0; i < VecWidth; ++i) { \ @@ -347,20 +353,23 @@ static const uint8_t* DisassembleInstruction(const uint8_t* ip) { } #define VECTOR_BINARY_FN(base, field, fn) \ - case ByteCodeInstruction::base ## 4: \ + case ByteCodeInstruction::base ## 4: { \ sp[-4] = fn(sp[-4].field, sp[0].field); \ POP(); \ - /* fall through */ \ + [[fallthrough]]; \ + } \ case ByteCodeInstruction::base ## 3: { \ int count = (int)inst - (int)(ByteCodeInstruction::base) - 1; \ sp[count] = fn(sp[count].field, sp[0].field); \ POP(); \ - } /* fall through */ \ + [[fallthrough]]; \ + } \ case ByteCodeInstruction::base ## 2: { \ int count = (int)inst - (int)(ByteCodeInstruction::base) - 1; \ sp[count] = fn(sp[count].field, sp[0].field); \ POP(); \ - } /* fall through */ \ + [[fallthrough]]; \ + } \ case ByteCodeInstruction::base: { \ int count = (int)inst - (int)(ByteCodeInstruction::base) - 1; \ sp[count] = fn(sp[count].field, sp[0].field); \ @@ -368,11 +377,11 @@ static const uint8_t* DisassembleInstruction(const uint8_t* ip) { continue; \ } -#define VECTOR_UNARY_FN(base, fn, field) \ - case ByteCodeInstruction::base ## 4: sp[-3] = fn(sp[-3].field); \ - case ByteCodeInstruction::base ## 3: sp[-2] = fn(sp[-2].field); \ - case ByteCodeInstruction::base ## 2: sp[-1] = fn(sp[-1].field); \ - case ByteCodeInstruction::base: sp[ 0] = fn(sp[ 0].field); \ +#define VECTOR_UNARY_FN(base, fn, field) \ + case ByteCodeInstruction::base ## 4: sp[-3] = fn(sp[-3].field); [[fallthrough]]; \ + case ByteCodeInstruction::base ## 3: sp[-2] = fn(sp[-2].field); [[fallthrough]]; \ + case ByteCodeInstruction::base ## 2: sp[-1] = fn(sp[-1].field); [[fallthrough]]; \ + case ByteCodeInstruction::base: sp[ 0] = fn(sp[ 0].field); \ continue; union VValue { @@ -561,9 +570,9 @@ static bool InnerRun(const ByteCode* byteCode, const ByteCodeFunction* f, VValue sp[-1] = sp[-1].fSigned & sp[0].fSigned; POP(); continue; - case ByteCodeInstruction::kNotB4: sp[-3] = ~sp[-3].fSigned; - case ByteCodeInstruction::kNotB3: sp[-2] = ~sp[-2].fSigned; - case ByteCodeInstruction::kNotB2: sp[-1] = ~sp[-1].fSigned; + case ByteCodeInstruction::kNotB4: sp[-3] = ~sp[-3].fSigned; [[fallthrough]]; + case ByteCodeInstruction::kNotB3: sp[-2] = ~sp[-2].fSigned; [[fallthrough]]; + case ByteCodeInstruction::kNotB2: sp[-1] = ~sp[-1].fSigned; [[fallthrough]]; case ByteCodeInstruction::kNotB: sp[ 0] = ~sp[ 0].fSigned; continue; case ByteCodeInstruction::kOrB: @@ -628,23 +637,44 @@ static bool InnerRun(const ByteCode* byteCode, const ByteCodeFunction* f, VValue VECTOR_BINARY_OP(kCompareULTEQ, fUnsigned, <=) VECTOR_BINARY_OP(kCompareFLTEQ, fFloat, <=) - case ByteCodeInstruction::kConvertFtoI4: sp[-3] = skvx::cast(sp[-3].fFloat); - case ByteCodeInstruction::kConvertFtoI3: sp[-2] = skvx::cast(sp[-2].fFloat); - case ByteCodeInstruction::kConvertFtoI2: sp[-1] = skvx::cast(sp[-1].fFloat); - case ByteCodeInstruction::kConvertFtoI: sp[ 0] = skvx::cast(sp[ 0].fFloat); - continue; + case ByteCodeInstruction::kConvertFtoI4: + sp[-3] = skvx::cast(sp[-3].fFloat); + [[fallthrough]]; + case ByteCodeInstruction::kConvertFtoI3: + sp[-2] = skvx::cast(sp[-2].fFloat); + [[fallthrough]]; + case ByteCodeInstruction::kConvertFtoI2: + sp[-1] = skvx::cast(sp[-1].fFloat); + [[fallthrough]]; + case ByteCodeInstruction::kConvertFtoI: + sp[ 0] = skvx::cast(sp[ 0].fFloat); + continue; - case ByteCodeInstruction::kConvertStoF4: sp[-3] = skvx::cast(sp[-3].fSigned); - case ByteCodeInstruction::kConvertStoF3: sp[-2] = skvx::cast(sp[-2].fSigned); - case ByteCodeInstruction::kConvertStoF2: sp[-1] = skvx::cast(sp[-1].fSigned); - case ByteCodeInstruction::kConvertStoF: sp[ 0] = skvx::cast(sp[ 0].fSigned); - continue; + case ByteCodeInstruction::kConvertStoF4: + sp[-3] = skvx::cast(sp[-3].fSigned); + [[fallthrough]]; + case ByteCodeInstruction::kConvertStoF3: + sp[-2] = skvx::cast(sp[-2].fSigned); + [[fallthrough]]; + case ByteCodeInstruction::kConvertStoF2: + sp[-1] = skvx::cast(sp[-1].fSigned); + [[fallthrough]]; + case ByteCodeInstruction::kConvertStoF: + sp[ 0] = skvx::cast(sp[ 0].fSigned); + continue; - case ByteCodeInstruction::kConvertUtoF4: sp[-3] = skvx::cast(sp[-3].fUnsigned); - case ByteCodeInstruction::kConvertUtoF3: sp[-2] = skvx::cast(sp[-2].fUnsigned); - case ByteCodeInstruction::kConvertUtoF2: sp[-1] = skvx::cast(sp[-1].fUnsigned); - case ByteCodeInstruction::kConvertUtoF: sp[ 0] = skvx::cast(sp[ 0].fUnsigned); - continue; + case ByteCodeInstruction::kConvertUtoF4: + sp[-3] = skvx::cast(sp[-3].fUnsigned); + [[fallthrough]]; + case ByteCodeInstruction::kConvertUtoF3: + sp[-2] = skvx::cast(sp[-2].fUnsigned); + [[fallthrough]]; + case ByteCodeInstruction::kConvertUtoF2: + sp[-1] = skvx::cast(sp[-1].fUnsigned); + [[fallthrough]]; + case ByteCodeInstruction::kConvertUtoF: + sp[ 0] = skvx::cast(sp[ 0].fUnsigned); + continue; VECTOR_UNARY_FN(kCos, skvx::cos, fFloat) @@ -652,11 +682,18 @@ static bool InnerRun(const ByteCode* byteCode, const ByteCodeFunction* f, VValue VECTOR_BINARY_MASKED_OP(kDivideU, fUnsigned, /) VECTOR_MATRIX_BINARY_OP(kDivideF, fFloat, /) - case ByteCodeInstruction::kDup4: PUSH(sp[(int)inst - (int)ByteCodeInstruction::kDup]); - case ByteCodeInstruction::kDup3: PUSH(sp[(int)inst - (int)ByteCodeInstruction::kDup]); - case ByteCodeInstruction::kDup2: PUSH(sp[(int)inst - (int)ByteCodeInstruction::kDup]); - case ByteCodeInstruction::kDup : PUSH(sp[(int)inst - (int)ByteCodeInstruction::kDup]); - continue; + case ByteCodeInstruction::kDup4: + PUSH(sp[(int)inst - (int)ByteCodeInstruction::kDup]); + [[fallthrough]]; + case ByteCodeInstruction::kDup3: + PUSH(sp[(int)inst - (int)ByteCodeInstruction::kDup]); + [[fallthrough]]; + case ByteCodeInstruction::kDup2: + PUSH(sp[(int)inst - (int)ByteCodeInstruction::kDup]); + [[fallthrough]]; + case ByteCodeInstruction::kDup : + PUSH(sp[(int)inst - (int)ByteCodeInstruction::kDup]); + continue; case ByteCodeInstruction::kDupN: { int count = READ8(); @@ -692,29 +729,36 @@ static bool InnerRun(const ByteCode* byteCode, const ByteCodeFunction* f, VValue continue; } - case ByteCodeInstruction::kLoad4: sp[4] = stack[*ip + 3]; - case ByteCodeInstruction::kLoad3: sp[3] = stack[*ip + 2]; - case ByteCodeInstruction::kLoad2: sp[2] = stack[*ip + 1]; + case ByteCodeInstruction::kLoad4: sp[4] = stack[*ip + 3]; [[fallthrough]]; + case ByteCodeInstruction::kLoad3: sp[3] = stack[*ip + 2]; [[fallthrough]]; + case ByteCodeInstruction::kLoad2: sp[2] = stack[*ip + 1]; [[fallthrough]]; case ByteCodeInstruction::kLoad: sp[1] = stack[*ip + 0]; ++ip; sp += (int)ByteCodeInstruction::kLoad - (int)inst + 1; continue; - case ByteCodeInstruction::kLoadGlobal4: sp[4] = globals[*ip + 3]; - case ByteCodeInstruction::kLoadGlobal3: sp[3] = globals[*ip + 2]; - case ByteCodeInstruction::kLoadGlobal2: sp[2] = globals[*ip + 1]; + case ByteCodeInstruction::kLoadGlobal4: sp[4] = globals[*ip + 3]; [[fallthrough]]; + case ByteCodeInstruction::kLoadGlobal3: sp[3] = globals[*ip + 2]; [[fallthrough]]; + case ByteCodeInstruction::kLoadGlobal2: sp[2] = globals[*ip + 1]; [[fallthrough]]; case ByteCodeInstruction::kLoadGlobal: sp[1] = globals[*ip + 0]; ++ip; sp += (int)ByteCodeInstruction::kLoadGlobal - (int)inst + 1; continue; - case ByteCodeInstruction::kLoadUniform4: sp[4].fFloat = uniforms[*ip + 3]; - case ByteCodeInstruction::kLoadUniform3: sp[3].fFloat = uniforms[*ip + 2]; - case ByteCodeInstruction::kLoadUniform2: sp[2].fFloat = uniforms[*ip + 1]; - case ByteCodeInstruction::kLoadUniform: sp[1].fFloat = uniforms[*ip + 0]; - ++ip; - sp += (int)ByteCodeInstruction::kLoadUniform - (int)inst + 1; - continue; + case ByteCodeInstruction::kLoadUniform4: + sp[4].fFloat = uniforms[*ip + 3]; + [[fallthrough]]; + case ByteCodeInstruction::kLoadUniform3: + sp[3].fFloat = uniforms[*ip + 2]; + [[fallthrough]]; + case ByteCodeInstruction::kLoadUniform2: + sp[2].fFloat = uniforms[*ip + 1]; + [[fallthrough]]; + case ByteCodeInstruction::kLoadUniform: + sp[1].fFloat = uniforms[*ip + 0]; + ++ip; + sp += (int)ByteCodeInstruction::kLoadUniform - (int)inst + 1; + continue; case ByteCodeInstruction::kLoadExtended: { int count = READ8(); @@ -860,9 +904,9 @@ static bool InnerRun(const ByteCode* byteCode, const ByteCodeFunction* f, VValue VECTOR_BINARY_OP(kMultiplyI, fSigned, *) VECTOR_MATRIX_BINARY_OP(kMultiplyF, fFloat, *) - case ByteCodeInstruction::kNegateF4: sp[-3] = -sp[-3].fFloat; - case ByteCodeInstruction::kNegateF3: sp[-2] = -sp[-2].fFloat; - case ByteCodeInstruction::kNegateF2: sp[-1] = -sp[-1].fFloat; + case ByteCodeInstruction::kNegateF4: sp[-3] = -sp[-3].fFloat; [[fallthrough]]; + case ByteCodeInstruction::kNegateF3: sp[-2] = -sp[-2].fFloat; [[fallthrough]]; + case ByteCodeInstruction::kNegateF2: sp[-1] = -sp[-1].fFloat; [[fallthrough]]; case ByteCodeInstruction::kNegateF: sp[ 0] = -sp[ 0].fFloat; continue; @@ -874,15 +918,15 @@ static bool InnerRun(const ByteCode* byteCode, const ByteCodeFunction* f, VValue continue; } - case ByteCodeInstruction::kNegateI4: sp[-3] = -sp[-3].fSigned; - case ByteCodeInstruction::kNegateI3: sp[-2] = -sp[-2].fSigned; - case ByteCodeInstruction::kNegateI2: sp[-1] = -sp[-1].fSigned; + case ByteCodeInstruction::kNegateI4: sp[-3] = -sp[-3].fSigned; [[fallthrough]]; + case ByteCodeInstruction::kNegateI3: sp[-2] = -sp[-2].fSigned; [[fallthrough]]; + case ByteCodeInstruction::kNegateI2: sp[-1] = -sp[-1].fSigned; [[fallthrough]]; case ByteCodeInstruction::kNegateI: sp[ 0] = -sp[ 0].fSigned; continue; - case ByteCodeInstruction::kPop4: POP(); - case ByteCodeInstruction::kPop3: POP(); - case ByteCodeInstruction::kPop2: POP(); + case ByteCodeInstruction::kPop4: POP(); [[fallthrough]]; + case ByteCodeInstruction::kPop3: POP(); [[fallthrough]]; + case ByteCodeInstruction::kPop2: POP(); [[fallthrough]]; case ByteCodeInstruction::kPop: POP(); continue; @@ -993,10 +1037,13 @@ static bool InnerRun(const ByteCode* byteCode, const ByteCodeFunction* f, VValue case ByteCodeInstruction::kStore4: stack[*ip+3] = skvx::if_then_else(mask(), POP().fFloat, stack[*ip+3].fFloat); + [[fallthrough]]; case ByteCodeInstruction::kStore3: stack[*ip+2] = skvx::if_then_else(mask(), POP().fFloat, stack[*ip+2].fFloat); + [[fallthrough]]; case ByteCodeInstruction::kStore2: stack[*ip+1] = skvx::if_then_else(mask(), POP().fFloat, stack[*ip+1].fFloat); + [[fallthrough]]; case ByteCodeInstruction::kStore: stack[*ip+0] = skvx::if_then_else(mask(), POP().fFloat, stack[*ip+0].fFloat); ++ip; @@ -1004,10 +1051,13 @@ static bool InnerRun(const ByteCode* byteCode, const ByteCodeFunction* f, VValue case ByteCodeInstruction::kStoreGlobal4: globals[*ip+3] = skvx::if_then_else(mask(), POP().fFloat, globals[*ip+3].fFloat); + [[fallthrough]]; case ByteCodeInstruction::kStoreGlobal3: globals[*ip+2] = skvx::if_then_else(mask(), POP().fFloat, globals[*ip+2].fFloat); + [[fallthrough]]; case ByteCodeInstruction::kStoreGlobal2: globals[*ip+1] = skvx::if_then_else(mask(), POP().fFloat, globals[*ip+1].fFloat); + [[fallthrough]]; case ByteCodeInstruction::kStoreGlobal: globals[*ip+0] = skvx::if_then_else(mask(), POP().fFloat, globals[*ip+0].fFloat); ++ip; diff --git a/src/sksl/SkSLCompiler.cpp b/src/sksl/SkSLCompiler.cpp index 5d2571c77a..a59343d0a4 100644 --- a/src/sksl/SkSLCompiler.cpp +++ b/src/sksl/SkSLCompiler.cpp @@ -426,6 +426,7 @@ void Compiler::addDefinitions(const BasicBlock::Node& node, (std::unique_ptr*) &fContext->fDefined_Expression, definitions); } + break; } default: break; @@ -1021,8 +1022,8 @@ void Compiler::simplifyExpression(DefinitionMap& definitions, return; } SkASSERT((*iter)->fKind == BasicBlock::Node::kExpression_Kind); - break; } + break; } default: break; diff --git a/src/sksl/SkSLGLSLCodeGenerator.cpp b/src/sksl/SkSLGLSLCodeGenerator.cpp index 6f64ae54ce..127145a192 100644 --- a/src/sksl/SkSLGLSLCodeGenerator.cpp +++ b/src/sksl/SkSLGLSLCodeGenerator.cpp @@ -522,7 +522,7 @@ void GLSLCodeGenerator::writeFunctionCall(const FunctionCall& c) { this->write("-dFdy"); nameWritten = true; } - // fallthru + [[fallthrough]]; case FunctionClass::kDFdx: case FunctionClass::kFwidth: if (!fFoundDerivatives && diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp index 6e46832218..7fc3237355 100644 --- a/src/sksl/SkSLIRGenerator.cpp +++ b/src/sksl/SkSLIRGenerator.cpp @@ -1429,7 +1429,7 @@ static bool determine_binary_type(const Context& context, *outResultType = &left; return right.canCoerceTo(left); } - // fall through + [[fallthrough]]; case Token::Kind::TK_STAR: if (is_matrix_multiply(left, right)) { // determine final component type @@ -1482,7 +1482,7 @@ static bool determine_binary_type(const Context& context, *outResultType = &left; return right.canCoerceTo(left); } - // fall through + [[fallthrough]]; case Token::Kind::TK_PLUS: // fall through case Token::Kind::TK_MINUS: // fall through case Token::Kind::TK_SLASH: // fall through @@ -2726,7 +2726,7 @@ std::unique_ptr IRGenerator::convertSwizzle(std::unique_ptr IRGenerator::convertSwizzle(std::unique_ptr IRGenerator::convertSwizzle(std::unique_ptrfOffset, String::printf("invalid swizzle component '%c'", fields[i])); diff --git a/src/sksl/SkSLParser.cpp b/src/sksl/SkSLParser.cpp index 3f7df7997f..afa9e3dab1 100644 --- a/src/sksl/SkSLParser.cpp +++ b/src/sksl/SkSLParser.cpp @@ -1069,7 +1069,7 @@ ASTNode::ID Parser::statement() { if (this->isType(this->text(start))) { return this->varDeclarations(); } - // fall through + [[fallthrough]]; default: return this->expressionStatement(); } @@ -1370,7 +1370,8 @@ ASTNode::ID Parser::forStatement() { getNode(result).addChild(initializer); break; } - } // fall through + [[fallthrough]]; + } default: initializer = this->expressionStatement(); if (!initializer) { @@ -1960,7 +1961,7 @@ ASTNode::ID Parser::postfixExpression() { if (this->text(t)[0] != '.') { return result; } - // fall through + [[fallthrough]]; case Token::Kind::TK_LBRACKET: case Token::Kind::TK_DOT: case Token::Kind::TK_LPAREN: @@ -2016,6 +2017,7 @@ ASTNode::ID Parser::suffix(ASTNode::ID base) { getNode(result).addChild(base); return result; } + [[fallthrough]]; // FIXME(ethannicholas) } case Token::Kind::TK_FLOAT_LITERAL: { // Swizzles that start with a constant number, e.g. '.000r', will be tokenized as @@ -2082,6 +2084,7 @@ ASTNode::ID Parser::term() { if (this->identifier(&text)) { RETURN_NODE(t.fOffset, ASTNode::Kind::kIdentifier, std::move(text)); } + break; } case Token::Kind::TK_INT_LITERAL: { SKSL_INT i; diff --git a/src/sksl/SkSLSPIRVCodeGenerator.cpp b/src/sksl/SkSLSPIRVCodeGenerator.cpp index d79227a791..0152929f65 100644 --- a/src/sksl/SkSLSPIRVCodeGenerator.cpp +++ b/src/sksl/SkSLSPIRVCodeGenerator.cpp @@ -253,10 +253,10 @@ void SPIRVCodeGenerator::writeString(const char* string, size_t length, OutputSt switch (length % 4) { case 1: out.write8(0); - // fall through + [[fallthrough]]; case 2: out.write8(0); - // fall through + [[fallthrough]]; case 3: out.write8(0); break; diff --git a/src/sksl/lex/RegexParser.cpp b/src/sksl/lex/RegexParser.cpp index 9b5445e1a3..be7d09a106 100644 --- a/src/sksl/lex/RegexParser.cpp +++ b/src/sksl/lex/RegexParser.cpp @@ -63,8 +63,8 @@ void RegexParser::sequence() { this->quantifiedTerm(); for (;;) { switch (this->peek()) { - case END: // fall through - case '|': // fall through + case END: [[fallthrough]]; + case '|': [[fallthrough]]; case ')': return; default: this->sequence(); diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp index 1e1639e501..39619eb961 100644 --- a/tests/GrMeshTest.cpp +++ b/tests/GrMeshTest.cpp @@ -270,7 +270,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrMeshTest, reporter, ctxInfo) { if (context->priv().caps()->shaderCaps()->vertexIDSupport()) { break; } - // Fallthru. + [[fallthrough]]; case 1: vertexBuffer = helper->fVertBuffer.get(); break; diff --git a/tests/PathOpsChalkboardTest.cpp b/tests/PathOpsChalkboardTest.cpp index b75dfdda1b..83cd02a933 100644 --- a/tests/PathOpsChalkboardTest.cpp +++ b/tests/PathOpsChalkboardTest.cpp @@ -140,6 +140,7 @@ static void chalkboard_threaded(skiatest::Reporter* reporter, const char* filena } break; } + [[fallthrough]]; default: testlines = 0; for (int i = 0; i < bitCount; ++i) { diff --git a/tests/SkNxTest.cpp b/tests/SkNxTest.cpp index 0f189dfe1c..605e8024ba 100644 --- a/tests/SkNxTest.cpp +++ b/tests/SkNxTest.cpp @@ -84,15 +84,24 @@ void test_Ni(skiatest::Reporter* r) { v.store(vals); switch (N) { - case 8: REPORTER_ASSERT(r, vals[4] == e && vals[5] == f && vals[6] == g && vals[7] == h); - case 4: REPORTER_ASSERT(r, vals[2] == c && vals[3] == d); - case 2: REPORTER_ASSERT(r, vals[0] == a && vals[1] == b); + case 8: + REPORTER_ASSERT(r, vals[4] == e && vals[5] == f && vals[6] == g && vals[7] == h); + [[fallthrough]]; + case 4: + REPORTER_ASSERT(r, vals[2] == c && vals[3] == d); + [[fallthrough]]; + case 2: + REPORTER_ASSERT(r, vals[0] == a && vals[1] == b); } switch (N) { - case 8: REPORTER_ASSERT(r, v[4] == e && v[5] == f && - v[6] == g && v[7] == h); - case 4: REPORTER_ASSERT(r, v[2] == c && v[3] == d); - case 2: REPORTER_ASSERT(r, v[0] == a && v[1] == b); + case 8: + REPORTER_ASSERT(r, v[4] == e && v[5] == f && v[6] == g && v[7] == h); + [[fallthrough]]; + case 4: + REPORTER_ASSERT(r, v[2] == c && v[3] == d); + [[fallthrough]]; + case 2: + REPORTER_ASSERT(r, v[0] == a && v[1] == b); } }; diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp index e212f44590..5b85ae4cbf 100644 --- a/tests/WritePixelsTest.cpp +++ b/tests/WritePixelsTest.cpp @@ -143,8 +143,8 @@ static SkPMColor convert_to_PMColor(SkColorType ct, SkAlphaType at, uint32_t col color = premul(color); } switch (ct) { - case kRGBA_8888_SkColorType: - case kRGB_888x_SkColorType: // fallthrough + case kRGBA_8888_SkColorType: // fallthrough + case kRGB_888x_SkColorType: color = SkSwizzle_RGBA_to_PMColor(color); break; case kBGRA_8888_SkColorType: diff --git a/tools/skpbench/skpbench.cpp b/tools/skpbench/skpbench.cpp index 05ad72e349..e0c0fcb577 100644 --- a/tools/skpbench/skpbench.cpp +++ b/tools/skpbench/skpbench.cpp @@ -410,8 +410,10 @@ static void run_gpu_time_benchmark(sk_gpu_test::GpuTimer* gpuTimer, GrContext* c using QueryStatus = sk_gpu_test::GpuTimer::QueryStatus; case QueryStatus::kInvalid: exitf(ExitErr::kUnavailable, "GPU timer failed"); + break; case QueryStatus::kPending: exitf(ExitErr::kUnavailable, "timer query still not ready after fence sync"); + break; case QueryStatus::kDisjoint: if (FLAGS_verbosity >= 4) { fprintf(stderr, "discarding timer query due to disjoint operations.\n");