// otherwise output only the average
if (!logPerIter) {
fWallStr.set(" msecs = ");
- fWallStr.appendf(normalTimeFormat.c_str(),
+ fWallStr.appendf(normalTimeFormat.c_str(),
printMin ? fWallMin : fWallSum / repeatDraw);
fCpuStr.set(" cmsecs = ");
- fCpuStr.appendf(normalTimeFormat.c_str(),
+ fCpuStr.appendf(normalTimeFormat.c_str(),
printMin ? fCpuMin : fCpuSum / repeatDraw);
fTruncatedWallStr.set(" Wmsecs = ");
- fTruncatedWallStr.appendf(normalTimeFormat.c_str(),
+ fTruncatedWallStr.appendf(normalTimeFormat.c_str(),
printMin ? fTruncatedWallMin : fTruncatedWallSum / repeatDraw);
fTruncatedCpuStr.set(" Cmsecs = ");
- fTruncatedCpuStr.appendf(normalTimeFormat.c_str(),
+ fTruncatedCpuStr.appendf(normalTimeFormat.c_str(),
printMin ? fTruncatedCpuMin : fTruncatedCpuSum / repeatDraw);
fGpuStr.set(" gmsecs = ");
- fGpuStr.appendf(normalTimeFormat.c_str(),
+ fGpuStr.appendf(normalTimeFormat.c_str(),
printMin ? fGpuMin : fGpuSum / repeatDraw);
}
SkString str;
}
inline bool approximately_zero(float x) {
-
+
return fabs(x) < FLT_EPSILON;
}
}
const int MAX_ERRORS = 5;
if (errors2x2 > MAX_ERRORS && gComparePathsAssert) {
- SkDebugf("%s errors=%d\n", __FUNCTION__, errors);
+ SkDebugf("%s errors=%d\n", __FUNCTION__, errors);
showPath(one);
showPath(two, "simplified:");
SkASSERT(0);
size_t inLen = inData.count();
inFile.read(inData.begin(), inLen);
inFile.setPath(NULL);
- char* insert = strstr(inData.begin(), marker);
+ char* insert = strstr(inData.begin(), marker);
if (insert) {
insert += sizeof(marker) - 1;
const char* numLoc = insert + 4 /* indent spaces */ + testNameSize - 1;
}
outFile.writeText(pathStr);
outFile.writeText("</div>\n\n");
-
+
outFile.writeText(marker);
outFile.writeText(" ");
writeTestName(pathFillType, outFile);
outFile.writeText(",\n\n\n");
-
+
outFile.writeText("static void ");
writeTestName(pathFillType, outFile);
outFile.writeText("() {\n SkPath path;\n");
bool isHorizontal() const {
return fDy == 0 && fDDy == 0 && fDDDy == 0;
}
-
+
// high precision version
#if HIGH_DEF_ANGLES
void set(const SkPoint* orig, SkPath::Verb verb, const Segment* segment,
fDDDy = approximately_pin(pts[3].y + 3 * (pts[1].y - pts[2].y) - pts[0].y);
}
-#else
+#else
// since all angles share a point, this needs to know which point
// is the common origin, i.e., whether the center is at pts[0] or pts[verb]
// practically, this should only be called by addAngle
SkPath path;
path.setFillType(SkPath::kEvenOdd_FillType);
path.addRect(0, 0, 12, 12, (SkPath::Direction) 0);
- path.addRect(12, 16, 21, 21, (SkPath::Direction) 0);
+ path.addRect(12, 16, 21, 21, (SkPath::Direction) 0);
testSimplifyx(path);
}
const uint32_t fUniqueID;
static uint32_t NextUniqueID();
-
+
typedef SkRefCnt INHERITED;
};
* Swap the contents of the two pictures. Guaranteed to succeed.
*/
void swap(SkPicture& other);
-
+
/**
* Creates a thread-safe clone of the picture that is ready for playback.
*/
const int fWidth;
const int fHeight;
uint32_t fGenerationID;
-
+
typedef SkRefCnt INHERITED;
};
void reset();
uint32_t* reserve(size_t size); // size MUST be multiple of 4
-
+
/**
* Specify the single block to back the writer, rathern than dynamically
* allocating the memory. If block == NULL, then the writer reverts to
fExternalMatrix.reset();
fExternalInverse.reset();
fUseExternalMatrix = false;
-
+
fSurfaceBase = NULL;
return this->setDevice(device);
buffer.writePaint((*fPaints)[i]);
}
}
-
+
if ((n = SafeCount(fPathHeap.get())) > 0) {
writeTagSize(buffer, PICT_PATH_BUFFER_TAG, n);
fPathHeap->flatten(buffer);
uint32_t* SkWriter32::peek32(size_t offset) {
SkDEBUGCODE(this->validate();)
-
+
SkASSERT(SkAlign4(offset) == offset);
SkASSERT(offset <= fSize);
if (fSingleBlock) {
return;
}
-
+
// Similar to peek32, except that we free up any following blocks
Block* block = fHead;
SkASSERT(NULL != block);
-
+
while (offset >= block->fAllocatedSoFar) {
offset -= block->fAllocatedSoFar;
block = block->fNext;
fTail = block;
block->fAllocatedSoFar = offset;
-
+
// free up any following blocks
SkASSERT(block);
block = block->fNext;
kSmearAlpha_InConfigFlag = 0x02,
/**
- Smear the red channel across all four channels. This flag is
+ Smear the red channel across all four channels. This flag is
incompatible with kSmearAlpha. It is preferable to use
GL_ARB_texture_swizzle instead of this flag.
*/
if (rec->fTextSize > SkIntToScalar(1 << 14)) {
rec->fTextSize = SkIntToScalar(1 << 14);
}
-
+
if (!gLCDSupportValid) {
InitFreetype();
FT_Done_FreeType(gFTLibrary);
static void test_rewind(skiatest::Reporter* reporter) {
SkSWriter32<32> writer(32);
int32_t array[3] = { 1, 2, 4 };
-
+
REPORTER_ASSERT(reporter, 0 == writer.bytesWritten());
for (size_t i = 0; i < SK_ARRAY_COUNT(array); ++i) {
writer.writeInt(array[i]);