Compile with c++0x.
http://codereview.appspot.com/5841074/
git-svn-id: http://skia.googlecode.com/svn/trunk@3434 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/strokefill.cpp b/gm/strokefill.cpp
index 75fa008..e1a07eb 100644
--- a/gm/strokefill.cpp
+++ b/gm/strokefill.cpp
@@ -27,9 +27,8 @@
return make_isize(640, 480);
}
- static void show_bold(SkCanvas* canvas, const char text[], SkScalar x,
- SkScalar y, const SkPaint& paint) {
- size_t len = strlen(text);
+ static void show_bold(SkCanvas* canvas, const void* text, int len,
+ SkScalar x, SkScalar y, const SkPaint& paint) {
SkPaint p(paint);
canvas->drawText(text, len, x, y, p);
p.setFakeBoldText(true);
@@ -47,12 +46,12 @@
SkTypeface* face = SkTypeface::CreateFromName("Papyrus", SkTypeface::kNormal);
SkSafeUnref(paint.setTypeface(face));
- show_bold(canvas, "Hello", x, y, paint);
+ show_bold(canvas, "Hello", 5, x, y, paint);
face = SkTypeface::CreateFromName("Hiragino Maru Gothic Pro", SkTypeface::kNormal);
SkSafeUnref(paint.setTypeface(face));
- const char hyphen[] = { 0xE3, 0x83, 0xBC, 0 };
- show_bold(canvas, hyphen, x + SkIntToScalar(300), y, paint);
+ const unsigned char hyphen[] = { 0xE3, 0x83, 0xBC };
+ show_bold(canvas, hyphen, SK_ARRAY_COUNT(hyphen), x + SkIntToScalar(300), y, paint);
paint.setStyle(SkPaint::kStrokeAndFill_Style);
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index ed5b1a3..97ef8c8 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -2129,8 +2129,8 @@
const GrTextureDesc desc = {
kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit,
- srcRect.width(),
- srcRect.height(),
+ SkScalarFloorToInt(srcRect.width()),
+ SkScalarFloorToInt(srcRect.height()),
kRGBA_8888_GrPixelConfig,
{0} // samples
};
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index c8e5f48..4917dcb 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -774,8 +774,8 @@
srcRect.offset(offset);
const GrTextureDesc desc = {
kRenderTarget_GrTextureFlagBit,
- srcRect.width(),
- srcRect.height(),
+ SkScalarCeilToInt(srcRect.width()),
+ SkScalarCeilToInt(srcRect.height()),
// We actually only need A8, but it often isn't supported as a
// render target
kRGBA_8888_PM_GrPixelConfig,
diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp
index f206062..d1ed217 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -276,8 +276,8 @@
strlen(expectedResult), false, false);
// Test that we correctly handle characters with the high-bit set.
- char highBitCString[] = {0xDE, 0xAD, 'b', 'e', 0xEF, 0};
- SkRefPtr<SkPDFName> highBitName = new SkPDFName(highBitCString);
+ const unsigned char highBitCString[] = {0xDE, 0xAD, 'b', 'e', 0xEF, 0};
+ SkRefPtr<SkPDFName> highBitName = new SkPDFName((const char*)highBitCString);
highBitName->unref(); // SkRefPtr and new both took a reference.
const char highBitExpectedResult[] = "/#DE#ADbe#EF";
CheckObjectOutput(reporter, highBitName.get(), highBitExpectedResult,
diff --git a/tests/ScalarTest.cpp b/tests/ScalarTest.cpp
index d2c05ab..981fb0f 100644
--- a/tests/ScalarTest.cpp
+++ b/tests/ScalarTest.cpp
@@ -78,16 +78,16 @@
test_floatclass(reporter, -nan, kNaN);
const Rec data[] = {
- { 0, true },
- { 1, true },
- { -1, true },
- { max * 0.75, true },
- { max, true },
- { -max * 0.75, true },
- { -max, true },
- { inf, false },
- { -inf, false },
- { nan, false },
+ { 0, true },
+ { 1, true },
+ { -1, true },
+ { max * 0.75f, true },
+ { max, true },
+ { -max * 0.75f, true },
+ { -max, true },
+ { inf, false },
+ { -inf, false },
+ { nan, false },
};
const IsFiniteProc1 gProc1[] = {