Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@10299 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
a7aa810894
commit
7f1af501f2
@ -99,4 +99,3 @@ static BenchRegistry gReg0(Fact0);
|
||||
static BenchRegistry gReg1(Fact1);
|
||||
static BenchRegistry gReg2(Fact2);
|
||||
static BenchRegistry gReg3(Fact3);
|
||||
|
||||
|
@ -9,4 +9,3 @@ PdfContext::PdfContext(SkNativeParsedPDF* doc)
|
||||
PdfContext::~PdfContext() {
|
||||
delete fTmpPageAllocator;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ static void test_surface(SkCanvas* canvas, SkSurface* surf, bool usePaint) {
|
||||
|
||||
SkRect src1, src2, src3;
|
||||
src1.iset(0, 0, surf->width(), surf->height());
|
||||
src2.iset(-surf->width() / 2, -surf->height() / 2,
|
||||
src2.iset(-surf->width() / 2, -surf->height() / 2,
|
||||
surf->width(), surf->height());
|
||||
src3.iset(0, 0, surf->width() / 2, surf->height() / 2);
|
||||
|
||||
|
@ -84,14 +84,14 @@ public:
|
||||
void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*);
|
||||
|
||||
/**
|
||||
* Draw the image, cropped to the src rect, to the dst rect of a canvas.
|
||||
* If src is larger than the bounds of the image, the rest of the image is
|
||||
* filled with transparent black pixels.
|
||||
* Draw the image, cropped to the src rect, to the dst rect of a canvas.
|
||||
* If src is larger than the bounds of the image, the rest of the image is
|
||||
* filled with transparent black pixels.
|
||||
*
|
||||
* See SkCanvas::drawBitmapRectToRect for similar behavior.
|
||||
*/
|
||||
void draw(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint*);
|
||||
|
||||
|
||||
/**
|
||||
* Encode the image's pixels and return the result as a new SkData, which
|
||||
* the caller must manage (i.e. call unref() when they are done).
|
||||
|
@ -145,7 +145,7 @@ void SkBitmapProcState::possiblyScaleImage() {
|
||||
|
||||
SkScalar invScaleX = fInvMatrix.getScaleX();
|
||||
SkScalar invScaleY = fInvMatrix.getScaleY();
|
||||
|
||||
|
||||
SkASSERT(NULL == fScaledCacheID);
|
||||
fScaledCacheID = SkScaledImageCache::FindAndLock(fOrigBitmap,
|
||||
invScaleX, invScaleY,
|
||||
@ -250,7 +250,7 @@ void SkBitmapProcState::endContext() {
|
||||
SkDELETE(fBitmapFilter);
|
||||
fBitmapFilter = NULL;
|
||||
fScaledBitmap.reset();
|
||||
|
||||
|
||||
if (fScaledCacheID) {
|
||||
SkScaledImageCache::Unlock(fScaledCacheID);
|
||||
fScaledCacheID = NULL;
|
||||
|
@ -17,26 +17,26 @@
|
||||
// Implemented from en.wikipedia.org/wiki/MurmurHash.
|
||||
static uint32_t compute_hash(const uint32_t data[], int count) {
|
||||
uint32_t hash = 0;
|
||||
|
||||
|
||||
for (int i = 0; i < count; ++i) {
|
||||
uint32_t k = data[i];
|
||||
k *= 0xcc9e2d51;
|
||||
k = (k << 15) | (k >> 17);
|
||||
k *= 0x1b873593;
|
||||
|
||||
|
||||
hash ^= k;
|
||||
hash = (hash << 13) | (hash >> 19);
|
||||
hash *= 5;
|
||||
hash += 0xe6546b64;
|
||||
}
|
||||
|
||||
|
||||
// hash ^= size;
|
||||
hash ^= hash >> 16;
|
||||
hash *= 0x85ebca6b;
|
||||
hash ^= hash >> 13;
|
||||
hash *= 0xc2b2ae35;
|
||||
hash ^= hash >> 16;
|
||||
|
||||
|
||||
return hash;
|
||||
}
|
||||
#else
|
||||
@ -46,7 +46,7 @@ static uint32_t mix(uint32_t a, uint32_t b) {
|
||||
|
||||
static uint32_t compute_hash(const uint32_t data[], int count) {
|
||||
uint32_t hash = 0;
|
||||
|
||||
|
||||
for (int i = 0; i < count; ++i) {
|
||||
hash = mix(hash, data[i]);
|
||||
}
|
||||
@ -219,7 +219,7 @@ void SkScaledImageCache::unlock(SkScaledImageCache::ID* id) {
|
||||
void SkScaledImageCache::purgeAsNeeded() {
|
||||
size_t byteLimit = fByteLimit;
|
||||
size_t bytesUsed = fBytesUsed;
|
||||
|
||||
|
||||
Rec* rec = fTail;
|
||||
while (rec) {
|
||||
if (bytesUsed < byteLimit) {
|
||||
@ -254,20 +254,20 @@ size_t SkScaledImageCache::setByteLimit(size_t newLimit) {
|
||||
void SkScaledImageCache::detach(Rec* rec) {
|
||||
Rec* prev = rec->fPrev;
|
||||
Rec* next = rec->fNext;
|
||||
|
||||
|
||||
if (!prev) {
|
||||
SkASSERT(fHead == rec);
|
||||
fHead = next;
|
||||
} else {
|
||||
prev->fNext = next;
|
||||
}
|
||||
|
||||
|
||||
if (!next) {
|
||||
fTail = prev;
|
||||
} else {
|
||||
next->fPrev = prev;
|
||||
}
|
||||
|
||||
|
||||
rec->fNext = rec->fPrev = NULL;
|
||||
}
|
||||
|
||||
@ -286,7 +286,7 @@ void SkScaledImageCache::moveToHead(Rec* rec) {
|
||||
fHead->fPrev = rec;
|
||||
rec->fNext = fHead;
|
||||
fHead = rec;
|
||||
|
||||
|
||||
this->validate();
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@ void SkScaledImageCache::validate() const {
|
||||
used -= rec->bytesUsed();
|
||||
rec = rec->fPrev;
|
||||
}
|
||||
|
||||
|
||||
SkASSERT(0 == count);
|
||||
SkASSERT(0 == used);
|
||||
}
|
||||
@ -418,4 +418,3 @@ size_t SkGraphics::GetImageCacheByteLimit() {
|
||||
size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) {
|
||||
return SkScaledImageCache::SetByteLimit(newLimit);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
|
||||
SkScaledImageCache(size_t byteLimit);
|
||||
~SkScaledImageCache();
|
||||
|
||||
|
||||
/**
|
||||
* Search the cache for a scaled version of original. If found, return it
|
||||
* in scaled, and return its ID pointer. Use the returned ptr to unlock
|
||||
@ -74,7 +74,7 @@ public:
|
||||
|
||||
size_t getBytesUsed() const { return fBytesUsed; }
|
||||
size_t getByteLimit() const { return fByteLimit; }
|
||||
|
||||
|
||||
/**
|
||||
* Set the maximum number of bytes available to this cache. If the current
|
||||
* cache exceeds this new value, it will be purged to try to fit within
|
||||
|
@ -143,8 +143,8 @@ void SkImagePrivDrawPicture(SkCanvas* canvas, SkPicture* picture,
|
||||
}
|
||||
|
||||
void SkImagePrivDrawPicture(SkCanvas* canvas, SkPicture* picture,
|
||||
const SkRect* src, const SkRect& dst, const SkPaint* paint) {
|
||||
int saveCount = canvas->getSaveCount();
|
||||
const SkRect* src, const SkRect& dst, const SkPaint* paint) {
|
||||
int saveCount = canvas->getSaveCount();
|
||||
|
||||
SkMatrix matrix;
|
||||
SkRect tmpSrc;
|
||||
@ -167,7 +167,7 @@ void SkImagePrivDrawPicture(SkCanvas* canvas, SkPicture* picture,
|
||||
if (!paint || !needs_layer(*paint)) {
|
||||
canvas->clipRect(tmpSrc);
|
||||
}
|
||||
|
||||
|
||||
canvas->drawPicture(*picture);
|
||||
canvas->restoreToCount(saveCount);
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ public:
|
||||
SkImage_Base(int width, int height) : INHERITED(width, height) {}
|
||||
|
||||
virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) = 0;
|
||||
virtual void onDrawRectToRect(SkCanvas*, const SkRect* src,
|
||||
virtual void onDrawRectToRect(SkCanvas*, const SkRect* src,
|
||||
const SkRect& dst, const SkPaint*) = 0;
|
||||
virtual GrTexture* onGetTexture() { return NULL; }
|
||||
|
||||
|
@ -49,7 +49,7 @@ void SkImage_Codec::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPai
|
||||
canvas->drawBitmap(fBitmap, x, y, paint);
|
||||
}
|
||||
|
||||
void SkImage_Codec::onDrawRectToRect(SkCanvas* canvas, const SkRect* src,
|
||||
void SkImage_Codec::onDrawRectToRect(SkCanvas* canvas, const SkRect* src,
|
||||
const SkRect& dst, const SkPaint* paint) {
|
||||
if (!fBitmap.pixelRef()) {
|
||||
if (!SkImageDecoder::DecodeMemory(fEncodedData->bytes(), fEncodedData->size(),
|
||||
|
@ -21,7 +21,7 @@ static void TestImageCache(skiatest::Reporter* reporter) {
|
||||
SkScaledImageCache::ID* id;
|
||||
|
||||
SkBitmap bm[COUNT];
|
||||
|
||||
|
||||
SkScalar scale = 2;
|
||||
for (int i = 0; i < COUNT; ++i) {
|
||||
SkBitmap tmp;
|
||||
@ -49,12 +49,12 @@ static void TestImageCache(skiatest::Reporter* reporter) {
|
||||
// stress test, should trigger purges
|
||||
for (size_t i = 0; i < COUNT * 100; ++i) {
|
||||
SkBitmap tmp;
|
||||
|
||||
|
||||
make_bm(&tmp, DIM, DIM);
|
||||
id = cache.addAndLock(bm[0], scale, scale, tmp);
|
||||
REPORTER_ASSERT(reporter, NULL != id);
|
||||
cache.unlock(id);
|
||||
|
||||
|
||||
scale += 1;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ class FakeDevice : public SkDevice {
|
||||
public:
|
||||
FakeDevice() : SkDevice(SkBitmap::kARGB_8888_Config, 100, 100) { }
|
||||
|
||||
virtual void drawRect(const SkDraw& draw, const SkRect& r,
|
||||
virtual void drawRect(const SkDraw& draw, const SkRect& r,
|
||||
const SkPaint& paint) SK_OVERRIDE {
|
||||
fLastMatrix = *draw.fMatrix;
|
||||
SkDevice::drawRect(draw, r, paint);
|
||||
|
@ -163,17 +163,17 @@ static const SkDCubic testSet[] = {
|
||||
const size_t testSetCount = SK_ARRAY_COUNT(testSet);
|
||||
|
||||
static const SkDCubic newTestSet[] = {
|
||||
{{{3, 4}, {1, 5}, {4, 3}, {6, 4}}},
|
||||
{{{3, 4}, {4, 6}, {4, 3}, {5, 1}}},
|
||||
{{{3, 4}, {1, 5}, {4, 3}, {6, 4}}},
|
||||
{{{3, 4}, {4, 6}, {4, 3}, {5, 1}}},
|
||||
|
||||
{{{130.04275512695312, 11417.413085937500 },
|
||||
{130.23312377929687, 11418.319335937500 },
|
||||
{131.03707885742187, 11419.000000000000 },
|
||||
{132.00000000000000, 11419.000000000000 }}},
|
||||
|
||||
{{{132.00000000000000, 11419.000000000000 },
|
||||
{130.89543151855469, 11419.000000000000 },
|
||||
{130.00000000000000, 11418.104492187500 },
|
||||
{{{130.04275512695312, 11417.413085937500 },
|
||||
{130.23312377929687, 11418.319335937500 },
|
||||
{131.03707885742187, 11419.000000000000 },
|
||||
{132.00000000000000, 11419.000000000000 }}},
|
||||
|
||||
{{{132.00000000000000, 11419.000000000000 },
|
||||
{130.89543151855469, 11419.000000000000 },
|
||||
{130.00000000000000, 11418.104492187500 },
|
||||
{130.00000000000000, 11417.000000000000 }}},
|
||||
|
||||
{{{1.0516976506771041, 2.9684399028541346 },
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
// FIXME: add tests for intersecting, non-intersecting, degenerate, coincident
|
||||
static const SkDLine tests[][2] = {
|
||||
{{{{181.1764678955078125f, 120}, {186.3661956787109375f, 134.7042236328125f}}},
|
||||
{{{{181.1764678955078125f, 120}, {186.3661956787109375f, 134.7042236328125f}}},
|
||||
{{{175.8309783935546875f, 141.5211334228515625f}, {187.8782806396484375f, 133.7258148193359375f}}}},
|
||||
#if 0 // FIXME: these fail because one line is too short and appears quasi-coincident
|
||||
{{{{158.000000, 926.000000}, {1108.00000, 926.000000}}},
|
||||
@ -43,7 +43,7 @@ static const SkDLine noIntersect[][2] = {
|
||||
static const size_t noIntersect_count = SK_ARRAY_COUNT(noIntersect);
|
||||
|
||||
static const SkDLine coincidentTests[][2] = {
|
||||
{{{{186.3661956787109375f, 134.7042236328125f}, {187.8782806396484375f, 133.7258148193359375f}}},
|
||||
{{{{186.3661956787109375f, 134.7042236328125f}, {187.8782806396484375f, 133.7258148193359375f}}},
|
||||
{{{175.8309783935546875f, 141.5211334228515625f}, {187.8782806396484375f, 133.7258148193359375f}}}},
|
||||
|
||||
{{{{235.681549, 531.000000}, {280.318420, 321.000000}}},
|
||||
|
@ -1836,181 +1836,181 @@ static void skpkkiste_to98(skiatest::Reporter* reporter) {
|
||||
|
||||
#if 01
|
||||
static void issue1417(skiatest::Reporter* reporter) {
|
||||
SkPath path1;
|
||||
path1.moveTo(122.58908843994140625f, 82.2836456298828125f);
|
||||
path1.quadTo(129.8215789794921875f, 80, 138, 80);
|
||||
path1.quadTo(147.15692138671875f, 80, 155.1280364990234375f, 82.86279296875f);
|
||||
path1.lineTo(161.1764678955078125f, 100);
|
||||
path1.lineTo(161.1764678955078125f, 100);
|
||||
path1.lineTo(115.29412078857421875f, 100);
|
||||
path1.lineTo(115.29412078857421875f, 100);
|
||||
path1.lineTo(122.58908843994140625f, 82.2836456298828125f);
|
||||
path1.lineTo(122.58908843994140625f, 82.2836456298828125f);
|
||||
path1.close();
|
||||
path1.moveTo(98.68194580078125f, 140.343841552734375f);
|
||||
path1.lineTo(115.29412078857421875f, 100);
|
||||
path1.lineTo(115.29412078857421875f, 100);
|
||||
path1.lineTo(97.9337615966796875f, 100);
|
||||
path1.lineTo(97.9337615966796875f, 100);
|
||||
path1.quadTo(88, 112.94264984130859375f, 88, 130);
|
||||
path1.quadTo(88, 131.544830322265625f, 88.08148956298828125f, 133.0560302734375f);
|
||||
path1.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path1.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path1.close();
|
||||
path1.moveTo(136.969696044921875f, 166.6666717529296875f);
|
||||
path1.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path1.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path1.lineTo(93.45894622802734375f, 153.02825927734375f);
|
||||
path1.lineTo(93.45894622802734375f, 153.02825927734375f);
|
||||
path1.quadTo(96.94116973876953125f, 159.65185546875f, 102.64466094970703125f, 165.3553466796875f);
|
||||
path1.quadTo(110.7924652099609375f, 173.503143310546875f, 120.8179779052734375f, 177.1177825927734375f);
|
||||
path1.lineTo(136.969696044921875f, 166.6666717529296875f);
|
||||
path1.lineTo(136.969696044921875f, 166.6666717529296875f);
|
||||
path1.close();
|
||||
path1.moveTo(175.8309783935546875f, 141.5211334228515625f);
|
||||
path1.lineTo(136.969696044921875f, 166.6666717529296875f);
|
||||
path1.lineTo(136.969696044921875f, 166.6666717529296875f);
|
||||
path1.lineTo(153.15728759765625f, 177.7956390380859375f);
|
||||
path1.lineTo(153.15728759765625f, 177.7956390380859375f);
|
||||
path1.quadTo(164.392425537109375f, 174.318267822265625f, 173.3553466796875f, 165.3553466796875f);
|
||||
path1.quadTo(177.805816650390625f, 160.9048614501953125f, 180.90380859375f, 155.8941650390625f);
|
||||
path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
|
||||
path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
|
||||
path1.close();
|
||||
path1.moveTo(175.8309783935546875f, 141.5211334228515625f);
|
||||
path1.lineTo(187.8782806396484375f, 133.7258148193359375f);
|
||||
path1.lineTo(187.8782806396484375f, 133.7258148193359375f);
|
||||
path1.quadTo(188, 131.8880615234375f, 188, 130);
|
||||
path1.quadTo(188, 112.942657470703125f, 178.0662384033203125f, 100);
|
||||
path1.lineTo(161.1764678955078125f, 100);
|
||||
path1.lineTo(161.1764678955078125f, 100);
|
||||
path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
|
||||
path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
|
||||
path1.close();
|
||||
|
||||
SkPath path2;
|
||||
path2.moveTo(174.117645263671875f, 100);
|
||||
path2.lineTo(161.1764678955078125f, 100);
|
||||
path2.lineTo(161.1764678955078125f, 100);
|
||||
path2.lineTo(155.1280364990234375f, 82.86279296875f);
|
||||
path2.lineTo(155.1280364990234375f, 82.86279296875f);
|
||||
path2.quadTo(153.14971923828125f, 82.15229034423828125f, 151.098419189453125f, 81.618133544921875f);
|
||||
path2.lineTo(143.5294189453125f, 100);
|
||||
path2.lineTo(143.5294189453125f, 100);
|
||||
path2.lineTo(161.1764678955078125f, 100);
|
||||
path2.lineTo(161.1764678955078125f, 100);
|
||||
path2.lineTo(168.23529052734375f, 120);
|
||||
path2.lineTo(168.23529052734375f, 120);
|
||||
path2.lineTo(181.1764678955078125f, 120);
|
||||
path2.lineTo(181.1764678955078125f, 120);
|
||||
path2.lineTo(186.3661956787109375f, 134.7042236328125f);
|
||||
path2.lineTo(186.3661956787109375f, 134.7042236328125f);
|
||||
path2.lineTo(187.8782806396484375f, 133.7258148193359375f);
|
||||
path2.lineTo(187.8782806396484375f, 133.7258148193359375f);
|
||||
path2.quadTo(188, 131.8880615234375f, 188, 130);
|
||||
path2.quadTo(188, 124.80947113037109375f, 187.080169677734375f, 120);
|
||||
path2.lineTo(181.1764678955078125f, 120);
|
||||
path2.lineTo(181.1764678955078125f, 120);
|
||||
path2.lineTo(174.117645263671875f, 100);
|
||||
path2.lineTo(174.117645263671875f, 100);
|
||||
path2.close();
|
||||
path2.moveTo(88.91983795166015625f, 120);
|
||||
path2.lineTo(107.0588226318359375f, 120);
|
||||
path2.lineTo(107.0588226318359375f, 120);
|
||||
path2.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path2.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path2.lineTo(88.08148956298828125f, 133.0560302734375f);
|
||||
path2.lineTo(88.08148956298828125f, 133.0560302734375f);
|
||||
path2.quadTo(88, 131.544830322265625f, 88, 130);
|
||||
path2.quadTo(88, 124.80951690673828125f, 88.91983795166015625f, 120);
|
||||
path2.close();
|
||||
path2.moveTo(96.67621612548828125f, 145.21490478515625f);
|
||||
path2.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path2.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path2.lineTo(120.68767547607421875f, 155.4727783203125f);
|
||||
path2.lineTo(120.68767547607421875f, 155.4727783203125f);
|
||||
path2.lineTo(118.68194580078125f, 160.343841552734375f);
|
||||
path2.lineTo(118.68194580078125f, 160.343841552734375f);
|
||||
path2.lineTo(96.67621612548828125f, 145.21490478515625f);
|
||||
path2.lineTo(96.67621612548828125f, 145.21490478515625f);
|
||||
path2.close();
|
||||
path2.moveTo(113.232177734375f, 173.5789947509765625f);
|
||||
path2.quadTo(116.8802642822265625f, 175.69805908203125f, 120.8179779052734375f, 177.1177825927734375f);
|
||||
path2.lineTo(132.2864990234375f, 169.6969757080078125f);
|
||||
path2.lineTo(132.2864990234375f, 169.6969757080078125f);
|
||||
path2.lineTo(118.68194580078125f, 160.343841552734375f);
|
||||
path2.lineTo(118.68194580078125f, 160.343841552734375f);
|
||||
path2.lineTo(113.232177734375f, 173.5789947509765625f);
|
||||
path2.lineTo(113.232177734375f, 173.5789947509765625f);
|
||||
path2.close();
|
||||
SkPath path1;
|
||||
path1.moveTo(122.58908843994140625f, 82.2836456298828125f);
|
||||
path1.quadTo(129.8215789794921875f, 80, 138, 80);
|
||||
path1.quadTo(147.15692138671875f, 80, 155.1280364990234375f, 82.86279296875f);
|
||||
path1.lineTo(161.1764678955078125f, 100);
|
||||
path1.lineTo(161.1764678955078125f, 100);
|
||||
path1.lineTo(115.29412078857421875f, 100);
|
||||
path1.lineTo(115.29412078857421875f, 100);
|
||||
path1.lineTo(122.58908843994140625f, 82.2836456298828125f);
|
||||
path1.lineTo(122.58908843994140625f, 82.2836456298828125f);
|
||||
path1.close();
|
||||
path1.moveTo(98.68194580078125f, 140.343841552734375f);
|
||||
path1.lineTo(115.29412078857421875f, 100);
|
||||
path1.lineTo(115.29412078857421875f, 100);
|
||||
path1.lineTo(97.9337615966796875f, 100);
|
||||
path1.lineTo(97.9337615966796875f, 100);
|
||||
path1.quadTo(88, 112.94264984130859375f, 88, 130);
|
||||
path1.quadTo(88, 131.544830322265625f, 88.08148956298828125f, 133.0560302734375f);
|
||||
path1.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path1.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path1.close();
|
||||
path1.moveTo(136.969696044921875f, 166.6666717529296875f);
|
||||
path1.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path1.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path1.lineTo(93.45894622802734375f, 153.02825927734375f);
|
||||
path1.lineTo(93.45894622802734375f, 153.02825927734375f);
|
||||
path1.quadTo(96.94116973876953125f, 159.65185546875f, 102.64466094970703125f, 165.3553466796875f);
|
||||
path1.quadTo(110.7924652099609375f, 173.503143310546875f, 120.8179779052734375f, 177.1177825927734375f);
|
||||
path1.lineTo(136.969696044921875f, 166.6666717529296875f);
|
||||
path1.lineTo(136.969696044921875f, 166.6666717529296875f);
|
||||
path1.close();
|
||||
path1.moveTo(175.8309783935546875f, 141.5211334228515625f);
|
||||
path1.lineTo(136.969696044921875f, 166.6666717529296875f);
|
||||
path1.lineTo(136.969696044921875f, 166.6666717529296875f);
|
||||
path1.lineTo(153.15728759765625f, 177.7956390380859375f);
|
||||
path1.lineTo(153.15728759765625f, 177.7956390380859375f);
|
||||
path1.quadTo(164.392425537109375f, 174.318267822265625f, 173.3553466796875f, 165.3553466796875f);
|
||||
path1.quadTo(177.805816650390625f, 160.9048614501953125f, 180.90380859375f, 155.8941650390625f);
|
||||
path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
|
||||
path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
|
||||
path1.close();
|
||||
path1.moveTo(175.8309783935546875f, 141.5211334228515625f);
|
||||
path1.lineTo(187.8782806396484375f, 133.7258148193359375f);
|
||||
path1.lineTo(187.8782806396484375f, 133.7258148193359375f);
|
||||
path1.quadTo(188, 131.8880615234375f, 188, 130);
|
||||
path1.quadTo(188, 112.942657470703125f, 178.0662384033203125f, 100);
|
||||
path1.lineTo(161.1764678955078125f, 100);
|
||||
path1.lineTo(161.1764678955078125f, 100);
|
||||
path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
|
||||
path1.lineTo(175.8309783935546875f, 141.5211334228515625f);
|
||||
path1.close();
|
||||
|
||||
SkPath path2;
|
||||
path2.moveTo(174.117645263671875f, 100);
|
||||
path2.lineTo(161.1764678955078125f, 100);
|
||||
path2.lineTo(161.1764678955078125f, 100);
|
||||
path2.lineTo(155.1280364990234375f, 82.86279296875f);
|
||||
path2.lineTo(155.1280364990234375f, 82.86279296875f);
|
||||
path2.quadTo(153.14971923828125f, 82.15229034423828125f, 151.098419189453125f, 81.618133544921875f);
|
||||
path2.lineTo(143.5294189453125f, 100);
|
||||
path2.lineTo(143.5294189453125f, 100);
|
||||
path2.lineTo(161.1764678955078125f, 100);
|
||||
path2.lineTo(161.1764678955078125f, 100);
|
||||
path2.lineTo(168.23529052734375f, 120);
|
||||
path2.lineTo(168.23529052734375f, 120);
|
||||
path2.lineTo(181.1764678955078125f, 120);
|
||||
path2.lineTo(181.1764678955078125f, 120);
|
||||
path2.lineTo(186.3661956787109375f, 134.7042236328125f);
|
||||
path2.lineTo(186.3661956787109375f, 134.7042236328125f);
|
||||
path2.lineTo(187.8782806396484375f, 133.7258148193359375f);
|
||||
path2.lineTo(187.8782806396484375f, 133.7258148193359375f);
|
||||
path2.quadTo(188, 131.8880615234375f, 188, 130);
|
||||
path2.quadTo(188, 124.80947113037109375f, 187.080169677734375f, 120);
|
||||
path2.lineTo(181.1764678955078125f, 120);
|
||||
path2.lineTo(181.1764678955078125f, 120);
|
||||
path2.lineTo(174.117645263671875f, 100);
|
||||
path2.lineTo(174.117645263671875f, 100);
|
||||
path2.close();
|
||||
path2.moveTo(88.91983795166015625f, 120);
|
||||
path2.lineTo(107.0588226318359375f, 120);
|
||||
path2.lineTo(107.0588226318359375f, 120);
|
||||
path2.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path2.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path2.lineTo(88.08148956298828125f, 133.0560302734375f);
|
||||
path2.lineTo(88.08148956298828125f, 133.0560302734375f);
|
||||
path2.quadTo(88, 131.544830322265625f, 88, 130);
|
||||
path2.quadTo(88, 124.80951690673828125f, 88.91983795166015625f, 120);
|
||||
path2.close();
|
||||
path2.moveTo(96.67621612548828125f, 145.21490478515625f);
|
||||
path2.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path2.lineTo(98.68194580078125f, 140.343841552734375f);
|
||||
path2.lineTo(120.68767547607421875f, 155.4727783203125f);
|
||||
path2.lineTo(120.68767547607421875f, 155.4727783203125f);
|
||||
path2.lineTo(118.68194580078125f, 160.343841552734375f);
|
||||
path2.lineTo(118.68194580078125f, 160.343841552734375f);
|
||||
path2.lineTo(96.67621612548828125f, 145.21490478515625f);
|
||||
path2.lineTo(96.67621612548828125f, 145.21490478515625f);
|
||||
path2.close();
|
||||
path2.moveTo(113.232177734375f, 173.5789947509765625f);
|
||||
path2.quadTo(116.8802642822265625f, 175.69805908203125f, 120.8179779052734375f, 177.1177825927734375f);
|
||||
path2.lineTo(132.2864990234375f, 169.6969757080078125f);
|
||||
path2.lineTo(132.2864990234375f, 169.6969757080078125f);
|
||||
path2.lineTo(118.68194580078125f, 160.343841552734375f);
|
||||
path2.lineTo(118.68194580078125f, 160.343841552734375f);
|
||||
path2.lineTo(113.232177734375f, 173.5789947509765625f);
|
||||
path2.lineTo(113.232177734375f, 173.5789947509765625f);
|
||||
path2.close();
|
||||
|
||||
testPathOp(reporter, path1, path2, kUnion_PathOp);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void issue1418(skiatest::Reporter* reporter) {
|
||||
SkPath path1;
|
||||
path1.moveTo(0, 0);
|
||||
path1.lineTo(1, 0);
|
||||
path1.lineTo(1, 0);
|
||||
path1.lineTo(1, 1);
|
||||
path1.lineTo(1, 1);
|
||||
path1.lineTo(0, 1);
|
||||
path1.lineTo(0, 1);
|
||||
path1.lineTo(0, 0);
|
||||
path1.lineTo(0, 0);
|
||||
path1.close();
|
||||
|
||||
SkPath path2;
|
||||
path2.moveTo(0.64644664525985717773f, -0.35355341434478759766f);
|
||||
path2.quadTo(0.79289329051971435547f, -0.50000005960464477539f, 1.0000001192092895508f, -0.50000005960464477539f);
|
||||
path2.quadTo(1.2071068286895751953f, -0.50000005960464477539f, 1.3535535335540771484f, -0.35355341434478759766f);
|
||||
path2.quadTo(1.5000001192092895508f, -0.20710679888725280762f, 1.5000001192092895508f, 0);
|
||||
path2.quadTo(1.5000001192092895508f, 0.20710679888725280762f, 1.3535535335540771484f, 0.35355341434478759766f);
|
||||
path2.quadTo(1.2071068286895751953f, 0.50000005960464477539f, 1.0000001192092895508f, 0.50000005960464477539f);
|
||||
path2.quadTo(0.79289329051971435547f, 0.50000005960464477539f, 0.64644664525985717773f, 0.35355341434478759766f);
|
||||
path2.quadTo(0.50000005960464477539f, 0.20710679888725280762f, 0.50000005960464477539f, 0);
|
||||
SkPath path1;
|
||||
path1.moveTo(0, 0);
|
||||
path1.lineTo(1, 0);
|
||||
path1.lineTo(1, 0);
|
||||
path1.lineTo(1, 1);
|
||||
path1.lineTo(1, 1);
|
||||
path1.lineTo(0, 1);
|
||||
path1.lineTo(0, 1);
|
||||
path1.lineTo(0, 0);
|
||||
path1.lineTo(0, 0);
|
||||
path1.close();
|
||||
|
||||
SkPath path2;
|
||||
path2.moveTo(0.64644664525985717773f, -0.35355341434478759766f);
|
||||
path2.quadTo(0.79289329051971435547f, -0.50000005960464477539f, 1.0000001192092895508f, -0.50000005960464477539f);
|
||||
path2.quadTo(1.2071068286895751953f, -0.50000005960464477539f, 1.3535535335540771484f, -0.35355341434478759766f);
|
||||
path2.quadTo(1.5000001192092895508f, -0.20710679888725280762f, 1.5000001192092895508f, 0);
|
||||
path2.quadTo(1.5000001192092895508f, 0.20710679888725280762f, 1.3535535335540771484f, 0.35355341434478759766f);
|
||||
path2.quadTo(1.2071068286895751953f, 0.50000005960464477539f, 1.0000001192092895508f, 0.50000005960464477539f);
|
||||
path2.quadTo(0.79289329051971435547f, 0.50000005960464477539f, 0.64644664525985717773f, 0.35355341434478759766f);
|
||||
path2.quadTo(0.50000005960464477539f, 0.20710679888725280762f, 0.50000005960464477539f, 0);
|
||||
path2.quadTo(0.50000005960464477539f, -0.20710679888725280762f, 0.64644664525985717773f, -0.35355341434478759766f);
|
||||
testPathOp(reporter, path1, path2, kIntersect_PathOp);
|
||||
}
|
||||
|
||||
static void cubicOp85i(skiatest::Reporter* reporter) {
|
||||
SkPath path, pathB;
|
||||
path.setFillType(SkPath::kWinding_FillType);
|
||||
path.moveTo(3, 4);
|
||||
path.cubicTo(1, 5, 4, 3, 6, 4);
|
||||
path.close();
|
||||
pathB.setFillType(SkPath::kWinding_FillType);
|
||||
pathB.moveTo(3, 4);
|
||||
pathB.cubicTo(4, 6, 4, 3, 5, 1);
|
||||
pathB.close();
|
||||
testPathOp(reporter, path, pathB, kIntersect_PathOp);
|
||||
static void cubicOp85i(skiatest::Reporter* reporter) {
|
||||
SkPath path, pathB;
|
||||
path.setFillType(SkPath::kWinding_FillType);
|
||||
path.moveTo(3, 4);
|
||||
path.cubicTo(1, 5, 4, 3, 6, 4);
|
||||
path.close();
|
||||
pathB.setFillType(SkPath::kWinding_FillType);
|
||||
pathB.moveTo(3, 4);
|
||||
pathB.cubicTo(4, 6, 4, 3, 5, 1);
|
||||
pathB.close();
|
||||
testPathOp(reporter, path, pathB, kIntersect_PathOp);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void skpkkiste_to716(skiatest::Reporter* reporter) {
|
||||
SkPath path;
|
||||
path.setFillType(SkPath::kEvenOdd_FillType);
|
||||
path.moveTo(1173, 284);
|
||||
path.cubicTo(1173, 285.125824f, 1173.37207f, 286.164734f, 1174, 287.000488f);
|
||||
path.lineTo(1174, 123.999496f);
|
||||
path.cubicTo(1173.37207f, 124.835243f, 1173, 125.874168f, 1173, 127);
|
||||
path.lineTo(1173, 284);
|
||||
path.close();
|
||||
SkPath pathB;
|
||||
pathB.setFillType(SkPath::kWinding_FillType);
|
||||
pathB.moveTo(1340, 122);
|
||||
pathB.cubicTo(1342.76147f, 122, 1345, 124.238579f, 1345, 127);
|
||||
pathB.lineTo(1345, 284);
|
||||
pathB.cubicTo(1345, 286.761414f, 1342.76147f, 289, 1340, 289);
|
||||
pathB.lineTo(1178, 289);
|
||||
pathB.cubicTo(1175.23853f, 289, 1173, 286.761414f, 1173, 284);
|
||||
pathB.lineTo(1173, 127);
|
||||
pathB.cubicTo(1173, 124.238579f, 1175.23853f, 122, 1178, 122);
|
||||
pathB.lineTo(1340, 122);
|
||||
pathB.close();
|
||||
testPathOp(reporter, path, pathB, kIntersect_PathOp);
|
||||
}
|
||||
static void skpkkiste_to716(skiatest::Reporter* reporter) {
|
||||
SkPath path;
|
||||
path.setFillType(SkPath::kEvenOdd_FillType);
|
||||
path.moveTo(1173, 284);
|
||||
path.cubicTo(1173, 285.125824f, 1173.37207f, 286.164734f, 1174, 287.000488f);
|
||||
path.lineTo(1174, 123.999496f);
|
||||
path.cubicTo(1173.37207f, 124.835243f, 1173, 125.874168f, 1173, 127);
|
||||
path.lineTo(1173, 284);
|
||||
path.close();
|
||||
SkPath pathB;
|
||||
pathB.setFillType(SkPath::kWinding_FillType);
|
||||
pathB.moveTo(1340, 122);
|
||||
pathB.cubicTo(1342.76147f, 122, 1345, 124.238579f, 1345, 127);
|
||||
pathB.lineTo(1345, 284);
|
||||
pathB.cubicTo(1345, 286.761414f, 1342.76147f, 289, 1340, 289);
|
||||
pathB.lineTo(1178, 289);
|
||||
pathB.cubicTo(1175.23853f, 289, 1173, 286.761414f, 1173, 284);
|
||||
pathB.lineTo(1173, 127);
|
||||
pathB.cubicTo(1173, 124.238579f, 1175.23853f, 122, 1178, 122);
|
||||
pathB.lineTo(1340, 122);
|
||||
pathB.close();
|
||||
testPathOp(reporter, path, pathB, kIntersect_PathOp);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void (*firstTest)(skiatest::Reporter* ) = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user