From be03ef156568dc0b6e6c00d5c53a42f7d6a637cf Mon Sep 17 00:00:00 2001 From: Kevin Lubick Date: Wed, 16 Jun 2021 15:28:00 -0400 Subject: [PATCH] Remove ableist language Change-Id: Ie9ef50a14906c9350adbe16720291dca944ad7fc Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418738 Commit-Queue: Kevin Lubick Reviewed-by: John Stiles Reviewed-by: Jorge Betancourt --- experimental/ffmpeg/SkVideoDecoder.cpp | 4 +- gm/b_119394958.cpp | 4 +- gm/blurrect.cpp | 2 +- gm/blurroundrect.cpp | 2 +- gm/coloremoji.cpp | 2 +- include/core/SkData.h | 4 +- include/core/SkRect.h | 3 +- include/gpu/GrBackendSurfaceMutableState.h | 2 +- include/private/GrSingleOwner.h | 2 +- modules/skottie/src/SkottieTest.cpp | 6 +- modules/skottie/src/text/RangeSelector.cpp | 2 +- src/codec/SkIcoCodec.cpp | 6 +- src/core/SkColorFilter.cpp | 4 +- src/core/SkData.cpp | 2 +- src/core/SkOverdrawCanvas.cpp | 4 +- src/core/SkReadBuffer.cpp | 2 +- src/core/SkVM.cpp | 2 +- src/core/SkVMBlitter.cpp | 2 +- src/gpu/GrProcessorUnitTest.h | 6 -- src/gpu/GrRenderTargetProxy.h | 2 +- src/gpu/GrSPIRVUniformHandler.cpp | 4 +- src/gpu/gl/GrGLGpu.h | 4 +- src/gpu/glsl/GrGLSLFragmentShaderBuilder.h | 4 +- src/gpu/glsl/GrGLSLShaderBuilder.cpp | 2 +- src/gpu/gradients/GrClampedGradientEffect.fp | 6 +- src/gpu/gradients/GrGradientShader.cpp | 2 +- src/gpu/mock/GrMockOpsRenderPass.h | 14 ++-- src/image/SkImage_Raster.cpp | 4 +- src/pathops/SkPathWriter.cpp | 4 +- src/ports/SkFontHost_win.cpp | 2 +- src/ports/SkFontMgr_win_dw.cpp | 6 +- src/shaders/gradients/SkGradientShader.cpp | 26 +++---- src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp | 8 +- src/utils/win/SkWGL.h | 6 +- src/utils/win/SkWGL_win.cpp | 82 ++++++++++---------- src/xps/SkXPSDevice.cpp | 2 +- tests/CodecTest.cpp | 2 +- tests/DeferredDisplayListTest.cpp | 6 +- tests/DrawOpAtlasTest.cpp | 4 +- tests/EncodeTest.cpp | 4 +- tests/GrMeshTest.cpp | 14 ++-- tests/GrStyledShapeTest.cpp | 2 +- tests/PDFPrimitivesTest.cpp | 18 ++--- tests/PathOpsOpTest.cpp | 2 - tests/PrimitiveProcessorTest.cpp | 6 +- tests/ProgramsTest.cpp | 14 ++-- tests/RRectInPathTest.cpp | 12 +-- tests/SurfaceTest.cpp | 4 +- tests/TestUtils.cpp | 4 +- 49 files changed, 160 insertions(+), 171 deletions(-) diff --git a/experimental/ffmpeg/SkVideoDecoder.cpp b/experimental/ffmpeg/SkVideoDecoder.cpp index 6728c3827e..e5ade148a8 100644 --- a/experimental/ffmpeg/SkVideoDecoder.cpp +++ b/experimental/ffmpeg/SkVideoDecoder.cpp @@ -255,9 +255,9 @@ sk_sp SkVideoDecoder::convertFrame(const AVFrame* frame) { } sk_sp SkVideoDecoder::nextImage(double* timeStamp) { - double dummyTimeStampStorage = 0; + double defaultTimeStampStorage = 0; if (!timeStamp) { - timeStamp = &dummyTimeStampStorage; + timeStamp = &defaultTimeStampStorage; } if (fFormatCtx == nullptr) { diff --git a/gm/b_119394958.cpp b/gm/b_119394958.cpp index 3be59b1ea2..f5b192e91e 100644 --- a/gm/b_119394958.cpp +++ b/gm/b_119394958.cpp @@ -15,8 +15,8 @@ DEF_SIMPLE_GM(b_119394958, canvas, 100, 100) { // The root cause of this bug was that a stroked arc with round caps was batched with a filled // circle. The circle op code would choose a GeometryProcessor configuration that expected round // cap centers as vertex attributes. However, the tessellation code for the filled circle would - // not put in dummy round cap centers and then didn't advance the pointer into which vertex data - // was being written by the expected vertex stride. + // not put in zero-width round cap centers and then didn't advance the pointer into which + // vertex data was being written by the expected vertex stride. SkPaint paint; paint.setColor(SK_ColorBLUE); paint.setAntiAlias(true); diff --git a/gm/blurrect.cpp b/gm/blurrect.cpp index ee8aafdb5e..0e0c691327 100644 --- a/gm/blurrect.cpp +++ b/gm/blurrect.cpp @@ -80,7 +80,7 @@ static void draw_donut_skewed(SkCanvas* canvas, const SkRect& r, const SkPaint& } /* - * Spits out a dummy gradient to test blur with shader on paint + * Spits out an arbitrary gradient to test blur with shader on paint */ static sk_sp make_radial() { SkPoint pts[2] = { diff --git a/gm/blurroundrect.cpp b/gm/blurroundrect.cpp index 8e10957491..48e394c857 100644 --- a/gm/blurroundrect.cpp +++ b/gm/blurroundrect.cpp @@ -28,7 +28,7 @@ #include "src/core/SkBlurMask.h" /* - * Spits out a dummy gradient to test blur with shader on paint + * Spits out an arbitrary gradient to test blur with shader on paint */ static sk_sp MakeRadial() { SkPoint pts[2] = { diff --git a/gm/coloremoji.cpp b/gm/coloremoji.cpp index e195376497..14b51aee10 100644 --- a/gm/coloremoji.cpp +++ b/gm/coloremoji.cpp @@ -34,7 +34,7 @@ #include /* - * Spits out a dummy gradient to test blur with shader on paint + * Spits out an arbitrary gradient to test blur with shader on paint */ static sk_sp MakeLinear() { constexpr SkPoint kPts[] = { { 0, 0 }, { 32, 32 } }; diff --git a/include/core/SkData.h b/include/core/SkData.h index fae2acf1c3..eb845b5ad3 100644 --- a/include/core/SkData.h +++ b/include/core/SkData.h @@ -105,7 +105,7 @@ public: * SkData. Suitable for with const globals. */ static sk_sp MakeWithoutCopy(const void* data, size_t length) { - return MakeWithProc(data, length, DummyReleaseProc, nullptr); + return MakeWithProc(data, length, NoopReleaseProc, nullptr); } /** @@ -174,7 +174,7 @@ private: // shared internal factory static sk_sp PrivateNewWithCopy(const void* srcOrNull, size_t length); - static void DummyReleaseProc(const void*, void*); // {} + static void NoopReleaseProc(const void*, void*); // {} using INHERITED = SkRefCnt; }; diff --git a/include/core/SkRect.h b/include/core/SkRect.h index d42da68f96..fcdd48edbd 100644 --- a/include/core/SkRect.h +++ b/include/core/SkRect.h @@ -529,8 +529,7 @@ struct SK_API SkIRect { @return true if a and b have area in common */ static bool Intersects(const SkIRect& a, const SkIRect& b) { - SkIRect dummy; - return dummy.intersect(a, b); + return SkIRect{}.intersect(a, b); } /** Sets SkIRect to the union of itself and r. diff --git a/include/gpu/GrBackendSurfaceMutableState.h b/include/gpu/GrBackendSurfaceMutableState.h index b3d3f793fb..3a5f1d7fa2 100644 --- a/include/gpu/GrBackendSurfaceMutableState.h +++ b/include/gpu/GrBackendSurfaceMutableState.h @@ -78,7 +78,7 @@ private: #endif union { - char fDummy; + char fPlaceholder; #ifdef SK_VULKAN GrVkSharedImageInfo fVkState; #endif diff --git a/include/private/GrSingleOwner.h b/include/private/GrSingleOwner.h index 0bbaeb7849..f612bb5fca 100644 --- a/include/private/GrSingleOwner.h +++ b/include/private/GrSingleOwner.h @@ -59,7 +59,7 @@ private: }; #else #define GR_ASSERT_SINGLE_OWNER(obj) -class GrSingleOwner {}; // Provide a dummy implementation so we can pass pointers to constructors +class GrSingleOwner {}; // Provide a no-op implementation so we can pass pointers to constructors #endif #endif diff --git a/modules/skottie/src/SkottieTest.cpp b/modules/skottie/src/SkottieTest.cpp index a558a71e83..8a8884d486 100644 --- a/modules/skottie/src/SkottieTest.cpp +++ b/modules/skottie/src/SkottieTest.cpp @@ -209,9 +209,9 @@ DEF_TEST(Skottie_Properties, reporter) { }; // Returns a single specified typeface for all requests. - class DummyFontMgr : public SkFontMgr { + class FakeFontMgr : public SkFontMgr { public: - DummyFontMgr(sk_sp test_font) : fTestFont(test_font) {} + FakeFontMgr(sk_sp test_font) : fTestFont(test_font) {} int onCountFamilies() const override { return 1; } void onGetFamilyName(int index, SkString* familyName) const override {} @@ -250,7 +250,7 @@ DEF_TEST(Skottie_Properties, reporter) { sk_sp fTestFont; }; - sk_sp test_font_manager = sk_make_sp(test_typeface); + sk_sp test_font_manager = sk_make_sp(test_typeface); SkMemoryStream stream(json, strlen(json)); auto observer = sk_make_sp(); diff --git a/modules/skottie/src/text/RangeSelector.cpp b/modules/skottie/src/text/RangeSelector.cpp index b32ea4401b..47c81574e6 100644 --- a/modules/skottie/src/text/RangeSelector.cpp +++ b/modules/skottie/src/text/RangeSelector.cpp @@ -32,7 +32,7 @@ T ParseEnum(const TArray& arr, const skjson::Value& jenum, return arr[idx - 1]; } - // For animators without selectors, BM emits dummy selector entries with 0 (inval) props. + // For animators without selectors, BM emits placeholder selector entries with 0 (inval) props. // Supress warnings for these as they are "normal". if (idx != 0) { abuilder->log(Logger::Level::kWarning, nullptr, diff --git a/src/codec/SkIcoCodec.cpp b/src/codec/SkIcoCodec.cpp index 5ffaf06022..9340744f76 100644 --- a/src/codec/SkIcoCodec.cpp +++ b/src/codec/SkIcoCodec.cpp @@ -157,11 +157,11 @@ std::unique_ptr SkIcoCodec::MakeFromStream(std::unique_ptr st // Check if the embedded codec is bmp or png and create the codec std::unique_ptr codec; - Result dummyResult; + Result ignoredResult; if (SkPngCodec::IsPng(embeddedData->bytes(), embeddedData->size())) { - codec = SkPngCodec::MakeFromStream(std::move(embeddedStream), &dummyResult); + codec = SkPngCodec::MakeFromStream(std::move(embeddedStream), &ignoredResult); } else { - codec = SkBmpCodec::MakeFromIco(std::move(embeddedStream), &dummyResult); + codec = SkBmpCodec::MakeFromIco(std::move(embeddedStream), &ignoredResult); } if (nullptr != codec) { diff --git a/src/core/SkColorFilter.cpp b/src/core/SkColorFilter.cpp index 06d3f25997..f55d9a54f9 100644 --- a/src/core/SkColorFilter.cpp +++ b/src/core/SkColorFilter.cpp @@ -98,10 +98,10 @@ SkPMColor4f SkColorFilterBase::onFilterColor4f(const SkPMColor4f& color, SkSTArenaAlloc alloc; SkRasterPipeline pipeline(&alloc); pipeline.append_constant_color(&alloc, color.vec()); - SkPaint dummyPaint; + SkPaint blankPaint; SkSimpleMatrixProvider matrixProvider(SkMatrix::I()); SkStageRec rec = { - &pipeline, &alloc, kRGBA_F32_SkColorType, dstCS, dummyPaint, nullptr, matrixProvider + &pipeline, &alloc, kRGBA_F32_SkColorType, dstCS, blankPaint, nullptr, matrixProvider }; if (as_CFB(this)->onAppendStages(rec, color.fA == 1)) { diff --git a/src/core/SkData.cpp b/src/core/SkData.cpp index 8e200bc487..f9575426a9 100644 --- a/src/core/SkData.cpp +++ b/src/core/SkData.cpp @@ -81,7 +81,7 @@ sk_sp SkData::PrivateNewWithCopy(const void* srcOrNull, size_t length) { return data; } -void SkData::DummyReleaseProc(const void*, void*) {} +void SkData::NoopReleaseProc(const void*, void*) {} /////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/SkOverdrawCanvas.cpp b/src/core/SkOverdrawCanvas.cpp index a54239e085..b6426bae24 100644 --- a/src/core/SkOverdrawCanvas.cpp +++ b/src/core/SkOverdrawCanvas.cpp @@ -185,8 +185,8 @@ void SkOverdrawCanvas::onDrawImageLattice2(const SkImage* image, const Lattice& if (SkLatticeIter::Valid(image->width(), image->height(), latticePlusBounds)) { SkLatticeIter iter(latticePlusBounds, dst); - SkRect dummy, iterDst; - while (iter.next(&dummy, &iterDst)) { + SkRect ignored, iterDst; + while (iter.next(&ignored, &iterDst)) { fList[0]->onDrawRect(iterDst, fPaint); } } else { diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp index d0b8b6d216..75c268ed27 100644 --- a/src/core/SkReadBuffer.cpp +++ b/src/core/SkReadBuffer.cpp @@ -385,7 +385,7 @@ sk_sp SkReadBuffer::readImage_preV78() { #include "src/core/SkMipmap.h" // If we see a corrupt stream, we return null (fail). If we just fail trying to decode -// the image, we don't fail, but return a dummy image. +// the image, we don't fail, but return a 1x1 empty image. sk_sp SkReadBuffer::readImage() { if (this->isVersionLT(SkPicturePriv::kSerializeMipmaps_Version)) { return this->readImage_preV78(); diff --git a/src/core/SkVM.cpp b/src/core/SkVM.cpp index 09478e7a86..cb2a08dc4d 100644 --- a/src/core/SkVM.cpp +++ b/src/core/SkVM.cpp @@ -2966,7 +2966,7 @@ namespace skvm { fImpl->loop = 0; fImpl->instructions.reserve(instructions.size()); - // Add a dummy mapping for the N/A sentinel Val to any arbitrary register + // Add a mapping for the N/A sentinel Val to any arbitrary register // so lookups don't have to know which arguments are used by which Ops. auto lookup_register = [&](Val id) { return id == NA ? (Reg)0 diff --git a/src/core/SkVMBlitter.cpp b/src/core/SkVMBlitter.cpp index 7a94cd3939..d15332bf2e 100644 --- a/src/core/SkVMBlitter.cpp +++ b/src/core/SkVMBlitter.cpp @@ -655,7 +655,7 @@ namespace { } // We don't really _need_ to rebuild fUniforms here. // It's just more natural to have effects unconditionally emit them, - // and more natural to rebuild fUniforms than to emit them into a dummy buffer. + // and more natural to rebuild fUniforms than to emit them into a temporary buffer. // fUniforms should reuse the exact same memory, so this is very cheap. SkDEBUGCODE(size_t prev = fUniforms.buf.size();) fUniforms.buf.resize(kBlitterUniformsCount); diff --git a/src/gpu/GrProcessorUnitTest.h b/src/gpu/GrProcessorUnitTest.h index a6e1ed23be..305a0dc373 100644 --- a/src/gpu/GrProcessorUnitTest.h +++ b/src/gpu/GrProcessorUnitTest.h @@ -30,12 +30,6 @@ class GrGeometryProcessor; namespace GrProcessorUnitTest { -// Used to access the dummy textures in TestCreate procs. -enum { - kSkiaPMTextureIdx = 0, - kAlphaTextureIdx = 1, -}; - /** This allows parent FPs to implement a test create with known leaf children in order to avoid * creating an unbounded FP tree which may overflow various shader limits. * MakeOptionalChildFP is the same as MakeChildFP, but can return null. diff --git a/src/gpu/GrRenderTargetProxy.h b/src/gpu/GrRenderTargetProxy.h index debeaea75d..73b6d0fa67 100644 --- a/src/gpu/GrRenderTargetProxy.h +++ b/src/gpu/GrRenderTargetProxy.h @@ -186,7 +186,7 @@ private: // // In the current world we end the RT proxy at 12 bytes. Technically any padding between 0-4 // will work, but we use 4 to be more explicit about getting it to 16 byte alignment. - char fDummyPadding[4]; + char fPadding[4]; using INHERITED = GrSurfaceProxy; }; diff --git a/src/gpu/GrSPIRVUniformHandler.cpp b/src/gpu/GrSPIRVUniformHandler.cpp index fef052d3d4..50e1c2e670 100644 --- a/src/gpu/GrSPIRVUniformHandler.cpp +++ b/src/gpu/GrSPIRVUniformHandler.cpp @@ -319,6 +319,6 @@ void GrSPIRVUniformHandler::appendUniformDecls(GrShaderFlags visibility, SkStrin } uint32_t GrSPIRVUniformHandler::getRTHeightOffset() const { - uint32_t dummy = fCurrentUBOOffset; - return get_ubo_offset(&dummy, kFloat_GrSLType, 0); + uint32_t currentOffset = fCurrentUBOOffset; + return get_ubo_offset(¤tOffset, kFloat_GrSLType, 0); } diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index 924ec75211..03f98c7f71 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -92,7 +92,7 @@ public: // unchanged. // // NOTE: This binds the default VAO (ID=zero) unless we are on a core profile, in which case we - // use a dummy array instead. + // use a placeholder array instead. GrGLAttribArrayState* bindInternalVertexArray(const GrBuffer* indexBuffer, int numAttribs, GrPrimitiveRestart primitiveRestart) { auto* attribState = fHWVertexArrayState.bindInternalVertexArray(this, indexBuffer); @@ -640,7 +640,7 @@ private: /** * Binds the vertex array that should be used for internal draws, and returns its attrib * state. This binds the default VAO (ID=zero) unless we are on a core profile, in which - * case we use a dummy array instead. + * case we use a placeholder array instead. * * If an index buffer is provided, it will be bound to the vertex array. Otherwise the * index buffer binding will be left unchanged. diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h index 2000d38674..9e68adb4dc 100644 --- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h +++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h @@ -24,7 +24,7 @@ public: /** Appease the compiler; the derived class initializes GrGLSLShaderBuilder. */ GrGLSLFPFragmentBuilder() : GrGLSLShaderBuilder(nullptr) { // Suppress unused warning error - (void) fDummyPadding; + (void) fPadding; } enum class ScopeFlags { @@ -61,7 +61,7 @@ private: // to start aligned, even though clang is already correctly offsetting the individual fields // that require the larger alignment. In the current world, this extra padding is sufficient to // correctly initialize GrGLSLXPFragmentBuilder second. - char fDummyPadding[4] = {}; + char fPadding[4] = {}; }; GR_MAKE_BITFIELD_CLASS_OPS(GrGLSLFPFragmentBuilder::ScopeFlags); diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp index e5674d19ed..7884c5f3ba 100644 --- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp +++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp @@ -25,7 +25,7 @@ GrGLSLShaderBuilder::GrGLSLShaderBuilder(GrGLSLProgramBuilder* program) , fCodeIndex(kCode) , fFinalized(false) , fTmpVariableCounter(0) { - // We push back some dummy pointers which will later become our header + // We push back some placeholder pointers which will later become our header for (int i = 0; i <= kCode; i++) { fShaderStrings.push_back(); } diff --git a/src/gpu/gradients/GrClampedGradientEffect.fp b/src/gpu/gradients/GrClampedGradientEffect.fp index fc5f7c2b8d..38a3ada193 100644 --- a/src/gpu/gradients/GrClampedGradientEffect.fp +++ b/src/gpu/gradients/GrClampedGradientEffect.fp @@ -7,9 +7,9 @@ // This top-level effect implements clamping on the layout coordinate and requires specifying the // border colors that are used when outside the clamped boundary. Gradients with the -// SkShader::kClamp_TileMode should use the colors at their first and last stop (after adding dummy -// stops for t=0,t=1) as the border color. This will automatically replicate the edge color, even if -// when there is a hard stop. +// SkShader::kClamp_TileMode should use the colors at their first and last stop (after adding +// default stops for t=0,t=1) as the border color. This will automatically replicate the edge color, +// even if when there is a hard stop. // // The SkShader::kDecal_TileMode can be produced by specifying transparent black as the border // colors, regardless of the gradient's stop colors. diff --git a/src/gpu/gradients/GrGradientShader.cpp b/src/gpu/gradients/GrGradientShader.cpp index 648d188ea5..c3f0969862 100644 --- a/src/gpu/gradients/GrGradientShader.cpp +++ b/src/gpu/gradients/GrGradientShader.cpp @@ -78,7 +78,7 @@ static std::unique_ptr make_colorizer(const SkPMColor4f* co // and removing these stops at the beginning, it makes optimizing the remaining color stops // simpler. - // SkGradientShaderBase guarantees that pos[0] == 0 by adding a dummy + // SkGradientShaderBase guarantees that pos[0] == 0 by adding a default value. bool bottomHardStop = SkScalarNearlyEqual(positions[0], positions[1]); // The same is true for pos[end] == 1 bool topHardStop = SkScalarNearlyEqual(positions[count - 2], positions[count - 1]); diff --git a/src/gpu/mock/GrMockOpsRenderPass.h b/src/gpu/mock/GrMockOpsRenderPass.h index 0067cafddb..e9ab5fb66f 100644 --- a/src/gpu/mock/GrMockOpsRenderPass.h +++ b/src/gpu/mock/GrMockOpsRenderPass.h @@ -42,17 +42,17 @@ private: } void onBindBuffers(sk_sp indexBuffer, sk_sp instanceBuffer, sk_sp vertexBuffer, GrPrimitiveRestart) override {} - void onDraw(int, int) override { this->dummyDraw(); } - void onDrawIndexed(int, int, uint16_t, uint16_t, int) override { this->dummyDraw(); } - void onDrawInstanced(int, int, int, int) override { this->dummyDraw(); } - void onDrawIndexedInstanced(int, int, int, int, int) override { this->dummyDraw(); } - void onDrawIndirect(const GrBuffer*, size_t, int) override { this->dummyDraw(); } - void onDrawIndexedIndirect(const GrBuffer*, size_t, int) override { this->dummyDraw(); } + void onDraw(int, int) override { this->noopDraw(); } + void onDrawIndexed(int, int, uint16_t, uint16_t, int) override { this->noopDraw(); } + void onDrawInstanced(int, int, int, int) override { this->noopDraw(); } + void onDrawIndexedInstanced(int, int, int, int, int) override { this->noopDraw(); } + void onDrawIndirect(const GrBuffer*, size_t, int) override { this->noopDraw(); } + void onDrawIndexedIndirect(const GrBuffer*, size_t, int) override { this->noopDraw(); } void onClear(const GrScissorState& scissor, std::array) override { this->markRenderTargetDirty(); } void onClearStencilClip(const GrScissorState& scissor, bool insideStencilMask) override {} - void dummyDraw() { + void noopDraw() { this->markRenderTargetDirty(); ++fNumDraws; } diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp index a9770e7ef0..7f079fecae 100644 --- a/src/image/SkImage_Raster.cpp +++ b/src/image/SkImage_Raster.cpp @@ -39,8 +39,8 @@ public: const int maxDimension = SK_MaxS32 >> 2; // TODO(mtklein): eliminate anything here that setInfo() has already checked. - SkBitmap dummy; - if (!dummy.setInfo(info, rowBytes)) { + SkBitmap b; + if (!b.setInfo(info, rowBytes)) { return false; } diff --git a/src/pathops/SkPathWriter.cpp b/src/pathops/SkPathWriter.cpp index b9c731c5ce..842cd2a4da 100644 --- a/src/pathops/SkPathWriter.cpp +++ b/src/pathops/SkPathWriter.cpp @@ -222,8 +222,8 @@ void SkPathWriter::assemble() { // lengthen any partial contour adjacent to a simple segment for (int pIndex = 0; pIndex < endCount; pIndex++) { SkOpPtT* opPtT = const_cast(runs[pIndex]); - SkPath dummy; - SkPathWriter partWriter(dummy); + SkPath p; + SkPathWriter partWriter(p); do { if (!zero_or_one(opPtT->fT)) { break; diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp index 731327dbb1..d2a1a9a17e 100644 --- a/src/ports/SkFontHost_win.cpp +++ b/src/ports/SkFontHost_win.cpp @@ -1722,7 +1722,7 @@ std::unique_ptr LogFontTypeface::onGetAdvancedMetrics return info; } -//Dummy representation of a Base64 encoded GUID from create_unique_font_name. +//Placeholder representation of a Base64 encoded GUID from create_unique_font_name. #define BASE64_GUID_ID "XXXXXXXXXXXXXXXXXXXXXXXX" //Length of GUID representation from create_id, including nullptr terminator. #define BASE64_GUID_ID_LEN SK_ARRAY_COUNT(BASE64_GUID_ID) diff --git a/src/ports/SkFontMgr_win_dw.cpp b/src/ports/SkFontMgr_win_dw.cpp index 8b04c3278d..1ff23d162b 100644 --- a/src/ports/SkFontMgr_win_dw.cpp +++ b/src/ports/SkFontMgr_win_dw.cpp @@ -172,10 +172,10 @@ SK_STDMETHODIMP StreamFontFileEnumerator::MoveNext(BOOL* hasCurrentFile) { } fHasNext = false; - UINT32 dummy = 0; + UINT32 fontFileReferenceKey = 0; HR(fFactory->CreateCustomFontFileReference( - &dummy, //cannot be nullptr - sizeof(dummy), //even if this is 0 + &fontFileReferenceKey, //cannot be nullptr + sizeof(fontFileReferenceKey), //even if this is 0 fFontFileLoader.get(), &fCurrentFile)); diff --git a/src/shaders/gradients/SkGradientShader.cpp b/src/shaders/gradients/SkGradientShader.cpp index 993fde69da..1c2602c266 100644 --- a/src/shaders/gradients/SkGradientShader.cpp +++ b/src/shaders/gradients/SkGradientShader.cpp @@ -139,7 +139,7 @@ SkGradientShaderBase::SkGradientShaderBase(const Descriptor& desc, const SkMatri /* Note: we let the caller skip the first and/or last position. i.e. pos[0] = 0.3, pos[1] = 0.7 - In these cases, we insert dummy entries to ensure that the final data + In these cases, we insert entries to ensure that the final data will be bracketed by [0, 1]. i.e. our_pos[0] = 0, our_pos[1] = 0.3, our_pos[2] = 0.7, our_pos[3] = 1 @@ -149,13 +149,13 @@ SkGradientShaderBase::SkGradientShaderBase(const Descriptor& desc, const SkMatri fColorCount = 4 */ fColorCount = desc.fCount; - // check if we need to add in dummy start and/or end position/colors - bool dummyFirst = false; - bool dummyLast = false; + // check if we need to add in start and/or end position/colors + bool needsFirst = false; + bool needsLast = false; if (desc.fPos) { - dummyFirst = desc.fPos[0] != 0; - dummyLast = desc.fPos[desc.fCount - 1] != SK_Scalar1; - fColorCount += dummyFirst + dummyLast; + needsFirst = desc.fPos[0] != 0; + needsLast = desc.fPos[desc.fCount - 1] != SK_Scalar1; + fColorCount += needsFirst + needsLast; } size_t storageSize = fColorCount * (sizeof(SkColor4f) + (desc.fPos ? sizeof(SkScalar) : 0)); @@ -165,14 +165,14 @@ SkGradientShaderBase::SkGradientShaderBase(const Descriptor& desc, const SkMatri // Now copy over the colors, adding the dummies as needed SkColor4f* origColors = fOrigColors4f; - if (dummyFirst) { + if (needsFirst) { *origColors++ = desc.fColors[0]; } for (int i = 0; i < desc.fCount; ++i) { origColors[i] = desc.fColors[i]; fColorsAreOpaque = fColorsAreOpaque && (desc.fColors[i].fA == 1); } - if (dummyLast) { + if (needsLast) { origColors += desc.fCount; *origColors = desc.fColors[desc.fCount - 1]; } @@ -182,8 +182,8 @@ SkGradientShaderBase::SkGradientShaderBase(const Descriptor& desc, const SkMatri SkScalar* origPosPtr = fOrigPos; *origPosPtr++ = prev; // force the first pos to 0 - int startIndex = dummyFirst ? 0 : 1; - int count = desc.fCount + dummyLast; + int startIndex = needsFirst ? 0 : 1; + int count = desc.fCount + needsLast; bool uniformStops = true; const SkScalar uniformStep = desc.fPos[startIndex] - prev; @@ -369,7 +369,7 @@ bool SkGradientShaderBase::onAppendStages(const SkStageRec& rec) const { ctx->ts = alloc->makeArray(fColorCount+1); - // Remove the dummy stops inserted by SkGradientShaderBase::SkGradientShaderBase + // Remove the default stops inserted by SkGradientShaderBase::SkGradientShaderBase // because they are naturally handled by the search method. int firstStop; int lastStop; @@ -558,7 +558,7 @@ skvm::Color SkGradientShaderBase::onProgram(skvm::Builder* p, // ix -= (t >= stop) ? -1 : 0 ix -= (t >= uniformF(stop)); } - // TODO: we could skip any of the dummy stops GradientShaderBase's ctor added + // TODO: we could skip any of the default stops GradientShaderBase's ctor added // to ensure the full [0,1] span is covered. This linear search doesn't need // them for correctness, and it'd be up to two fewer stops to check. // N.B. we do still need those stops for the fOrigPos == nullptr direct math path. diff --git a/src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp b/src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp index 26bba9b05a..1775f301f7 100644 --- a/src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp +++ b/src/sksl/codegen/SkSLSPIRVCodeGenerator.cpp @@ -2016,10 +2016,10 @@ std::unique_ptr SPIRVCodeGenerator::getLValue(const } } default: { - // expr isn't actually an lvalue, create a dummy variable for it. This case happens due - // to the need to store values in temporary variables during function calls (see - // comments in getFunctionType); erroneous uses of rvalues as lvalues should have been - // caught by IRGenerator + // expr isn't actually an lvalue, create a placeholder variable for it. This case + // happens due to the need to store values in temporary variables during function + // calls (see comments in getFunctionType); erroneous uses of rvalues as lvalues + // should have been caught by IRGenerator SpvId result = this->nextId(nullptr); SpvId pointerType = this->getPointerType(type, SpvStorageClassFunction); this->writeInstruction(SpvOpVariable, pointerType, result, SpvStorageClassFunction, diff --git a/src/utils/win/SkWGL.h b/src/utils/win/SkWGL.h index 543ee4c69a..45cb8e1baf 100644 --- a/src/utils/win/SkWGL.h +++ b/src/utils/win/SkWGL.h @@ -13,10 +13,10 @@ #include "src/core/SkLeanWindows.h" /** - * Working with WGL extensions can be a pain. Among the reasons is that You must + * Working with WGL extensions can be a pain. Among the reasons is that you must * have a GL context to get the proc addresses, but you want to use the procs to - * create a context in the first place. So you have to create a dummy GL ctx to - * get the proc addresses. + * create a context in the first place. So you have to create a placeholder GL + * ctx to get the proc addresses. * * This file helps by providing SkCreateWGLInterface(). It returns a struct of * function pointers that it initializes. It also has a helper function to query diff --git a/src/utils/win/SkWGL_win.cpp b/src/utils/win/SkWGL_win.cpp index c42277df58..5f1278010d 100644 --- a/src/utils/win/SkWGL_win.cpp +++ b/src/utils/win/SkWGL_win.cpp @@ -174,11 +174,11 @@ namespace { #define STR_LIT(X) #X #endif -#define DUMMY_CLASS STR_LIT("DummyClass") +#define TEMP_CLASS STR_LIT("TempClass") -HWND create_dummy_window() { +HWND create_temp_window() { HMODULE module = GetModuleHandle(nullptr); - HWND dummy; + HWND wnd; RECT windowRect; windowRect.left = 0; windowRect.right = 8; @@ -196,7 +196,7 @@ HWND create_dummy_window() { wc.hCursor = LoadCursor(nullptr, IDC_ARROW); wc.hbrBackground = nullptr; wc.lpszMenuName = nullptr; - wc.lpszClassName = DUMMY_CLASS; + wc.lpszClassName = TEMP_CLASS; if(!RegisterClass(&wc)) { return 0; @@ -207,28 +207,28 @@ HWND create_dummy_window() { style = WS_SYSMENU; AdjustWindowRectEx(&windowRect, style, false, exStyle); - if(!(dummy = CreateWindowEx(exStyle, - DUMMY_CLASS, - STR_LIT("DummyWindow"), - WS_CLIPSIBLINGS | WS_CLIPCHILDREN | style, - 0, 0, - windowRect.right-windowRect.left, - windowRect.bottom-windowRect.top, - nullptr, nullptr, - module, - nullptr))) { - UnregisterClass(DUMMY_CLASS, module); + if(!(wnd = CreateWindowEx(exStyle, + TEMP_CLASS, + STR_LIT("PlaceholderWindow"), + WS_CLIPSIBLINGS | WS_CLIPCHILDREN | style, + 0, 0, + windowRect.right-windowRect.left, + windowRect.bottom-windowRect.top, + nullptr, nullptr, + module, + nullptr))) { + UnregisterClass(TEMP_CLASS, module); return nullptr; } - ShowWindow(dummy, SW_HIDE); + ShowWindow(wnd, SW_HIDE); - return dummy; + return wnd; } -void destroy_dummy_window(HWND dummy) { - DestroyWindow(dummy); +void destroy_temp_window(HWND wnd) { + DestroyWindow(wnd); HMODULE module = GetModuleHandle(nullptr); - UnregisterClass(DUMMY_CLASS, module); + UnregisterClass(TEMP_CLASS, module); } } @@ -256,25 +256,25 @@ SkWGLExtensions::SkWGLExtensions() { HDC prevDC = wglGetCurrentDC(); HGLRC prevGLRC = wglGetCurrentContext(); - PIXELFORMATDESCRIPTOR dummyPFD; + PIXELFORMATDESCRIPTOR tempPFD; - ZeroMemory(&dummyPFD, sizeof(dummyPFD)); - dummyPFD.nSize = sizeof(dummyPFD); - dummyPFD.nVersion = 1; - dummyPFD.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL; - dummyPFD.iPixelType = PFD_TYPE_RGBA; - dummyPFD.cColorBits = 32; - dummyPFD.cDepthBits = 0; - dummyPFD.cStencilBits = 8; - dummyPFD.iLayerType = PFD_MAIN_PLANE; - HWND dummyWND = create_dummy_window(); - if (dummyWND) { - HDC dummyDC = GetDC(dummyWND); - int dummyFormat = ChoosePixelFormat(dummyDC, &dummyPFD); - SetPixelFormat(dummyDC, dummyFormat, &dummyPFD); - HGLRC dummyGLRC = wglCreateContext(dummyDC); - SkASSERT(dummyGLRC); - wglMakeCurrent(dummyDC, dummyGLRC); + ZeroMemory(&tempPFD, sizeof(tempPFD)); + tempPFD.nSize = sizeof(tempPFD); + tempPFD.nVersion = 1; + tempPFD.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL; + tempPFD.iPixelType = PFD_TYPE_RGBA; + tempPFD.cColorBits = 32; + tempPFD.cDepthBits = 0; + tempPFD.cStencilBits = 8; + tempPFD.iLayerType = PFD_MAIN_PLANE; + HWND tempWND = create_temp_window(); + if (tempWND) { + HDC tempDC = GetDC(tempWND); + int tempFormat = ChoosePixelFormat(tempDC, &tempPFD); + SetPixelFormat(tempDC, tempFormat, &tempPFD); + HGLRC tempGLRC = wglCreateContext(tempDC); + SkASSERT(tempGLRC); + wglMakeCurrent(tempDC, tempGLRC); #if defined(__clang__) #pragma clang diagnostic push @@ -296,9 +296,9 @@ SkWGLExtensions::SkWGLExtensions() { #pragma clang diagnostic pop #endif - wglMakeCurrent(dummyDC, nullptr); - wglDeleteContext(dummyGLRC); - destroy_dummy_window(dummyWND); + wglMakeCurrent(tempDC, nullptr); + wglDeleteContext(tempGLRC); + destroy_temp_window(tempWND); } wglMakeCurrent(prevDC, prevGLRC); diff --git a/src/xps/SkXPSDevice.cpp b/src/xps/SkXPSDevice.cpp index b2ba5737ee..46ad89bfc0 100644 --- a/src/xps/SkXPSDevice.cpp +++ b/src/xps/SkXPSDevice.cpp @@ -59,7 +59,7 @@ //make it clear when converting a scalar that this is what is wanted. #define SkScalarToFLOAT(n) SkScalarToFloat(n) -//Dummy representation of a GUID from createId. +//Placeholder representation of a GUID from createId. #define L_GUID_ID L"XXXXXXXXsXXXXsXXXXsXXXXsXXXXXXXXXXXX" //Length of GUID representation from createId, including nullptr terminator. #define GUID_ID_LEN SK_ARRAY_COUNT(L_GUID_ID) diff --git a/tests/CodecTest.cpp b/tests/CodecTest.cpp index f47011cadb..96ca821fed 100644 --- a/tests/CodecTest.cpp +++ b/tests/CodecTest.cpp @@ -701,7 +701,7 @@ static void codex_test_write_fn(png_structp png_ptr, png_bytep data, png_size_t } DEF_TEST(Codec_pngChunkReader, r) { - // Create a dummy bitmap. Use unpremul RGBA for libpng. + // Create a bitmap for hashing. Use unpremul RGBA for libpng. SkBitmap bm; const int w = 1; const int h = 1; diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp index 3eb239f518..8f1e5b0128 100644 --- a/tests/DeferredDisplayListTest.cpp +++ b/tests/DeferredDisplayListTest.cpp @@ -301,7 +301,7 @@ public: SkImageInfo imageInfo = SkImageInfo::Make({fWidth, fHeight}, {fColorType, kPremul_SkAlphaType, fColorSpace}); GrVkDrawableInfo vkInfo; - // putting in a bunch of dummy values here + // putting in a bunch of placeholder values here vkInfo.fSecondaryCommandBuffer = (VkCommandBuffer)1; vkInfo.fColorAttachmentIndex = 0; vkInfo.fCompatibleRenderPass = (VkRenderPass)1; @@ -1167,7 +1167,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLMultipleDDLs, reporter, ctxInfo) { #ifdef SK_GL -static sk_sp dummy_fulfill_proc(void*) { +static sk_sp noop_fulfill_proc(void*) { SkASSERT(0); return nullptr; } @@ -1199,7 +1199,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(DDLTextureFlagsTest, reporter, ctxInfo) { kRGBA_8888_SkColorType, kPremul_SkAlphaType, /*color space*/nullptr, - dummy_fulfill_proc, + noop_fulfill_proc, /*release proc*/ nullptr, /*context*/nullptr); if (GR_GL_TEXTURE_2D != target && mipMapped == GrMipmapped::kYes) { diff --git a/tests/DrawOpAtlasTest.cpp b/tests/DrawOpAtlasTest.cpp index 5351030477..fd4acd6c40 100644 --- a/tests/DrawOpAtlasTest.cpp +++ b/tests/DrawOpAtlasTest.cpp @@ -72,7 +72,7 @@ void GrDrawOpAtlas::setMaxPages_TestingOnly(uint32_t maxPages) { fMaxPages = maxPages; } -class DummyEvict : public GrDrawOpAtlas::EvictionCallback { +class AssertOnEvict : public GrDrawOpAtlas::EvictionCallback { public: void evict(GrDrawOpAtlas::PlotLocator) override { SkASSERT(0); // The unit test shouldn't exercise this code path @@ -144,7 +144,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(BasicDrawOpAtlas, reporter, ctxInfo) { GrBackendFormat format = caps->getDefaultBackendFormat(GrColorType::kAlpha_8, GrRenderable::kNo); - DummyEvict evictor; + AssertOnEvict evictor; GrDrawOpAtlas::GenerationCounter counter; std::unique_ptr atlas = GrDrawOpAtlas::Make( diff --git a/tests/EncodeTest.cpp b/tests/EncodeTest.cpp index c4a8b420d1..0d5ea8a0e4 100644 --- a/tests/EncodeTest.cpp +++ b/tests/EncodeTest.cpp @@ -167,8 +167,8 @@ DEF_TEST(Encode_JPG, r) { SkJpegEncoder::AlphaOption::kBlendOnBlack }) { SkJpegEncoder::Options opts; opts.fAlphaOption = alphaOption; - SkNullWStream dummy; - if (!SkJpegEncoder::Encode(&dummy, bm.pixmap(), opts)) { + SkNullWStream ignored; + if (!SkJpegEncoder::Encode(&ignored, bm.pixmap(), opts)) { REPORTER_ASSERT(r, ct == kARGB_4444_SkColorType && alphaOption == SkJpegEncoder::AlphaOption::kBlendOnBlack); } diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp index 27d95fdb49..818bd2e512 100644 --- a/tests/GrMeshTest.cpp +++ b/tests/GrMeshTest.cpp @@ -328,22 +328,22 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrMeshTest, reporter, ctxInfo) { GrDrawIndexedIndirectWriter indexedIndirectWriter; if (indexed) { // Make helper->fDrawIndirectBufferOffset nonzero. - sk_sp dummyBuff; - size_t dummyOffset; + sk_sp ignoredBuff; + size_t ignoredOffset; // Make a superfluous call to makeDrawIndirectSpace in order to test // "offsetInBytes!=0" for the actual call to makeDrawIndexedIndirectSpace. - helper->target()->makeDrawIndirectSpace(29, &dummyBuff, &dummyOffset); + helper->target()->makeDrawIndirectSpace(29, &ignoredBuff, &ignoredOffset); indexedIndirectWriter = helper->target()->makeDrawIndexedIndirectSpace( kBoxCountY, &helper->fDrawIndirectBuffer, &helper->fDrawIndirectBufferOffset); } else { // Make helper->fDrawIndirectBufferOffset nonzero. - sk_sp dummyBuff; - size_t dummyOffset; + sk_sp ignoredBuff; + size_t ignoredOffset; // Make a superfluous call to makeDrawIndexedIndirectSpace in order to test // "offsetInBytes!=0" for the actual call to makeDrawIndirectSpace. - helper->target()->makeDrawIndexedIndirectSpace(7, &dummyBuff, - &dummyOffset); + helper->target()->makeDrawIndexedIndirectSpace(7, &ignoredBuff, + &ignoredOffset); indirectWriter = helper->target()->makeDrawIndirectSpace( kBoxCountY, &helper->fDrawIndirectBuffer, &helper->fDrawIndirectBufferOffset); diff --git a/tests/GrStyledShapeTest.cpp b/tests/GrStyledShapeTest.cpp index 998703c072..895d4827a6 100644 --- a/tests/GrStyledShapeTest.cpp +++ b/tests/GrStyledShapeTest.cpp @@ -1741,7 +1741,7 @@ void test_rrect(skiatest::Reporter* r, const SkRRect& rrect) { Key exampleInvHairlineCaseKey; make_key(&exampleInvHairlineCaseKey, exampleInvHairlineCase); - // These are dummy initializations to suppress warnings. + // These initializations suppress warnings. SkRRect queryRR = SkRRect::MakeEmpty(); SkPathDirection queryDir = SkPathDirection::kCW; unsigned queryStart = ~0U; diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp index 6445f4437a..0321fbcbd5 100644 --- a/tests/PDFPrimitivesTest.cpp +++ b/tests/PDFPrimitivesTest.cpp @@ -39,8 +39,6 @@ #include #include -#define DUMMY_TEXT "DCT compessed stream." - template static SkString emit_to_string(T& obj) { SkDynamicMemoryWStream buffer; @@ -254,10 +252,10 @@ DEF_TEST(SkPDF_Primitives, reporter) { namespace { -class DummyImageFilter : public SkImageFilter_Base { +class TestImageFilter : public SkImageFilter_Base { public: - static sk_sp Make(bool visited = false) { - return sk_sp(new DummyImageFilter(visited)); + static sk_sp Make(bool visited = false) { + return sk_sp(new TestImageFilter(visited)); } bool visited() const { return fVisited; } @@ -270,18 +268,18 @@ protected: } private: - SK_FLATTENABLE_HOOKS(DummyImageFilter) - DummyImageFilter(bool visited) : INHERITED(nullptr, 0, nullptr), fVisited(visited) {} + SK_FLATTENABLE_HOOKS(TestImageFilter) + TestImageFilter(bool visited) : INHERITED(nullptr, 0, nullptr), fVisited(visited) {} mutable bool fVisited; using INHERITED = SkImageFilter_Base; }; -sk_sp DummyImageFilter::CreateProc(SkReadBuffer& buffer) { +sk_sp TestImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0); bool visited = buffer.readBool(); - return DummyImageFilter::Make(visited); + return TestImageFilter::Make(visited); } } // namespace @@ -294,7 +292,7 @@ DEF_TEST(SkPDF_ImageFilter, reporter) { auto doc = SkPDF::MakeDocument(&stream); SkCanvas* canvas = doc->beginPage(100.0f, 100.0f); - sk_sp filter(DummyImageFilter::Make()); + sk_sp filter(TestImageFilter::Make()); // Filter just created; should be unvisited. REPORTER_ASSERT(reporter, !filter->visited()); diff --git a/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp index 7c0aa286ab..9167fb4c35 100644 --- a/tests/PathOpsOpTest.cpp +++ b/tests/PathOpsOpTest.cpp @@ -9615,7 +9615,6 @@ static void fuzz535151(skiatest::Reporter* reporter, const char* filename) { two.moveTo(0, 0); two.lineTo(0, 50); two.lineTo(4.29497e+09f, 50); - SkPath dummy; testPathOpFuzz(reporter, one, two, kIntersect_SkPathOp, filename); } @@ -10081,7 +10080,6 @@ static void fuzz763_1c(skiatest::Reporter* reporter, const char* filename) { path.cubicTo(SkBits2Float(0x4a4a4a4a), SkBits2Float(0x4a4a4a4a), SkBits2Float(0x2ba1a14a), SkBits2Float(0x4e4a08ff), SkBits2Float(0x4a4a4a4a), SkBits2Float(0xa1a181ff)); // 3.31432e+06f, 3.31432e+06f, 1.14845e-12f, 8.47397e+08f, 3.31432e+06f, -1.09442e-18f SkPath path2(path); - SkPath dummy; testPathOpFuzz(reporter, path1, path2, (SkPathOp)4, filename); } diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp index 1d75431e82..5b8d203464 100644 --- a/tests/PrimitiveProcessorTest.cpp +++ b/tests/PrimitiveProcessorTest.cpp @@ -5,7 +5,7 @@ * found in the LICENSE file. */ -// This is a GPU-backend specific test. It relies on static intializers to work +// This is a GPU-backend specific test. It relies on static initializers to work #include @@ -33,7 +33,7 @@ class Op : public GrMeshDrawOp { public: DEFINE_OP_CLASS_ID - const char* name() const override { return "Dummy Op"; } + const char* name() const override { return "Test Op"; } static GrOp::Owner Make(GrRecordingContext* rContext, int numAttribs) { return GrOp::Make(rContext, numAttribs); @@ -71,7 +71,7 @@ private: }); } - const char* name() const override { return "Dummy GP"; } + const char* name() const override { return "Test GP"; } GrGLSLGeometryProcessor* createGLSLInstance(const GrShaderCaps&) const override { class GLSLGP : public GrGLSLGeometryProcessor { diff --git a/tests/ProgramsTest.cpp b/tests/ProgramsTest.cpp index 8eedfb205e..9c86befc25 100644 --- a/tests/ProgramsTest.cpp +++ b/tests/ProgramsTest.cpp @@ -34,7 +34,7 @@ #endif /* - * A dummy processor which just tries to insert a massive key and verify that it can retrieve the + * A simple processor which just tries to insert a massive key and verify that it can retrieve the * whole thing correctly */ static const uint32_t kMaxKeySize = 1024; @@ -249,13 +249,13 @@ bool GrDrawingManager::ProgramUnitTest(GrDirectContext* direct, int maxStages, i GrProcessorTestData::ViewInfo views[2]; - // setup dummy textures + // setup arbitrary textures GrMipmapped mipMapped = GrMipmapped(caps->mipmapSupport()); { - static constexpr SkISize kDummyDims = {34, 18}; + static constexpr SkISize kDims = {34, 18}; const GrBackendFormat format = caps->getDefaultBackendFormat(GrColorType::kRGBA_8888, GrRenderable::kYes); - auto proxy = proxyProvider->createProxy(format, kDummyDims, GrRenderable::kYes, 1, + auto proxy = proxyProvider->createProxy(format, kDims, GrRenderable::kYes, 1, mipMapped, SkBackingFit::kExact, SkBudgeted::kNo, GrProtected::kNo, GrInternalSurfaceFlags::kNone); GrSwizzle swizzle = caps->getReadSwizzle(format, GrColorType::kRGBA_8888); @@ -263,10 +263,10 @@ bool GrDrawingManager::ProgramUnitTest(GrDirectContext* direct, int maxStages, i GrColorType::kRGBA_8888, kPremul_SkAlphaType}; } { - static constexpr SkISize kDummyDims = {16, 22}; + static constexpr SkISize kDims = {16, 22}; const GrBackendFormat format = caps->getDefaultBackendFormat(GrColorType::kAlpha_8, GrRenderable::kNo); - auto proxy = proxyProvider->createProxy(format, kDummyDims, GrRenderable::kNo, 1, mipMapped, + auto proxy = proxyProvider->createProxy(format, kDims, GrRenderable::kNo, 1, mipMapped, SkBackingFit::kExact, SkBudgeted::kNo, GrProtected::kNo, GrInternalSurfaceFlags::kNone); GrSwizzle swizzle = caps->getReadSwizzle(format, GrColorType::kAlpha_8); @@ -275,7 +275,7 @@ bool GrDrawingManager::ProgramUnitTest(GrDirectContext* direct, int maxStages, i } if (!std::get<0>(views[0]) || !std::get<0>(views[1])) { - SkDebugf("Could not allocate dummy textures"); + SkDebugf("Could not allocate textures for test"); return false; } diff --git a/tests/RRectInPathTest.cpp b/tests/RRectInPathTest.cpp index 7eb5459477..a89d884859 100644 --- a/tests/RRectInPathTest.cpp +++ b/tests/RRectInPathTest.cpp @@ -100,14 +100,14 @@ static void force_path_contains_rrect(skiatest::Reporter* reporter, SkPath& path } static void test_undetected_paths(skiatest::Reporter* reporter) { - // We use a dummy path to get the exact conic weight used by SkPath for a circular arc. This + // We first get the exact conic weight used by SkPath for a circular arc. This // allows our local, hand-crafted, artisanal round rect paths below to exactly match the // factory made corporate paths produced by SkPath. - SkPath dummyPath; - dummyPath.addCircle(0, 0, 10); - REPORTER_ASSERT(reporter, SkPath::kMove_Verb == SkPathPriv::VerbData(dummyPath)[0]); - REPORTER_ASSERT(reporter, SkPath::kConic_Verb == SkPathPriv::VerbData(dummyPath)[1]); - const SkScalar weight = SkPathPriv::ConicWeightData(dummyPath)[0]; + SkPath exactPath; + exactPath.addCircle(0, 0, 10); + REPORTER_ASSERT(reporter, SkPath::kMove_Verb == SkPathPriv::VerbData(exactPath)[0]); + REPORTER_ASSERT(reporter, SkPath::kConic_Verb == SkPathPriv::VerbData(exactPath)[1]); + const SkScalar weight = SkPathPriv::ConicWeightData(exactPath)[0]; SkPath path; path.moveTo(0, 62.5f); diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp index 311503159b..b104ea2a8c 100644 --- a/tests/SurfaceTest.cpp +++ b/tests/SurfaceTest.cpp @@ -1165,8 +1165,8 @@ DEF_TEST(surface_image_unity, reporter) { } REPORTER_ASSERT(reporter, img != nullptr); - char dummyPixel = 0; // just need a valid address (not a valid size) - SkPixmap pmap = { info, &dummyPixel, rowBytes }; + char tempPixel = 0; // just need a valid address (not a valid size) + SkPixmap pmap = { info, &tempPixel, rowBytes }; img = SkImage::MakeFromRaster(pmap, nullptr, nullptr); REPORTER_ASSERT(reporter, img != nullptr); } diff --git a/tests/TestUtils.cpp b/tests/TestUtils.cpp index 86c908ac2b..7a269e9632 100644 --- a/tests/TestUtils.cpp +++ b/tests/TestUtils.cpp @@ -160,8 +160,8 @@ bool ComparePixels(const GrCPixmap& a, const float tolRGBA[4], std::function& error) { if (a.dimensions() != b.dimensions()) { - static constexpr float kDummyDiffs[4] = {}; - error(-1, -1, kDummyDiffs); + static constexpr float kEmptyDiffs[4] = {}; + error(-1, -1, kEmptyDiffs); return false; }