Remove "dummy" to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference
Bug: 162536543
Change-Id: I40df639e2f42da6d99d897a02cf05aecff682061
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307226
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
diff --git a/experimental/svg/model/SkSVGRenderContext.cpp b/experimental/svg/model/SkSVGRenderContext.cpp
index 8f9c1e7..a4675a5 100644
--- a/experimental/svg/model/SkSVGRenderContext.cpp
+++ b/experimental/svg/model/SkSVGRenderContext.cpp
@@ -287,18 +287,18 @@
fStrokePaint.setAntiAlias(true);
// Commit initial values to the paint cache.
- SkCanvas dummyCanvas(0, 0);
- SkSVGRenderContext dummy(&dummyCanvas, SkSVGIDMapper(), SkSVGLengthContext(SkSize::Make(0, 0)),
+ SkCanvas fakeCanvas(0, 0);
+ SkSVGRenderContext fake(&fakeCanvas, SkSVGIDMapper(), SkSVGLengthContext(SkSize::Make(0, 0)),
*this);
- commitToPaint<SkSVGAttribute::kFill>(fInherited, dummy, this);
- commitToPaint<SkSVGAttribute::kFillOpacity>(fInherited, dummy, this);
- commitToPaint<SkSVGAttribute::kStroke>(fInherited, dummy, this);
- commitToPaint<SkSVGAttribute::kStrokeLineCap>(fInherited, dummy, this);
- commitToPaint<SkSVGAttribute::kStrokeLineJoin>(fInherited, dummy, this);
- commitToPaint<SkSVGAttribute::kStrokeMiterLimit>(fInherited, dummy, this);
- commitToPaint<SkSVGAttribute::kStrokeOpacity>(fInherited, dummy, this);
- commitToPaint<SkSVGAttribute::kStrokeWidth>(fInherited, dummy, this);
+ commitToPaint<SkSVGAttribute::kFill>(fInherited, fake, this);
+ commitToPaint<SkSVGAttribute::kFillOpacity>(fInherited, fake, this);
+ commitToPaint<SkSVGAttribute::kStroke>(fInherited, fake, this);
+ commitToPaint<SkSVGAttribute::kStrokeLineCap>(fInherited, fake, this);
+ commitToPaint<SkSVGAttribute::kStrokeLineJoin>(fInherited, fake, this);
+ commitToPaint<SkSVGAttribute::kStrokeMiterLimit>(fInherited, fake, this);
+ commitToPaint<SkSVGAttribute::kStrokeOpacity>(fInherited, fake, this);
+ commitToPaint<SkSVGAttribute::kStrokeWidth>(fInherited, fake, this);
}
SkSVGRenderContext::SkSVGRenderContext(SkCanvas* canvas,
diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h
index 032fd71..15e800c 100644
--- a/include/core/SkTypeface.h
+++ b/include/core/SkTypeface.h
@@ -316,7 +316,7 @@
/**
* Return a scalercontext for the given descriptor. It may return a
- * dummy scalercontext that will not crash, but will draw nothing.
+ * stub scalercontext that will not crash, but will draw nothing.
*/
std::unique_ptr<SkScalerContext> createScalerContext(const SkScalerContextEffects&,
const SkDescriptor*) const;
diff --git a/modules/skottie/gm/ExternalProperties.cpp b/modules/skottie/gm/ExternalProperties.cpp
index 0b82ba5..7a4422c 100644
--- a/modules/skottie/gm/ExternalProperties.cpp
+++ b/modules/skottie/gm/ExternalProperties.cpp
@@ -22,7 +22,7 @@
static constexpr char kWebFontResource[] = "fonts/Roboto-Regular.ttf";
static constexpr char kSkottieResource[] = "skottie/skottie_sample_webfont.json";
-// Dummy web font loader which serves a single local font (checked in under resources/).
+// Mock web font loader which serves a single local font (checked in under resources/).
class FakeWebFontProvider final : public skresources::ResourceProvider {
public:
FakeWebFontProvider()
diff --git a/modules/skottie/gm/SkottieGM.cpp b/modules/skottie/gm/SkottieGM.cpp
index 6365d17..a0bc296 100644
--- a/modules/skottie/gm/SkottieGM.cpp
+++ b/modules/skottie/gm/SkottieGM.cpp
@@ -22,7 +22,7 @@
static constexpr char kWebFontResource[] = "fonts/Roboto-Regular.ttf";
static constexpr char kSkottieResource[] = "skottie/skottie_sample_webfont.json";
-// Dummy web font loader which serves a single local font (checked in under resources/).
+// Mock web font loader which serves a single local font (checked in under resources/).
class FakeWebFontProvider final : public skresources::ResourceProvider {
public:
FakeWebFontProvider()
diff --git a/platform_tools/android/skp_gen/android_skp_capture.py b/platform_tools/android/skp_gen/android_skp_capture.py
index 3045b9f..9544b68 100755
--- a/platform_tools/android/skp_gen/android_skp_capture.py
+++ b/platform_tools/android/skp_gen/android_skp_capture.py
@@ -118,7 +118,7 @@
# Spin, wait for the SKP to be written.
timeout = 10 # Seconds
start = time.time()
- device.drag((300, 300), (300, 350), 1, 10) # Dummy action to force a draw.
+ device.drag((300, 300), (300, 350), 1, 10) # Arbitrary action to force a draw.
while not remote_file_exists(remote_path):
if time.time() - start > timeout:
raise Exception('Timed out waiting for SKP capture.')
diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm
index a9a981f..ced4b8c 100644
--- a/site/user/api/catalog.htm
+++ b/site/user/api/catalog.htm
@@ -4825,7 +4825,7 @@
"name": "SkCanvas::drawBitmap"
},
"SkCanvas_drawBitmapLattice": {
- "code": "void draw(SkCanvas* canvas) {\n SkIRect center = { 20, 10, 50, 40 };\n SkBitmap bitmap;\n bitmap.allocPixels(SkImageInfo::MakeN32Premul(60, 60));\n SkCanvas bitCanvas(bitmap);\n SkPaint paint;\n SkColor gray = 0xFF000000;\n int left = 0;\n for (auto right: { center.fLeft, center.fRight, bitmap.width() } ) {\n int top = 0;\n for (auto bottom: { center.fTop, center.fBottom, bitmap.height() } ) {\n paint.setColor(gray);\n bitCanvas.drawIRect(SkIRect::MakeLTRB(left, top, right, bottom), paint);\n gray += 0x001f1f1f;\n top = bottom;\n }\n left = right;\n }\n const int xDivs[] = { center.fLeft, center.fRight };\n const int yDivs[] = { center.fTop, center.fBottom };\n SkCanvas::Lattice::RectType fillTypes[3][3];\n memset(fillTypes, 0, sizeof(fillTypes));\n fillTypes[1][1] = SkCanvas::Lattice::kTransparent;\n SkColor dummy[9]; // temporary pending bug fix\n SkCanvas::Lattice lattice = { xDivs, yDivs, fillTypes[0], SK_ARRAY_COUNT(xDivs),\n SK_ARRAY_COUNT(yDivs), nullptr, dummy };\n for (auto dest: { 20, 30, 40, 60, 90 } ) {\n canvas->drawBitmapLattice(bitmap, lattice, SkRect::MakeWH(dest, 110 - dest), nullptr);\n canvas->translate(dest + 4, 0);\n }\n}\n",
+ "code": "void draw(SkCanvas* canvas) {\n SkIRect center = { 20, 10, 50, 40 };\n SkBitmap bitmap;\n bitmap.allocPixels(SkImageInfo::MakeN32Premul(60, 60));\n SkCanvas bitCanvas(bitmap);\n SkPaint paint;\n SkColor gray = 0xFF000000;\n int left = 0;\n for (auto right: { center.fLeft, center.fRight, bitmap.width() } ) {\n int top = 0;\n for (auto bottom: { center.fTop, center.fBottom, bitmap.height() } ) {\n paint.setColor(gray);\n bitCanvas.drawIRect(SkIRect::MakeLTRB(left, top, right, bottom), paint);\n gray += 0x001f1f1f;\n top = bottom;\n }\n left = right;\n }\n const int xDivs[] = { center.fLeft, center.fRight };\n const int yDivs[] = { center.fTop, center.fBottom };\n SkCanvas::Lattice::RectType fillTypes[3][3];\n memset(fillTypes, 0, sizeof(fillTypes));\n fillTypes[1][1] = SkCanvas::Lattice::kTransparent;\n SkColor placeholder[9]; // temporary pending bug fix\n SkCanvas::Lattice lattice = { xDivs, yDivs, fillTypes[0], SK_ARRAY_COUNT(xDivs),\n SK_ARRAY_COUNT(yDivs), nullptr, placeholder };\n for (auto dest: { 20, 30, 40, 60, 90 } ) {\n canvas->drawBitmapLattice(bitmap, lattice, SkRect::MakeWH(dest, 110 - dest), nullptr);\n canvas->translate(dest + 4, 0);\n }\n}\n",
"width": 256,
"height": 128,
"hash": "c5bfa944e17ba4a4400dc799f032069c",
diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp
index f7fe29d..1fb0ef0 100644
--- a/src/core/SkPictureData.cpp
+++ b/src/core/SkPictureData.cpp
@@ -220,7 +220,7 @@
buffer.setTypefaceRecorder(sk_ref_sp(typefaceSet));
this->flattenToBuffer(buffer, textBlobsOnly);
- // Dummy serialize our sub-pictures for the side effect of filling typefaceSet
+ // Pretend to serialize our sub-pictures for the side effect of filling typefaceSet
// with typefaces from sub-pictures.
struct DevNull: public SkWStream {
DevNull() : fBytesWritten(0) {}
@@ -231,7 +231,7 @@
for (const auto& pic : fPictures) {
pic->serialize(&devnull, nullptr, typefaceSet, /*textBlobsOnly=*/ true);
}
- if (textBlobsOnly) { return; } // return early from dummy serialize
+ if (textBlobsOnly) { return; } // return early from fake serialize
// We need to write factories before we write the buffer.
// We need to write typefaces before we write the buffer or any sub-picture.
diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp
index 73707c2..a53718a 100644
--- a/src/core/SkRegion.cpp
+++ b/src/core/SkRegion.cpp
@@ -896,7 +896,7 @@
SkRegion::Op op,
bool quickExit) {
const SkRegionPriv::RunType gEmptyScanline[] = {
- 0, // dummy bottom value
+ 0, // fake bottom value
0, // zero intervals
SkRegion_kRunTypeSentinel,
// just need a 2nd value, since spanRec.init() reads 2 values, even
diff --git a/src/pathops/SkPathOpsDebug.h b/src/pathops/SkPathOpsDebug.h
index 543607d..b452f72 100644
--- a/src/pathops/SkPathOpsDebug.h
+++ b/src/pathops/SkPathOpsDebug.h
@@ -34,20 +34,20 @@
// define this when running fuzz
// #define IS_FUZZING_WITH_LIBFUZZER
-// dummy classes to fool msvs Visual Studio 2018 Immediate Window
-#define DummyClasses(a, b) \
+// fake classes to fool msvs Visual Studio 2018 Immediate Window
+#define FakeClasses(a, b) \
class SkDebugTCoincident##a##b; \
class SkDebugTSect##a##b; \
class SkDebugTSpan##a##b
-DummyClasses(Quad, Quad);
-DummyClasses(Conic, Quad);
-DummyClasses(Conic, Conic);
-DummyClasses(Cubic, Quad);
-DummyClasses(Cubic, Conic);
-DummyClasses(Cubic, Cubic);
+FakeClasses(Quad, Quad);
+FakeClasses(Conic, Quad);
+FakeClasses(Conic, Conic);
+FakeClasses(Cubic, Quad);
+FakeClasses(Cubic, Conic);
+FakeClasses(Cubic, Cubic);
-#undef DummyClasses
+#undef FakeClasses
#ifdef SK_RELEASE
#define FORCE_RELEASE 1
diff --git a/src/pathops/SkPathOpsTSect.h b/src/pathops/SkPathOpsTSect.h
index 25f1ef2..4d84e3d 100644
--- a/src/pathops/SkPathOpsTSect.h
+++ b/src/pathops/SkPathOpsTSect.h
@@ -97,10 +97,10 @@
void debugInit(const SkTCurve& curve, SkArenaAlloc& heap) {
#ifdef SK_DEBUG
- SkTCurve* dummy = curve.make(heap);
- dummy->debugInit();
- init(*dummy);
- initBounds(*dummy);
+ SkTCurve* fake = curve.make(heap);
+ fake->debugInit();
+ init(*fake);
+ initBounds(*fake);
fCoinStart.init();
fCoinEnd.init();
#endif
diff --git a/src/sksl/SkSLContext.h b/src/sksl/SkSLContext.h
index 8151c9c..277f85b 100644
--- a/src/sksl/SkSLContext.h
+++ b/src/sksl/SkSLContext.h
@@ -358,8 +358,8 @@
const std::unique_ptr<Type> fSkArgs_Type;
const std::unique_ptr<Type> fFragmentProcessor_Type;
- // dummy expression used to mark that a variable has a value during dataflow analysis (when it
- // could have several different values, or the analyzer is otherwise unable to assign it a
+ // sentinel expression used to mark that a variable has a value during dataflow analysis (when
+ // it could have several different values, or the analyzer is otherwise unable to assign it a
// specific expression)
const std::unique_ptr<Expression> fDefined_Expression;
diff --git a/src/utils/SkEventTracer.cpp b/src/utils/SkEventTracer.cpp
index 2574306..0a600e9 100644
--- a/src/utils/SkEventTracer.cpp
+++ b/src/utils/SkEventTracer.cpp
@@ -34,8 +34,8 @@
}
const char* getCategoryGroupName(
const uint8_t* categoryEnabledFlag) override {
- static const char* dummy = "dummy";
- return dummy;
+ static const char* stub = "stub";
+ return stub;
}
};
diff --git a/tests/FrontBufferedStreamTest.cpp b/tests/FrontBufferedStreamTest.cpp
index 455a34a..8b1569d 100644
--- a/tests/FrontBufferedStreamTest.cpp
+++ b/tests/FrontBufferedStreamTest.cpp
@@ -176,7 +176,7 @@
test_read(reporter, bufferedStream.get(), gAbcs, bufferSize);
}
-// Dummy stream that optionally has a length and/or position. Tests that FrontBufferedStream's
+// Mock stream that optionally has a length and/or position. Tests that FrontBufferedStream's
// length depends on the stream it's buffering having a length and position.
class LengthOptionalStream : public SkStream {
public:
@@ -268,7 +268,7 @@
}
// Test that a FrontBufferedStream does not allow reading after the end of a stream.
-// This class is a dummy SkStream which reports that it is at the end on the first
+// This class is a mock SkStream which reports that it is at the end on the first
// read (simulating a failure). Then it tracks whether someone calls read() again.
class FailingStream : public SkStream {
public:
diff --git a/tests/PathOpsBuilderConicTest.cpp b/tests/PathOpsBuilderConicTest.cpp
index 062578c..dd6a61e 100644
--- a/tests/PathOpsBuilderConicTest.cpp
+++ b/tests/PathOpsBuilderConicTest.cpp
@@ -130,11 +130,11 @@
#if DEBUG_SIMPLIFY_FAILS
static bool simplify_fails(skiatest::Reporter* reporter, const SkPath& path) {
- SkPath dummy;
- bool failed = !Simplify(path, &dummy);
+ SkPath simplifiedPath;
+ bool failed = !Simplify(path, &simplifiedPath);
if (!failed) {
SkBitmap bitmap;
- failed = !!comparePaths(reporter, __FUNCTION__, path, dummy, bitmap);
+ failed = !!comparePaths(reporter, __FUNCTION__, path, simplifiedPath, bitmap);
}
return failed;
}
diff --git a/tests/TDPQueueTest.cpp b/tests/TDPQueueTest.cpp
index 279b640..f4798a6 100644
--- a/tests/TDPQueueTest.cpp
+++ b/tests/TDPQueueTest.cpp
@@ -64,42 +64,42 @@
REPORTER_ASSERT(reporter, 0 == heap.count());
}
-struct Dummy {
+struct Mock {
int fValue;
int fPriority;
mutable int fIndex;
- static bool LessP(Dummy* const& a, Dummy* const& b) { return a->fPriority < b->fPriority; }
- static int* PQIndex(Dummy* const& dummy) { return &dummy->fIndex; }
+ static bool LessP(Mock* const& a, Mock* const& b) { return a->fPriority < b->fPriority; }
+ static int* PQIndex(Mock* const& mock) { return &mock->fIndex; }
- bool operator== (const Dummy& that) const {
+ bool operator== (const Mock& that) const {
return fValue == that.fValue && fPriority == that.fPriority;
}
- bool operator!= (const Dummy& that) const { return !(*this == that); }
+ bool operator!= (const Mock& that) const { return !(*this == that); }
};
void random_test(skiatest::Reporter* reporter) {
SkRandom random;
- static const Dummy kSentinel = {-1, -1, -1};
+ static const Mock kSentinel = {-1, -1, -1};
for (int i = 0; i < 100; ++i) {
- // Create a random set of Dummy objects.
+ // Create a random set of Mock objects.
int count = random.nextULessThan(100);
- SkTDArray<Dummy> array;
+ SkTDArray<Mock> array;
array.setReserve(count);
for (int j = 0; j < count; ++j) {
- Dummy* dummy = array.append();
- dummy->fPriority = random.nextS();
- dummy->fValue = random.nextS();
- dummy->fIndex = -1;
- if (*dummy == kSentinel) {
+ Mock* mock = array.append();
+ mock->fPriority = random.nextS();
+ mock->fValue = random.nextS();
+ mock->fIndex = -1;
+ if (*mock == kSentinel) {
array.pop();
--j;
}
}
- // Stick the dummy objects in the pqueue.
- SkTDPQueue<Dummy*, Dummy::LessP, Dummy::PQIndex> pq;
+ // Stick the mock objects in the pqueue.
+ SkTDPQueue<Mock*, Mock::LessP, Mock::PQIndex> pq;
for (int j = 0; j < count; ++j) {
pq.insert(&array[j]);
}
@@ -112,7 +112,7 @@
// Begin the test.
while (pq.count()) {
// Make sure the top of the queue is really the highest priority.
- Dummy* top = pq.peek();
+ Mock* top = pq.peek();
for (int k = 0; k < count; ++k) {
REPORTER_ASSERT(reporter, kSentinel == array[k] ||
array[k].fPriority >= top->fPriority);
@@ -121,7 +121,7 @@
unsigned action = random.nextULessThan(3);
switch (action) {
case 0: { // pop the top,
- Dummy* top = pq.peek();
+ Mock* top = pq.peek();
REPORTER_ASSERT(reporter, array.begin() <= top && top < array.end());
pq.pop();
*top = kSentinel;
@@ -153,29 +153,29 @@
void sort_test(skiatest::Reporter* reporter) {
SkRandom random;
- SkTDPQueue<Dummy *, Dummy::LessP, Dummy::PQIndex> pqTest;
- SkTDPQueue<Dummy *, Dummy::LessP, Dummy::PQIndex> pqControl;
+ SkTDPQueue<Mock *, Mock::LessP, Mock::PQIndex> pqTest;
+ SkTDPQueue<Mock *, Mock::LessP, Mock::PQIndex> pqControl;
- // Create a random set of Dummy objects and populate the test queue.
+ // Create a random set of Mock objects and populate the test queue.
int count = random.nextULessThan(100);
- SkTDArray<Dummy> testArray;
+ SkTDArray<Mock> testArray;
testArray.setReserve(count);
for (int i = 0; i < count; i++) {
- Dummy *dummy = testArray.append();
- dummy->fPriority = random.nextS();
- dummy->fValue = random.nextS();
- dummy->fIndex = -1;
+ Mock *mock = testArray.append();
+ mock->fPriority = random.nextS();
+ mock->fValue = random.nextS();
+ mock->fIndex = -1;
pqTest.insert(&testArray[i]);
}
- // Stick equivalent dummy objects into the control queue.
- SkTDArray<Dummy> controlArray;
+ // Stick equivalent mock objects into the control queue.
+ SkTDArray<Mock> controlArray;
controlArray.setReserve(count);
for (int i = 0; i < count; i++) {
- Dummy *dummy = controlArray.append();
- dummy->fPriority = testArray[i].fPriority;
- dummy->fValue = testArray[i].fValue;
- dummy->fIndex = -1;
+ Mock *mock = controlArray.append();
+ mock->fPriority = testArray[i].fPriority;
+ mock->fValue = testArray[i].fValue;
+ mock->fIndex = -1;
pqControl.insert(&controlArray[i]);
}
diff --git a/tools/win_dbghelp.cpp b/tools/win_dbghelp.cpp
index 37e5f7f..90f7359 100644
--- a/tools/win_dbghelp.cpp
+++ b/tools/win_dbghelp.cpp
@@ -229,7 +229,7 @@
binaries_path[pos_last_slash] = '\0';
setBinariesPath(binaries_path);
- setAppVersion("1.0"); // Dummy for now, but use revision instead if we use
+ setAppVersion("1.0"); // Placeholder for now, but use revision instead if we use
// the minidump for anything else other than
// collecting the callstack.