aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-21 16:41:00 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-21 16:41:00 +0000
commit4b7d6730898abc9e02d1e12c2fd732945f4c1ab4 (patch)
treeb8f627aef9c4e8f41431e04bd866738c0748567b /tests
parentf642f8cf90c8fd4111094026a1a9e9fdc92be9c3 (diff)
More clang warning fixes.
Mostly unused functions and variables removed. BUG=None TEST=ninja -C out/Debug most ninja -C out/Release most R=bsalomon@google.com, caryclark@google.com, robertphillips@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/27933002 git-svn-id: http://skia.googlecode.com/svn/trunk@11884 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r--tests/BlitRowTest.cpp4
-rw-r--r--tests/CanvasTest.cpp12
-rw-r--r--tests/ClipStackTest.cpp23
-rw-r--r--tests/ColorTest.cpp102
-rw-r--r--tests/PathOpsAngleTest.cpp12
5 files changed, 6 insertions, 147 deletions
diff --git a/tests/BlitRowTest.cpp b/tests/BlitRowTest.cpp
index 2b7d94a88b..3903efbfba 100644
--- a/tests/BlitRowTest.cpp
+++ b/tests/BlitRowTest.cpp
@@ -12,10 +12,6 @@
#include "SkGradientShader.h"
#include "SkRect.h"
-static inline const char* boolStr(bool value) {
- return value ? "true" : "false";
-}
-
// these are in the same order as the SkBitmap::Config enum
static const char* gConfigName[] = {
"None", "A1", "A8", "Index8", "565", "4444", "8888", "RLE_Index8"
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 24c3348d15..6d9fa1a671 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -94,8 +94,6 @@ static void test_clipVisitor(skiatest::Reporter* reporter, SkCanvas* canvas) {
static const int kWidth = 2;
static const int kHeight = 2;
-// Maximum stream length for picture serialization
-static const size_t kMaxPictureBufferSize = 1024;
// Format strings that describe the test context. The %s token is where
// the name of the test step is inserted. The context is required for
@@ -109,28 +107,18 @@ static const char* const kPictureDrawAssertMessageFormat =
"Drawing test step %s with SkPicture";
static const char* const kPictureSecondDrawAssertMessageFormat =
"Duplicate draw of test step %s with SkPicture";
-static const char* const kPictureReDrawAssertMessageFormat =
- "Playing back test step %s from an SkPicture to another SkPicture";
static const char* const kDeferredDrawAssertMessageFormat =
"Drawing test step %s with SkDeferredCanvas";
static const char* const kProxyDrawAssertMessageFormat =
"Drawing test step %s with SkProxyCanvas";
static const char* const kNWayDrawAssertMessageFormat =
"Drawing test step %s with SkNWayCanvas";
-static const char* const kRoundTripAssertMessageFormat =
- "test step %s, SkPicture consistency after round trip";
-static const char* const kPictureRecoringAssertMessageFormat =
- "test step %s, SkPicture state consistency after recording";
-static const char* const kPicturePlaybackAssertMessageFormat =
- "test step %s, SkPicture state consistency in playback canvas";
static const char* const kDeferredPreFlushAssertMessageFormat =
"test step %s, SkDeferredCanvas state consistency before flush";
static const char* const kDeferredPostFlushPlaybackAssertMessageFormat =
"test step %s, SkDeferredCanvas playback canvas state consistency after flush";
static const char* const kDeferredPostSilentFlushPlaybackAssertMessageFormat =
"test step %s, SkDeferredCanvas playback canvas state consistency after silent flush";
-static const char* const kDeferredPostFlushAssertMessageFormat =
- "test step %s, SkDeferredCanvas state consistency after flush";
static const char* const kPictureResourceReuseMessageFormat =
"test step %s, SkPicture duplicate flattened object test";
static const char* const kProxyStateAssertMessageFormat =
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index c16220e500..04b48b6783 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -858,29 +858,6 @@ static void add_elem_to_region(const SkClipStack::Element& element,
region->op(elemRegion, element.getOp());
}
-// This can assist with debugging the clip stack reduction code when the test below fails.
-static inline void print_clip(const SkClipStack::Element& element) {
- static const char* kOpStrs[] = {
- "DF",
- "IS",
- "UN",
- "XR",
- "RD",
- "RP",
- };
- if (SkClipStack::Element::kEmpty_Type != element.getType()) {
- const SkRect& bounds = element.getBounds();
- bool isRect = SkClipStack::Element::kRect_Type == element.getType();
- SkDebugf("%s %s %s [%f %f] x [%f %f]\n",
- kOpStrs[element.getOp()],
- (isRect ? "R" : "P"),
- (element.isInverseFilled() ? "I" : " "),
- bounds.fLeft, bounds.fRight, bounds.fTop, bounds.fBottom);
- } else {
- SkDebugf("EM\n");
- }
-}
-
static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
// We construct random clip stacks, reduce them, and then rasterize both versions to verify that
// they are equal.
diff --git a/tests/ColorTest.cpp b/tests/ColorTest.cpp
index a720ff4eac..30dad88e24 100644
--- a/tests/ColorTest.cpp
+++ b/tests/ColorTest.cpp
@@ -16,108 +16,6 @@
#define GetPackedG16As32(packed) (SkGetPackedG16(dc) << (8 - SK_G16_BITS))
#define GetPackedB16As32(packed) (SkGetPackedB16(dc) << (8 - SK_B16_BITS))
-static inline bool S32A_D565_Blend_0(SkPMColor sc, uint16_t dc, U8CPU alpha) {
- unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
- unsigned dr = SkMulS16(SkPacked32ToR16(sc), alpha) + SkMulS16(SkGetPackedR16(dc), dst_scale);
- unsigned dg = SkMulS16(SkPacked32ToG16(sc), alpha) + SkMulS16(SkGetPackedG16(dc), dst_scale);
-
- unsigned rr = SkDiv255Round(dr);
- unsigned rg = SkDiv255Round(dg);
-
- if (rr <= 31 && rg <= 63) {
- return true;
- }
- return false;
-}
-
-static inline bool S32A_D565_Blend_01(SkPMColor sc, uint16_t dc, U8CPU alpha) {
- unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
- unsigned dr = SkMulS16(SkGetPackedR32(sc), alpha) + SkMulS16(SkGetPackedR16(dc) << 3, dst_scale);
- unsigned dg = SkMulS16(SkGetPackedG32(sc), alpha) + SkMulS16(SkGetPackedG16(dc) << 2, dst_scale);
-
- unsigned rr = SkDiv255Round(dr) >> 3;
- unsigned rg = SkDiv255Round(dg) >> 2;
-
- if (rr <= 31 && rg <= 63) {
- return true;
- }
- return false;
-}
-
-static inline bool S32A_D565_Blend_02(SkPMColor sc, uint16_t dc, U8CPU alpha) {
- unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
- unsigned dr = SkMulS16(SkGetPackedR32(sc), alpha) + SkMulS16(GetPackedR16As32(dc), dst_scale);
- unsigned dg = SkMulS16(SkGetPackedG32(sc), alpha) + SkMulS16(GetPackedG16As32(dc), dst_scale);
- unsigned db = SkMulS16(SkGetPackedB32(sc), alpha) + SkMulS16(GetPackedB16As32(dc), dst_scale);
- int rc = SkPack888ToRGB16(SkDiv255Round(dr),
- SkDiv255Round(dg),
- SkDiv255Round(db));
-
- unsigned rr = SkGetPackedR16(rc);
- unsigned rg = SkGetPackedG16(rc);
-
- if (rr <= 31 && rg <= 63) {
- return true;
- }
- return false;
-}
-
-static inline bool S32A_D565_Blend_1(SkPMColor sc, uint16_t dc, U8CPU alpha) {
- unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
- unsigned dr = (SkMulS16(SkGetPackedR32(sc), alpha) >> 3) + SkMulS16(SkGetPackedR16(dc), dst_scale);
- unsigned dg = (SkMulS16(SkGetPackedG32(sc), alpha) >> 2) + SkMulS16(SkGetPackedG16(dc), dst_scale);
-
- unsigned rr = SkDiv255Round(dr);
- unsigned rg = SkDiv255Round(dg);
-
- if (rr <= 31 && rg <= 63) {
- return true;
- }
- return false;
-}
-
-static inline int SkDiv65025Round(int x) {
- return (x + 65025/2) / 65025;
-// return x / 65025;
-}
-static inline bool S32A_D565_Blend_2(SkPMColor sc, uint16_t dc, U8CPU alpha) {
- unsigned dst_scale = 255*255 - SkGetPackedA32(sc) * alpha;
- alpha *= 255;
- unsigned dr = (SkGetPackedR32(sc) >> 3) * alpha + SkGetPackedR16(dc) * dst_scale;
- unsigned dg = (SkGetPackedG32(sc) >> 2) * alpha + SkGetPackedG16(dc) * dst_scale;
-
- unsigned rr = SkDiv65025Round(dr);
- unsigned rg = SkDiv65025Round(dg);
-
- if (rr <= 31 && rg <= 63) {
- return true;
- }
- return false;
-}
-
-static inline void test_565blend() {
- int total_failures = 0;
- for (int global_alpha = 0; global_alpha <= 255; ++global_alpha) {
- int failures = 0;
- int total = 0;
- for (int src_a = 0; src_a <= 255; ++src_a) {
- for (int src_c = 0; src_c <= src_a; ++src_c) {
- SkPMColor sc = SkPackARGB32(src_a, src_c, src_c, src_c);
- for (int dst_r = 0; dst_r <= 31; ++dst_r) {
- for (int dst_g = 0; dst_g <= 63; ++dst_g) {
- uint16_t dc = SkPackRGB16(dst_r, dst_g, dst_r);
- failures += !S32A_D565_Blend_0(sc, dc, global_alpha);
- total += 1;
- }
- }
- }
- }
- SkDebugf("global_alpha=%d failures=%d total=%d %g\n", global_alpha, failures, total, failures * 100.0 / total);
- total_failures += failures;
- }
- SkDebugf("total failures %d\n", total_failures);
-}
-
static inline void test_premul(skiatest::Reporter* reporter) {
for (int a = 0; a <= 255; a++) {
for (int x = 0; x <= 255; x++) {
diff --git a/tests/PathOpsAngleTest.cpp b/tests/PathOpsAngleTest.cpp
index 7f5e456ea3..fed74d3441 100644
--- a/tests/PathOpsAngleTest.cpp
+++ b/tests/PathOpsAngleTest.cpp
@@ -62,7 +62,7 @@ struct SortSet {
SkPoint endPt;
};
-static const SortSet set1[] = {
+/*static const SortSet set1[] = {
{cubics[0], 4, 0.66666987081928919, 0.875, {0, 0}},
{lines[0], 2, 0.574070336, 0.388888889, {0, 0}},
{cubics[0], 4, 0.66666987081928919, 0.4050371120499307, {0, 0}},
@@ -72,7 +72,7 @@ static const SortSet set1[] = {
static const SortSet set1a[] = {
{cubics[0], 4, 0.666666667, 0.405037112, {4.58007812f,2.83203125f}},
{lines[0], 2, 0.574074074, 0.9140625, {4.44444466f,2.77777767f}},
-};
+};*/
static const SortSet set2[] = {
{cubics[0], 4, 0.666666667, 0.875, {0, 0}},
@@ -86,10 +86,10 @@ static const SortSet set3[] = {
{quads[0], 3, 1, 0, {0, 0}},
};
-static const SortSet set4[] = {
+/*static const SortSet set4[] = {
{cubics[2], 4, 0.812114222, 1, {0, 0}},
{cubics[3], 4, 0.0684734759, 0, {0, 0}},
-};
+};*/
static const SortSet set5[] = {
{lines[1], 2, 0.777777778, 1, {0, 0}},
@@ -183,11 +183,11 @@ static const SortSet set14[] = {
{quads[2], 3, 0.5, 0.7, {0, 0}},
};
-static const SortSet set15[] = {
+/*static const SortSet set15[] = {
{cubics[14], 4, 0.93081374, 1, {0, 0}},
{cubics[15], 4, 0.188518131, 0, {0, 0}},
{cubics[14], 4, 0.93081374, 0, {0, 0}},
-};
+};*/
static const SortSet set16[] = {
{cubics[17], 4, 0.0682619216, 0, {130.042755f,11417.4131f}},