This change removes sk_stdint.h since it is only needed for vs2008 and earlier.
This change removes SK_MMAP_SUPPORT define since it is no longer used.
This change removes the stdio.h include from SkTypes.h since on many systems
this is a very large header, few Skia files actually use it, it is
available everywhere standard, and SkDebugf should be used instead.
After this change there is no need for external users to put Skia's
include/config into their own list of includes, saving the headache
of having two header files of the same name and sometimes getting the
wrong one depending on include order.
R=bsalomon@google.com, djsollen@google.com
Review URL: https://codereview.chromium.org/
27044002
git-svn-id: http://skia.googlecode.com/svn/trunk@11738
2bbb7eff-a529-9590-31e7-
b0007b416f81
#include "SkTypes.h"
#include "SkString.h"
+#include <stdio.h>
class SkFILEWStream;
'defines': [
'SK_BUILD_FOR_WIN32',
'SK_FONTHOST_USES_FONTMGR',
- 'SK_IGNORE_STDINT_DOT_H',
'_CRT_SECURE_NO_WARNINGS',
'GR_GL_FUNCTION_TYPE=__stdcall',
],
+++ /dev/null
-
-/*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#ifndef sk_stdint_DEFINED
-#define sk_stdint_DEFINED
-
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef short int16_t;
-typedef unsigned short uint16_t;
-typedef int int32_t;
-typedef unsigned uint32_t;
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-
-typedef int64_t intmax_t;
-typedef uint64_t uintmax_t;
-
-#endif
#if !defined(SK_WARN_UNUSED_RESULT)
#define SK_WARN_UNUSED_RESULT
#endif
- #include "sk_stdint.h"
#endif
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
-#ifndef SK_MMAP_SUPPORT
- #ifdef SK_BUILD_FOR_WIN32
- // by default, if we're windows, we assume we don't have mmap
- #define SK_MMAP_SUPPORT 0
- #else
- #define SK_MMAP_SUPPORT 1
- #endif
-#endif
-
-//////////////////////////////////////////////////////////////////////
-
/**
* SK_CPU_SSE_LEVEL
*
////////////////////////////////////////////////////////////////////////////////////////
#include "SkString.h"
+#include <stdio.h>
struct SkFILE;
#include "SkPreConfig.h"
#include "SkUserConfig.h"
#include "SkPostConfig.h"
-
-#ifndef SK_IGNORE_STDINT_DOT_H
- #include <stdint.h>
-#endif
-
-#include <stdio.h>
+#include <stdint.h>
/** \file SkTypes.h
*/
#include "SkCanvas.h"
#include "Sk64.h"
#include "SkGradientShader.h"
+#include "SkString.h"
static void draw_gradient2(SkCanvas* canvas, const SkRect& rect, SkScalar delta) {
SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorMAGENTA };
SkScalar l = SK_Scalar1 * 100;
SkScalar t = SK_Scalar1 * 100;
draw_gradient2(canvas, SkRect::MakeXYWH(l, t, w, h), delta);
- char txt[512];
- sprintf(txt, "gap at \"tangent\" pt = %f", SkScalarToFloat(delta));
+ SkString txt;
+ txt.appendf("gap at \"tangent\" pt = %f", SkScalarToFloat(delta));
SkPaint paint;
paint.setAntiAlias(true);
paint.setColor(SK_ColorBLACK);
- canvas->drawText(txt, strlen(txt), l + w/2 + w*DELTA_SCALE*delta, t + h + SK_Scalar1 * 10, paint);
+ canvas->drawText(txt.c_str(), txt.size(), l + w/2 + w*DELTA_SCALE*delta, t + h + SK_Scalar1 * 10, paint);
this->inval(NULL);
}
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkRandom.h"
+#include "SkString.h"
class EmptyPathView : public SampleView {
public:
rectPaint.setAntiAlias(true);
canvas->drawRect(rect, rectPaint);
- char label[1024];
- sprintf(label, "%s, %s", gStyles[style].fName,
- gFills[fill].fName);
+ SkString label;
+ label.appendf("%s, %s", gStyles[style].fName, gFills[fill].fName);
+
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
labelPaint.setLCDRenderText(true);
- canvas->drawText(label, strlen(label),
+ canvas->drawText(label.c_str(), label.size(),
0, rect.height() + 15 * SK_Scalar1,
labelPaint);
}
int ix = (int)x;
int fx = (int)(x * 65536);
int ffx = SkScalarToFixed(x);
- printf("%g %x %x %x\n", x, ix, fx, ffx);
+ SkDebugf("%g %x %x %x\n", x, ix, fx, ffx);
SkRect r = path.getBounds();
SkIRect ir;
r.round(&ir);
- printf("[%g %g %g %g] [%x %x %x %x]\n",
- SkScalarToDouble(r.fLeft), SkScalarToDouble(r.fTop),
- SkScalarToDouble(r.fRight), SkScalarToDouble(r.fBottom),
- ir.fLeft, ir.fTop, ir.fRight, ir.fBottom);
+ SkDebugf("[%g %g %g %g] [%x %x %x %x]\n",
+ SkScalarToDouble(r.fLeft), SkScalarToDouble(r.fTop),
+ SkScalarToDouble(r.fRight), SkScalarToDouble(r.fBottom),
+ ir.fLeft, ir.fTop, ir.fRight, ir.fBottom);
}
SkBitmap bitmap;
#include "SkBitmap.h"
#include "SkImageEncoder.h"
+#include <stdio.h>
SK_DEFINE_INST_COUNT(GrSurface)
#include "GrGLUtil.h"
#include "SkMatrix.h"
+#include <stdio.h>
void GrGLClearErr(const GrGLInterface* gl) {
while (GR_GL_NO_ERROR != gl->fGetError()) {}
#include "SkPathOps.h"
#include "SkTypes.h"
+#include <stdio.h>
#ifdef SK_RELEASE
#define FORCE_RELEASE 1
#include "SkRRect.h"
#include "SkString.h"
#include <stdarg.h>
+#include <stdio.h>
// needed just to know that these are all subclassed from SkFlattenable
#include "SkShader.h"
}
static void PrintCurve(const char *name, const SkPoint crv[4]) {
- printf("%s: %.10g, %.10g, %.10g, %.10g, %.10g, %.10g, %.10g, %.10g\n",
+ SkDebugf("%s: %.10g, %.10g, %.10g, %.10g, %.10g, %.10g, %.10g, %.10g\n",
name,
(float)crv[0].fX, (float)crv[0].fY,
(float)crv[1].fX, (float)crv[1].fY,
SkString familyName;
typeface->getFamilyName(&familyName);
if (verbose) {
- printf("[%s]\n", familyName.c_str());
+ SkDebugf("[%s]\n", familyName.c_str());
}
SkAutoTUnref<SkTypeface::LocalizedStrings> familyNamesIter(
SkTypeface::LocalizedString familyNameLocalized;
while (familyNamesIter->next(&familyNameLocalized)) {
if (verbose) {
- printf("(%s) <%s>\n", familyNameLocalized.fString.c_str(),
+ SkDebugf("(%s) <%s>\n", familyNameLocalized.fString.c_str(),
familyNameLocalized.fLanguage.c_str());
}
}
"Requested family name, got something else."
);
if (verbose) {
- printf("{%s} <%s>\n", record.name.c_str(), record.language.c_str());
+ SkDebugf("{%s} <%s>\n", record.name.c_str(), record.language.c_str());
}
}
"Requested subfamily name, got something else."
);
if (verbose) {
- printf("{{%s}} <%s>\n", record.name.c_str(), record.language.c_str());
+ SkDebugf("{{%s}} <%s>\n", record.name.c_str(), record.language.c_str());
}
}
if (verbose) {
- printf("\n");
+ SkDebugf("\n");
}
}
}
int r2 = SkScalarRoundToInt(SkFloatToScalar(f));
if (r0 != r1 && r0 != r2) {
- printf("src:%d dst:%d a:%d result:%d float:%g\n",
- src, dst, a, r0, f);
+ SkDebugf("src:%d dst:%d a:%d result:%d float:%g\n",
+ src, dst, a, r0, f);
failed += 1;
}
if (r0 > 255) {
death += 1;
- printf("death src:%d dst:%d a:%d result:%d float:%g\n",
- src, dst, a, r0, f);
+ SkDebugf("death src:%d dst:%d a:%d result:%d float:%g\n",
+ src, dst, a, r0, f);
}
}
}
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
if (!nearly_equal_mscalar(a.get(i, j), b.get(i, j))) {
- printf("not equal %g %g\n", a.get(i, j), b.get(i, j));
+ SkDebugf("not equal %g %g\n", a.get(i, j), b.get(i, j));
return false;
}
}
static bool nearly_equal(const SkMatrix& a, const SkMatrix& b) {
for (int i = 0; i < 9; i++) {
if (!nearly_equal_scalar(a[i], b[i])) {
- printf("not equal %g %g\n", (float)a[i], (float)b[i]);
+ SkDebugf("not equal %g %g\n", (float)a[i], (float)b[i]);
return false;
}
}
const SkDQuad& quad = quadraticLines[index];
order = reducer.reduce(quad, SkReduceOrder::kFill_Style);
if (order != 2) {
- printf("[%d] line quad order=%d\n", (int) index, order);
+ SkDebugf("[%d] line quad order=%d\n", (int) index, order);
}
}
for (index = firstQuadraticModLineTest; index < quadraticModEpsilonLines_count; ++index) {
const SkDQuad& quad = quadraticModEpsilonLines[index];
order = reducer.reduce(quad, SkReduceOrder::kFill_Style);
if (order != 3) {
- printf("[%d] line mod quad order=%d\n", (int) index, order);
+ SkDebugf("[%d] line mod quad order=%d\n", (int) index, order);
}
}
}
#include "Test.h"
#include "SkString.h"
#include <stdarg.h>
-
+#include <stdio.h>
// Windows vsnprintf doesn't 0-terminate safely), but is so far
// encapsulated in SkString that we can't test it directly.
SkString stringResult = stringify_advance_data(result.get());
if (!stringResult.equals(fExpected)) {
- printf("Expected: %s\n Result: %s\n", fExpected, stringResult.c_str());
+ SkDebugf("Expected: %s\n Result: %s\n", fExpected, stringResult.c_str());
return false;
}
return true;