Remove ableist language
Change-Id: Ie9ef50a14906c9350adbe16720291dca944ad7fc Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418738 Commit-Queue: Kevin Lubick <kjlubick@google.com> Reviewed-by: John Stiles <johnstiles@google.com> Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
This commit is contained in:
parent
5837aad590
commit
be03ef1565
@ -255,9 +255,9 @@ sk_sp<SkImage> SkVideoDecoder::convertFrame(const AVFrame* frame) {
|
||||
}
|
||||
|
||||
sk_sp<SkImage> SkVideoDecoder::nextImage(double* timeStamp) {
|
||||
double dummyTimeStampStorage = 0;
|
||||
double defaultTimeStampStorage = 0;
|
||||
if (!timeStamp) {
|
||||
timeStamp = &dummyTimeStampStorage;
|
||||
timeStamp = &defaultTimeStampStorage;
|
||||
}
|
||||
|
||||
if (fFormatCtx == nullptr) {
|
||||
|
@ -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);
|
||||
|
@ -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<SkShader> make_radial() {
|
||||
SkPoint pts[2] = {
|
||||
|
@ -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<SkShader> MakeRadial() {
|
||||
SkPoint pts[2] = {
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include <utility>
|
||||
|
||||
/*
|
||||
* 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<SkShader> MakeLinear() {
|
||||
constexpr SkPoint kPts[] = { { 0, 0 }, { 32, 32 } };
|
||||
|
@ -105,7 +105,7 @@ public:
|
||||
* SkData. Suitable for with const globals.
|
||||
*/
|
||||
static sk_sp<SkData> 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<SkData> PrivateNewWithCopy(const void* srcOrNull, size_t length);
|
||||
|
||||
static void DummyReleaseProc(const void*, void*); // {}
|
||||
static void NoopReleaseProc(const void*, void*); // {}
|
||||
|
||||
using INHERITED = SkRefCnt;
|
||||
};
|
||||
|
@ -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.
|
||||
|
@ -78,7 +78,7 @@ private:
|
||||
#endif
|
||||
|
||||
union {
|
||||
char fDummy;
|
||||
char fPlaceholder;
|
||||
#ifdef SK_VULKAN
|
||||
GrVkSharedImageInfo fVkState;
|
||||
#endif
|
||||
|
@ -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
|
||||
|
@ -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<SkTypeface> test_font) : fTestFont(test_font) {}
|
||||
FakeFontMgr(sk_sp<SkTypeface> 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<SkTypeface> fTestFont;
|
||||
};
|
||||
|
||||
sk_sp<DummyFontMgr> test_font_manager = sk_make_sp<DummyFontMgr>(test_typeface);
|
||||
sk_sp<FakeFontMgr> test_font_manager = sk_make_sp<FakeFontMgr>(test_typeface);
|
||||
SkMemoryStream stream(json, strlen(json));
|
||||
auto observer = sk_make_sp<TestPropertyObserver>();
|
||||
|
||||
|
@ -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,
|
||||
|
@ -157,11 +157,11 @@ std::unique_ptr<SkCodec> SkIcoCodec::MakeFromStream(std::unique_ptr<SkStream> st
|
||||
|
||||
// Check if the embedded codec is bmp or png and create the codec
|
||||
std::unique_ptr<SkCodec> 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) {
|
||||
|
@ -98,10 +98,10 @@ SkPMColor4f SkColorFilterBase::onFilterColor4f(const SkPMColor4f& color,
|
||||
SkSTArenaAlloc<kEnoughForCommonFilters> 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)) {
|
||||
|
@ -81,7 +81,7 @@ sk_sp<SkData> SkData::PrivateNewWithCopy(const void* srcOrNull, size_t length) {
|
||||
return data;
|
||||
}
|
||||
|
||||
void SkData::DummyReleaseProc(const void*, void*) {}
|
||||
void SkData::NoopReleaseProc(const void*, void*) {}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -385,7 +385,7 @@ sk_sp<SkImage> 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<SkImage> SkReadBuffer::readImage() {
|
||||
if (this->isVersionLT(SkPicturePriv::kSerializeMipmaps_Version)) {
|
||||
return this->readImage_preV78();
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -78,7 +78,7 @@ static std::unique_ptr<GrFragmentProcessor> 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]);
|
||||
|
@ -42,17 +42,17 @@ private:
|
||||
}
|
||||
void onBindBuffers(sk_sp<const GrBuffer> indexBuffer, sk_sp<const GrBuffer> instanceBuffer,
|
||||
sk_sp<const GrBuffer> 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<float, 4>) override {
|
||||
this->markRenderTargetDirty();
|
||||
}
|
||||
void onClearStencilClip(const GrScissorState& scissor, bool insideStencilMask) override {}
|
||||
void dummyDraw() {
|
||||
void noopDraw() {
|
||||
this->markRenderTargetDirty();
|
||||
++fNumDraws;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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<SkOpPtT*>(runs[pIndex]);
|
||||
SkPath dummy;
|
||||
SkPathWriter partWriter(dummy);
|
||||
SkPath p;
|
||||
SkPathWriter partWriter(p);
|
||||
do {
|
||||
if (!zero_or_one(opPtT->fT)) {
|
||||
break;
|
||||
|
@ -1722,7 +1722,7 @@ std::unique_ptr<SkAdvancedTypefaceMetrics> 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)
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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<float>(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.
|
||||
|
@ -2016,10 +2016,10 @@ std::unique_ptr<SPIRVCodeGenerator::LValue> 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,
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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<SkPromiseImageTexture> dummy_fulfill_proc(void*) {
|
||||
static sk_sp<SkPromiseImageTexture> 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) {
|
||||
|
@ -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<GrDrawOpAtlas> atlas = GrDrawOpAtlas::Make(
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -328,22 +328,22 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrMeshTest, reporter, ctxInfo) {
|
||||
GrDrawIndexedIndirectWriter indexedIndirectWriter;
|
||||
if (indexed) {
|
||||
// Make helper->fDrawIndirectBufferOffset nonzero.
|
||||
sk_sp<const GrBuffer> dummyBuff;
|
||||
size_t dummyOffset;
|
||||
sk_sp<const GrBuffer> 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<const GrBuffer> dummyBuff;
|
||||
size_t dummyOffset;
|
||||
sk_sp<const GrBuffer> 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);
|
||||
|
@ -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;
|
||||
|
@ -39,8 +39,6 @@
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
|
||||
#define DUMMY_TEXT "DCT compessed stream."
|
||||
|
||||
template <typename T>
|
||||
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<DummyImageFilter> Make(bool visited = false) {
|
||||
return sk_sp<DummyImageFilter>(new DummyImageFilter(visited));
|
||||
static sk_sp<TestImageFilter> Make(bool visited = false) {
|
||||
return sk_sp<TestImageFilter>(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<SkFlattenable> DummyImageFilter::CreateProc(SkReadBuffer& buffer) {
|
||||
sk_sp<SkFlattenable> 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<DummyImageFilter> filter(DummyImageFilter::Make());
|
||||
sk_sp<TestImageFilter> filter(TestImageFilter::Make());
|
||||
|
||||
// Filter just created; should be unvisited.
|
||||
REPORTER_ASSERT(reporter, !filter->visited());
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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 <memory>
|
||||
|
||||
@ -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<Op>(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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -160,8 +160,8 @@ bool ComparePixels(const GrCPixmap& a,
|
||||
const float tolRGBA[4],
|
||||
std::function<ComparePixmapsErrorReporter>& 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user