Sanitizing source files in Housekeeper-Nightly

git-svn-id: http://skia.googlecode.com/svn/trunk@9051 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
skia.committer@gmail.com 2013-05-08 07:01:40 +00:00
parent 6862cbad08
commit 2b34fe01d7
7 changed files with 72 additions and 73 deletions

View File

@ -23,7 +23,7 @@ class SkData;
* bytes, they may return fewer than N bytes on a given call, in which case
* the caller can "try again" to get more bytes, eventually (modulo an error)
* receiving their total N bytes.
*
*
* Skia streams behave differently. They are effectively synchronous, and will
* always return all N bytes of the request if possible. If they return fewer
* (the read() call returns the number of bytes read) then that means there is

View File

@ -1662,4 +1662,3 @@ void SkConic::computeTightBounds(SkRect* bounds) const {
void SkConic::computeFastBounds(SkRect* bounds) const {
bounds->set(fPts, 3);
}

View File

@ -141,7 +141,7 @@ bool SkOpAngle::operator<(const SkOpAngle& rh) const {
SkDVector dxy = loc - ray[0];
double dist = dxy.lengthSquared();
#if DEBUG_SORT
SkDebugf("best=%1.9g dist=%1.9g loc={%1.9g,%1.9g} dxy={%1.9g,%1.9g}\n",
SkDebugf("best=%1.9g dist=%1.9g loc={%1.9g,%1.9g} dxy={%1.9g,%1.9g}\n",
best, dist, loc.fX, loc.fY, dxy.fX, dxy.fY);
#endif
if (best > dist) {
@ -156,7 +156,7 @@ bool SkOpAngle::operator<(const SkOpAngle& rh) const {
SkDVector dxy = rLoc - ray[0];
double dist = dxy.lengthSquared();
#if DEBUG_SORT
SkDebugf("best=%1.9g dist=%1.9g %c=(fSide < 0) rLoc={%1.9g,%1.9g} dxy={%1.9g,%1.9g}\n",
SkDebugf("best=%1.9g dist=%1.9g %c=(fSide < 0) rLoc={%1.9g,%1.9g} dxy={%1.9g,%1.9g}\n",
best, dist, "><"[fSide < 0], rLoc.fX, rLoc.fY, dxy.fX, dxy.fY);
#endif
if (best > dist) {

View File

@ -23,7 +23,7 @@ struct SkTTCFHeader {
SK_OT_Fixed version;
static const SK_OT_Fixed version_1 = SkTEndian_SwapBE32(1 << 16);
static const SK_OT_Fixed version_2 = SkTEndian_SwapBE32(2 << 16);
SK_OT_ULONG numOffsets;
//SK_OT_ULONG offset[numOffsets]

View File

@ -16,12 +16,12 @@ static struct lineCubic {
int answerCount;
SkDPoint answers[2];
} quadCubicTests[] = {
{{{{10,234}, {10,229.58172607421875}, {13.581720352172852,226}, {18,226}}},
{{{18,226}, {14.686291694641113,226}, {12.342399597167969,228.3424072265625}}}, 1,
{{18,226}, {0,0}}},
{{{{10,234}, {10,229.58172607421875}, {13.581720352172852,226}, {18,226}}},
{{{12.342399597167969,228.3424072265625}, {10,230.68629455566406}, {10,234}}}, 1,
{{10,234}, {0,0}}},
{{{{10,234}, {10,229.58172607421875}, {13.581720352172852,226}, {18,226}}},
{{{18,226}, {14.686291694641113,226}, {12.342399597167969,228.3424072265625}}}, 1,
{{18,226}, {0,0}}},
{{{{10,234}, {10,229.58172607421875}, {13.581720352172852,226}, {18,226}}},
{{{12.342399597167969,228.3424072265625}, {10,230.68629455566406}, {10,234}}}, 1,
{{10,234}, {0,0}}},
};
static const size_t quadCubicTests_count = SK_ARRAY_COUNT(quadCubicTests);

View File

@ -91,7 +91,7 @@ static void PathOpsLineIntersectionTest(skiatest::Reporter* reporter) {
const SkDLine& line2 = noIntersect[index][1];
SkIntersections ts;
int pts = ts.intersect(line1, line2);
REPORTER_ASSERT(reporter, !pts);
REPORTER_ASSERT(reporter, !pts);
REPORTER_ASSERT(reporter, pts == ts.used());
}
}

View File

@ -1,61 +1,61 @@
#include "SkBitmap.h"
#include "SkDevice.h"
#include "SkCanvas.h"
#include "SkImageEncoder.h"
#include "SkStream.h"
#include "SkOSFile.h"
#include "SkPicture.h"
#include "SkString.h"
#include "Test.h"
static void make_filepath(SkString* path, const char* dir, const SkString& name) {
size_t len = strlen(dir);
path->set(dir);
if (len > 0 && dir[len - 1] != '/') {
path->append("\\");
}
path->append(name);
}
static void PathOpsSkpClipTest(skiatest::Reporter* reporter) {
const char pictDir[] = "C:\\Users\\caryclark\\skp";
const char outSkpClipDir[] = "C:\\Users\\caryclark\\skpClip";
const char outOldClipDir[] = "C:\\Users\\caryclark\\oldClip";
SkOSFile::Iter iter(pictDir, "skp");
SkString filename;
while (iter.next(&filename)) {
#if 0
if (strcmp(filename.c_str(), "tabl_androidpolice.skp")) {
continue;
}
#endif
SkString path;
make_filepath(&path, pictDir, filename);
SkFILEStream stream(path.c_str());
if (!stream.isValid()) {
continue;
}
SkPicture* pic = SkNEW_ARGS(SkPicture, (&stream));
int width = pic->width();
int height = pic->height();
SkBitmap bitmap;
bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
bitmap.allocPixels();
SkCanvas canvas(bitmap);
filename.remove(filename.size() - 3, 3);
filename.append("png");
for (int i = 0; i < 2; ++i) {
bool useOp = i ? true : false;
canvas.setAllowSimplifyClip(useOp);
pic->draw(&canvas);
SkString outFile;
make_filepath(&outFile, useOp ? outSkpClipDir : outOldClipDir, filename);
SkImageEncoder::EncodeFile(outFile.c_str(), bitmap, SkImageEncoder::kPNG_Type, 100);
}
SkDELETE(pic);
reporter->bumpTestCount();
}
}
#include "TestClassDef.h"
DEFINE_TESTCLASS_SHORT(PathOpsSkpClipTest)
#include "SkBitmap.h"
#include "SkDevice.h"
#include "SkCanvas.h"
#include "SkImageEncoder.h"
#include "SkStream.h"
#include "SkOSFile.h"
#include "SkPicture.h"
#include "SkString.h"
#include "Test.h"
static void make_filepath(SkString* path, const char* dir, const SkString& name) {
size_t len = strlen(dir);
path->set(dir);
if (len > 0 && dir[len - 1] != '/') {
path->append("\\");
}
path->append(name);
}
static void PathOpsSkpClipTest(skiatest::Reporter* reporter) {
const char pictDir[] = "C:\\Users\\caryclark\\skp";
const char outSkpClipDir[] = "C:\\Users\\caryclark\\skpClip";
const char outOldClipDir[] = "C:\\Users\\caryclark\\oldClip";
SkOSFile::Iter iter(pictDir, "skp");
SkString filename;
while (iter.next(&filename)) {
#if 0
if (strcmp(filename.c_str(), "tabl_androidpolice.skp")) {
continue;
}
#endif
SkString path;
make_filepath(&path, pictDir, filename);
SkFILEStream stream(path.c_str());
if (!stream.isValid()) {
continue;
}
SkPicture* pic = SkNEW_ARGS(SkPicture, (&stream));
int width = pic->width();
int height = pic->height();
SkBitmap bitmap;
bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
bitmap.allocPixels();
SkCanvas canvas(bitmap);
filename.remove(filename.size() - 3, 3);
filename.append("png");
for (int i = 0; i < 2; ++i) {
bool useOp = i ? true : false;
canvas.setAllowSimplifyClip(useOp);
pic->draw(&canvas);
SkString outFile;
make_filepath(&outFile, useOp ? outSkpClipDir : outOldClipDir, filename);
SkImageEncoder::EncodeFile(outFile.c_str(), bitmap, SkImageEncoder::kPNG_Type, 100);
}
SkDELETE(pic);
reporter->bumpTestCount();
}
}
#include "TestClassDef.h"
DEFINE_TESTCLASS_SHORT(PathOpsSkpClipTest)