зеркало из https://github.com/mozilla/moz-skia.git
Tests : Unused parameters cleanup
I removed unused parameters in the tests wherever it was trivial to do so. I'm trying to get the easy ones out of the way before we get into more involved discussions around this. Review URL: https://codereview.appspot.com/7394055 git-svn-id: http://skia.googlecode.com/svn/trunk@7891 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
4e0d96b655
Коммит
54f0d1b711
|
@ -380,7 +380,7 @@ static void test_nearly_integral(skiatest::Reporter* reporter) {
|
|||
did_dx_affect(reporter, gUnsafeX, SK_ARRAY_COUNT(gUnsafeX), true);
|
||||
}
|
||||
|
||||
static void test_regressions(skiatest::Reporter* reporter) {
|
||||
static void test_regressions() {
|
||||
// these should not assert in the debug build
|
||||
// bug was introduced in rev. 3209
|
||||
{
|
||||
|
@ -400,7 +400,7 @@ static void TestAAClip(skiatest::Reporter* reporter) {
|
|||
test_irect(reporter);
|
||||
test_rgn(reporter);
|
||||
test_path_with_hole(reporter);
|
||||
test_regressions(reporter);
|
||||
test_regressions();
|
||||
test_nearly_integral(reporter);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ static int proc_8(const void* ptr, int w, uint32_t expected, uint32_t* bad) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
static int proc_bad(const void* ptr, int, uint32_t, uint32_t* bad) {
|
||||
static int proc_bad(const void*, int, uint32_t, uint32_t* bad) {
|
||||
*bad = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -430,8 +430,8 @@ static void PaintSaveLayerStep(SkCanvas* canvas,
|
|||
TEST_STEP(PaintSaveLayer, PaintSaveLayerStep);
|
||||
|
||||
static void TwoClipOpsStep(SkCanvas* canvas,
|
||||
skiatest::Reporter* reporter,
|
||||
CanvasTestStep* testStep) {
|
||||
skiatest::Reporter*,
|
||||
CanvasTestStep*) {
|
||||
// This test exercises a functionality in SkPicture that leads to the
|
||||
// recording of restore offset placeholders. This test will trigger an
|
||||
// assertion at playback time if the placeholders are not properly
|
||||
|
@ -444,8 +444,8 @@ TEST_STEP(TwoClipOps, TwoClipOpsStep);
|
|||
// exercise fix for http://code.google.com/p/skia/issues/detail?id=560
|
||||
// ('SkPathStroker::lineTo() fails for line with length SK_ScalarNearlyZero')
|
||||
static void DrawNearlyZeroLengthPathTestStep(SkCanvas* canvas,
|
||||
skiatest::Reporter* reporter,
|
||||
CanvasTestStep* testStep) {
|
||||
skiatest::Reporter*,
|
||||
CanvasTestStep*) {
|
||||
SkPaint paint;
|
||||
paint.setStrokeWidth(SkIntToScalar(1));
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
|
@ -465,8 +465,8 @@ static void DrawNearlyZeroLengthPathTestStep(SkCanvas* canvas,
|
|||
TEST_STEP(DrawNearlyZeroLengthPath, DrawNearlyZeroLengthPathTestStep);
|
||||
|
||||
static void DrawVerticesShaderTestStep(SkCanvas* canvas,
|
||||
skiatest::Reporter* reporter,
|
||||
CanvasTestStep* testStep) {
|
||||
skiatest::Reporter*,
|
||||
CanvasTestStep*) {
|
||||
SkPoint pts[4];
|
||||
pts[0].set(0, 0);
|
||||
pts[1].set(SkIntToScalar(kWidth), 0);
|
||||
|
@ -483,8 +483,8 @@ static void DrawVerticesShaderTestStep(SkCanvas* canvas,
|
|||
TEST_STEP_NO_PDF(DrawVerticesShader, DrawVerticesShaderTestStep);
|
||||
|
||||
static void DrawPictureTestStep(SkCanvas* canvas,
|
||||
skiatest::Reporter* reporter,
|
||||
CanvasTestStep* testStep) {
|
||||
skiatest::Reporter*,
|
||||
CanvasTestStep*) {
|
||||
SkPicture* testPicture = SkNEW_ARGS(SkPicture, ());
|
||||
SkAutoUnref aup(testPicture);
|
||||
SkCanvas* testCanvas = testPicture->beginRecording(kWidth, kHeight);
|
||||
|
@ -553,8 +553,8 @@ static void DrawLayerTestStep(SkCanvas* canvas,
|
|||
TEST_STEP(DrawLayer, DrawLayerTestStep);
|
||||
|
||||
static void NestedSaveRestoreWithSolidPaintTestStep(SkCanvas* canvas,
|
||||
skiatest::Reporter* reporter,
|
||||
CanvasTestStep* testStep) {
|
||||
skiatest::Reporter*,
|
||||
CanvasTestStep*) {
|
||||
// This test step challenges the TestDeferredCanvasStateConsistency
|
||||
// test cases because the opaque paint can trigger an optimization
|
||||
// that discards previously recorded commands. The challenge is to maintain
|
||||
|
@ -575,8 +575,8 @@ TEST_STEP(NestedSaveRestoreWithSolidPaint, \
|
|||
NestedSaveRestoreWithSolidPaintTestStep);
|
||||
|
||||
static void NestedSaveRestoreWithFlushTestStep(SkCanvas* canvas,
|
||||
skiatest::Reporter* reporter,
|
||||
CanvasTestStep* testStep) {
|
||||
skiatest::Reporter*,
|
||||
CanvasTestStep*) {
|
||||
// This test step challenges the TestDeferredCanvasStateConsistency
|
||||
// test case because the canvas flush on a deferred canvas will
|
||||
// reset the recording session. The challenge is to maintain correct
|
||||
|
|
|
@ -48,7 +48,7 @@ static void test_hairclipping(skiatest::Reporter* reporter) {
|
|||
}
|
||||
}
|
||||
|
||||
static void test_edgeclipper(skiatest::Reporter* reporter) {
|
||||
static void test_edgeclipper() {
|
||||
SkEdgeClipper clipper;
|
||||
|
||||
const SkPoint pts[] = {
|
||||
|
@ -146,7 +146,7 @@ static void test_intersectline(skiatest::Reporter* reporter) {
|
|||
|
||||
static void TestClipper(skiatest::Reporter* reporter) {
|
||||
test_intersectline(reporter);
|
||||
test_edgeclipper(reporter);
|
||||
test_edgeclipper();
|
||||
test_hairclipping(reporter);
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ static inline bool S32A_D565_Blend_2(SkPMColor sc, uint16_t dc, U8CPU alpha) {
|
|||
return false;
|
||||
}
|
||||
|
||||
static inline void test_565blend(skiatest::Reporter* reporter) {
|
||||
static inline void test_565blend() {
|
||||
int total_failures = 0;
|
||||
for (int global_alpha = 0; global_alpha <= 255; ++global_alpha) {
|
||||
int failures = 0;
|
||||
|
@ -182,7 +182,7 @@ static void TestColor(skiatest::Reporter* reporter) {
|
|||
test_premul(reporter);
|
||||
//test_interp(reporter);
|
||||
test_fast_interp(reporter);
|
||||
// test_565blend(reporter);
|
||||
// test_565blend();
|
||||
}
|
||||
|
||||
#include "TestClassDef.h"
|
||||
|
|
|
@ -246,7 +246,7 @@ public:
|
|||
virtual void prepareForDraw() SK_OVERRIDE {
|
||||
fPrepareForDrawCount++;
|
||||
}
|
||||
virtual void storageAllocatedForRecordingChanged(size_t size) SK_OVERRIDE {
|
||||
virtual void storageAllocatedForRecordingChanged(size_t) SK_OVERRIDE {
|
||||
fStorageAllocatedChangedCount++;
|
||||
}
|
||||
virtual void flushedDrawCommands() SK_OVERRIDE {
|
||||
|
|
|
@ -202,7 +202,7 @@ static void test_giantrepeat_crbug118018(skiatest::Reporter* reporter) {
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void test_nan_antihair(skiatest::Reporter* reporter) {
|
||||
static void test_nan_antihair() {
|
||||
SkBitmap bm;
|
||||
bm.setConfig(SkBitmap::kARGB_8888_Config, 20, 20);
|
||||
bm.allocPixels();
|
||||
|
@ -264,7 +264,7 @@ static void TestDrawBitmapRect(skiatest::Reporter* reporter) {
|
|||
// ensure that we draw nothing if srcR does not intersect the bitmap
|
||||
REPORTER_ASSERT(reporter, check_for_all_zeros(dst));
|
||||
|
||||
test_nan_antihair(reporter);
|
||||
test_nan_antihair();
|
||||
test_giantrepeat_crbug118018(reporter);
|
||||
|
||||
test_treatAsSprite(reporter);
|
||||
|
|
|
@ -49,7 +49,7 @@ static void cubicToH(SkPath* path, const uint32_t raw[]) {
|
|||
|
||||
// we're not calling this test anymore; is that for a reason?
|
||||
|
||||
static void test_crbug131181(skiatest::Reporter*) {
|
||||
static void test_crbug131181() {
|
||||
/*
|
||||
fX = 18.8943768,
|
||||
fY = 129.121277
|
||||
|
@ -82,7 +82,7 @@ static void test_crbug131181(skiatest::Reporter*) {
|
|||
// This used to assert in debug builds (and crash writing bad memory in release)
|
||||
// because we overflowed an intermediate value (B coefficient) setting up our
|
||||
// stepper for the quadratic. Now we bias that value by 1/2 so we don't overflow
|
||||
static void test_crbug_140803(skiatest::Reporter* reporter) {
|
||||
static void test_crbug_140803() {
|
||||
SkBitmap bm;
|
||||
bm.setConfig(SkBitmap::kARGB_8888_Config, 2700, 30*1024);
|
||||
bm.allocPixels();
|
||||
|
@ -101,7 +101,7 @@ static void test_crbug_140803(skiatest::Reporter* reporter) {
|
|||
// of its bounds).
|
||||
// In the debug build, we used to assert in this case, until it was fixed.
|
||||
//
|
||||
static void test_inversepathwithclip(skiatest::Reporter* reporter) {
|
||||
static void test_inversepathwithclip() {
|
||||
SkPath path;
|
||||
|
||||
path.moveTo(0, SkIntToScalar(20));
|
||||
|
@ -138,7 +138,7 @@ static void test_inversepathwithclip(skiatest::Reporter* reporter) {
|
|||
canvas.get()->drawPath(path, paint);
|
||||
}
|
||||
|
||||
static void test_bug533(skiatest::Reporter* reporter) {
|
||||
static void test_bug533() {
|
||||
#ifdef SK_SCALAR_IS_FLOAT
|
||||
/*
|
||||
http://code.google.com/p/skia/issues/detail?id=533
|
||||
|
@ -157,7 +157,7 @@ static void test_bug533(skiatest::Reporter* reporter) {
|
|||
#endif
|
||||
}
|
||||
|
||||
static void test_crbug_140642(skiatest::Reporter* reporter) {
|
||||
static void test_crbug_140642() {
|
||||
/*
|
||||
* We used to see this construct, and due to rounding as we accumulated
|
||||
* our length, the loop where we apply the phase would run off the end of
|
||||
|
@ -179,7 +179,7 @@ static void test_crbug_140642(skiatest::Reporter* reporter) {
|
|||
#endif
|
||||
}
|
||||
|
||||
static void test_crbug_124652(skiatest::Reporter* reporter) {
|
||||
static void test_crbug_124652() {
|
||||
#ifdef SK_SCALAR_IS_FLOAT
|
||||
/*
|
||||
http://code.google.com/p/chromium/issues/detail?id=124652
|
||||
|
@ -192,7 +192,7 @@ static void test_crbug_124652(skiatest::Reporter* reporter) {
|
|||
#endif
|
||||
}
|
||||
|
||||
static void test_bigcubic(skiatest::Reporter* reporter) {
|
||||
static void test_bigcubic() {
|
||||
#ifdef SK_SCALAR_IS_FLOAT
|
||||
SkPath path;
|
||||
path.moveTo(64, 3);
|
||||
|
@ -209,7 +209,7 @@ static void test_bigcubic(skiatest::Reporter* reporter) {
|
|||
// we used to assert if the bounds of the device (clip) was larger than 32K
|
||||
// even when the path itself was smaller. We just draw and hope in the debug
|
||||
// version to not assert.
|
||||
static void test_giantaa(skiatest::Reporter* reporter) {
|
||||
static void test_giantaa() {
|
||||
const int W = 400;
|
||||
const int H = 400;
|
||||
SkAutoTUnref<SkCanvas> canvas(new_canvas(33000, 10));
|
||||
|
@ -265,15 +265,15 @@ static void test_crbug_165432(skiatest::Reporter* reporter) {
|
|||
}
|
||||
|
||||
static void TestDrawPath(skiatest::Reporter* reporter) {
|
||||
test_giantaa(reporter);
|
||||
test_bug533(reporter);
|
||||
test_bigcubic(reporter);
|
||||
test_crbug_124652(reporter);
|
||||
test_crbug_140642(reporter);
|
||||
test_crbug_140803(reporter);
|
||||
test_inversepathwithclip(reporter);
|
||||
test_giantaa();
|
||||
test_bug533();
|
||||
test_bigcubic();
|
||||
test_crbug_124652();
|
||||
test_crbug_140642();
|
||||
test_crbug_140803();
|
||||
test_inversepathwithclip();
|
||||
// why?
|
||||
if (false) test_crbug131181(reporter);
|
||||
if (false) test_crbug131181();
|
||||
test_infinite_dash(reporter);
|
||||
test_crbug_165432(reporter);
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ static void iter_paint(skiatest::Reporter* reporter, const SkPath& path, bool sh
|
|||
#define CX (SkIntToScalar(DIMENSION) / 2)
|
||||
#define CY (SkIntToScalar(DIMENSION) / 2)
|
||||
|
||||
static void make_empty(SkPath* path) {}
|
||||
static void make_empty(SkPath*) {}
|
||||
static void make_M(SkPath* path) { path->moveTo(CX, CY); }
|
||||
static void make_MM(SkPath* path) { path->moveTo(CX, CY); path->moveTo(CX, CY); }
|
||||
static void make_MZM(SkPath* path) { path->moveTo(CX, CY); path->close(); path->moveTo(CX, CY); }
|
||||
|
|
|
@ -79,9 +79,10 @@ static void test_16(skiatest::Reporter* reporter) {
|
|||
uint16_t* base = &buffer[PAD + alignment];
|
||||
sk_memset16(base, VALUE16, count);
|
||||
|
||||
compare16(buffer, 0, PAD + alignment);
|
||||
compare16(base, VALUE16, count);
|
||||
compare16(base + count, 0, TOTAL - count - PAD - alignment);
|
||||
REPORTER_ASSERT(reporter,
|
||||
compare16(buffer, 0, PAD + alignment) &&
|
||||
compare16(base, VALUE16, count) &&
|
||||
compare16(base + count, 0, TOTAL - count - PAD - alignment));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -96,9 +97,10 @@ static void test_32(skiatest::Reporter* reporter) {
|
|||
uint32_t* base = &buffer[PAD + alignment];
|
||||
sk_memset32(base, VALUE32, count);
|
||||
|
||||
compare32(buffer, 0, PAD + alignment);
|
||||
compare32(base, VALUE32, count);
|
||||
compare32(base + count, 0, TOTAL - count - PAD - alignment);
|
||||
REPORTER_ASSERT(reporter,
|
||||
compare32(buffer, 0, PAD + alignment) &&
|
||||
compare32(base, VALUE32, count) &&
|
||||
compare32(base + count, 0, TOTAL - count - PAD - alignment));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ static void TestSubstitute(skiatest::Reporter* reporter) {
|
|||
// http://code.google.com/p/skia/issues/detail?id=1083.
|
||||
// SKP files might have invalid glyph ids. This test ensures they are ignored,
|
||||
// and there is no assert on input data in Debug mode.
|
||||
static void test_issue1083(skiatest::Reporter* reporter) {
|
||||
static void test_issue1083() {
|
||||
SkISize pageSize = SkISize::Make(100, 100);
|
||||
SkPDFDevice* dev = new SkPDFDevice(pageSize, pageSize, SkMatrix::I());
|
||||
|
||||
|
@ -323,7 +323,7 @@ static void TestPDFPrimitives(skiatest::Reporter* reporter) {
|
|||
|
||||
TestSubstitute(reporter);
|
||||
|
||||
test_issue1083(reporter);
|
||||
test_issue1083();
|
||||
}
|
||||
|
||||
#include "TestClassDef.h"
|
||||
|
|
|
@ -66,7 +66,7 @@ static inline uint32_t compute_pointCount(SkScalar d, SkScalar tol) {
|
|||
}
|
||||
}
|
||||
|
||||
static uint32_t quadraticPointCount_EE(const SkPoint points[], SkScalar tol) {
|
||||
static uint32_t quadraticPointCount_EE(const SkPoint points[]) {
|
||||
int distance = estimate_distance(points);
|
||||
return estimate_pointCount(distance);
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ static uint32_t quadraticPointCount_EC(const SkPoint points[], SkScalar tol) {
|
|||
return compute_pointCount(SkIntToScalar(distance), tol);
|
||||
}
|
||||
|
||||
static uint32_t quadraticPointCount_CE(const SkPoint points[], SkScalar tol) {
|
||||
static uint32_t quadraticPointCount_CE(const SkPoint points[]) {
|
||||
SkScalar distance = compute_distance(points);
|
||||
return estimate_pointCount(SkScalarRound(distance));
|
||||
}
|
||||
|
@ -122,13 +122,13 @@ static bool one_d_pe(const int* array, const unsigned int count,
|
|||
uint32_t computedCount =
|
||||
quadraticPointCount_CC(path, SkIntToScalar(1));
|
||||
uint32_t estimatedCount =
|
||||
quadraticPointCount_EE(path, SkIntToScalar(1));
|
||||
quadraticPointCount_EE(path);
|
||||
|
||||
if (false) { // avoid bit rot, suppress warning
|
||||
computedCount =
|
||||
quadraticPointCount_EC(path, SkIntToScalar(1));
|
||||
estimatedCount =
|
||||
quadraticPointCount_CE(path, SkIntToScalar(1));
|
||||
quadraticPointCount_CE(path);
|
||||
}
|
||||
// Allow estimated to be high by a factor of two, but no less than
|
||||
// the computed value.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "Test.h"
|
||||
#include "SkPathMeasure.h"
|
||||
|
||||
static void test_small_segment3(skiatest::Reporter* reporter) {
|
||||
static void test_small_segment3() {
|
||||
#ifdef SK_SCALAR_IS_FLOAT
|
||||
SkPath path;
|
||||
const SkPoint pts[] = {
|
||||
|
@ -27,7 +27,7 @@ static void test_small_segment3(skiatest::Reporter* reporter) {
|
|||
#endif
|
||||
}
|
||||
|
||||
static void test_small_segment2(skiatest::Reporter* reporter) {
|
||||
static void test_small_segment2() {
|
||||
#ifdef SK_SCALAR_IS_FLOAT
|
||||
SkPath path;
|
||||
const SkPoint pts[] = {
|
||||
|
@ -45,7 +45,7 @@ static void test_small_segment2(skiatest::Reporter* reporter) {
|
|||
#endif
|
||||
}
|
||||
|
||||
static void test_small_segment(skiatest::Reporter* reporter) {
|
||||
static void test_small_segment() {
|
||||
#ifdef SK_SCALAR_IS_FLOAT
|
||||
SkPath path;
|
||||
const SkPoint pts[] = {
|
||||
|
@ -203,9 +203,9 @@ static void TestPathMeasure(skiatest::Reporter* reporter) {
|
|||
REPORTER_ASSERT(reporter, tangent.fX == -SK_Scalar1);
|
||||
REPORTER_ASSERT(reporter, tangent.fY == 0);
|
||||
|
||||
test_small_segment(reporter);
|
||||
test_small_segment2(reporter);
|
||||
test_small_segment3(reporter);
|
||||
test_small_segment();
|
||||
test_small_segment2();
|
||||
test_small_segment3();
|
||||
}
|
||||
|
||||
#include "TestClassDef.h"
|
||||
|
|
|
@ -119,7 +119,7 @@ static void build_path_simple_170666(SkPath& path) {
|
|||
// This used to assert in the SK_DEBUG build, as the clip step would fail with
|
||||
// too-few interations in our cubic-line intersection code. That code now runs
|
||||
// 24 interations (instead of 16).
|
||||
static void test_crbug_170666(skiatest::Reporter* reporter) {
|
||||
static void test_crbug_170666() {
|
||||
SkPath path;
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
|
@ -175,7 +175,7 @@ static void build_big_path(SkPath* path, bool reducedCase) {
|
|||
}
|
||||
}
|
||||
|
||||
static void test_clipped_cubic(skiatest::Reporter* reporter) {
|
||||
static void test_clipped_cubic() {
|
||||
SkAutoTUnref<SkSurface> surface(new_surface(640, 480));
|
||||
|
||||
// This path used to assert, because our cubic-chopping code incorrectly
|
||||
|
@ -197,7 +197,7 @@ static void test_clipped_cubic(skiatest::Reporter* reporter) {
|
|||
// which triggered an assert, from a tricky cubic. This test replicates that
|
||||
// example, so we can ensure that we handle it (in SkEdge.cpp), and don't
|
||||
// assert in the SK_DEBUG build.
|
||||
static void test_tricky_cubic(skiatest::Reporter* reporter) {
|
||||
static void test_tricky_cubic() {
|
||||
const SkPoint pts[] = {
|
||||
{ SkDoubleToScalar(18.8943768), SkDoubleToScalar(129.121277) },
|
||||
{ SkDoubleToScalar(18.8937435), SkDoubleToScalar(129.121689) },
|
||||
|
@ -411,7 +411,7 @@ static void test_isfinite(skiatest::Reporter* reporter) {
|
|||
// only have (at most) 1 close
|
||||
//
|
||||
static void test_poly(skiatest::Reporter* reporter, const SkPath& path,
|
||||
const SkPoint srcPts[], int count, bool expectClose) {
|
||||
const SkPoint srcPts[], bool expectClose) {
|
||||
SkPath::RawIter iter(path);
|
||||
SkPoint pts[4];
|
||||
|
||||
|
@ -463,7 +463,7 @@ static void test_addPoly(skiatest::Reporter* reporter) {
|
|||
for (size_t count = 1; count <= SK_ARRAY_COUNT(pts); ++count) {
|
||||
SkPath path;
|
||||
path.addPoly(pts, count, SkToBool(doClose));
|
||||
test_poly(reporter, path, pts, count, SkToBool(doClose));
|
||||
test_poly(reporter, path, pts, SkToBool(doClose));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2347,12 +2347,12 @@ static void TestPath(skiatest::Reporter* reporter) {
|
|||
test_addPoly(reporter);
|
||||
test_isfinite(reporter);
|
||||
test_isfinite_after_transform(reporter);
|
||||
test_tricky_cubic(reporter);
|
||||
test_arb_round_rect_is_convex(reporter);
|
||||
test_arb_zero_rad_round_rect_is_rect(reporter);
|
||||
test_addrect_isfinite(reporter);
|
||||
test_clipped_cubic(reporter);
|
||||
test_crbug_170666(reporter);
|
||||
test_tricky_cubic();
|
||||
test_clipped_cubic();
|
||||
test_crbug_170666();
|
||||
}
|
||||
|
||||
#include "TestClassDef.h"
|
||||
|
|
|
@ -279,7 +279,7 @@ static void rand_op(SkCanvas* canvas, SkRandom& rand) {
|
|||
}
|
||||
}
|
||||
|
||||
static void test_peephole(skiatest::Reporter* reporter) {
|
||||
static void test_peephole() {
|
||||
SkRandom rand;
|
||||
|
||||
for (int j = 0; j < 100; j++) {
|
||||
|
@ -424,7 +424,7 @@ static void TestPicture(skiatest::Reporter* reporter) {
|
|||
#else
|
||||
test_bad_bitmap();
|
||||
#endif
|
||||
test_peephole(reporter);
|
||||
test_peephole();
|
||||
test_gatherpixelrefs(reporter);
|
||||
test_bitmap_with_encoded_data(reporter);
|
||||
test_clone_empty(reporter);
|
||||
|
|
|
@ -53,7 +53,7 @@ SkPMColor getCanvasColor(int x, int y) {
|
|||
return SkPremultiplyARGBInline(a, r, g, b);
|
||||
}
|
||||
|
||||
SkPMColor getBitmapColor(int x, int y, int w, int h) {
|
||||
SkPMColor getBitmapColor(int x, int y, int w) {
|
||||
int n = y * w + x;
|
||||
|
||||
U8CPU b = n & 0xff;
|
||||
|
@ -139,7 +139,7 @@ void fillBitmap(SkBitmap* bitmap) {
|
|||
for (int y = 0; y < h; ++y) {
|
||||
for (int x = 0; x < w; ++x) {
|
||||
SkPMColor* pixel = reinterpret_cast<SkPMColor*>(pixels + y * bitmap->rowBytes() + x * bitmap->bytesPerPixel());
|
||||
*pixel = getBitmapColor(x, y, w, h);
|
||||
*pixel = getBitmapColor(x, y, w);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -206,8 +206,8 @@ bool checkRead(skiatest::Reporter* reporter,
|
|||
}
|
||||
}
|
||||
} else if (checkBitmapPixels) {
|
||||
REPORTER_ASSERT(reporter, getBitmapColor(bx, by, bw, bh) == pixel);
|
||||
if (getBitmapColor(bx, by, bw, bh) != pixel) {
|
||||
REPORTER_ASSERT(reporter, getBitmapColor(bx, by, bw) == pixel);
|
||||
if (getBitmapColor(bx, by, bw) != pixel) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,11 +59,11 @@ static void* FakeCreateTLS() {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void FakeDeleteTLS(void* unused) {
|
||||
static void FakeDeleteTLS(void*) {
|
||||
sk_atomic_dec(&gCounter);
|
||||
}
|
||||
|
||||
static void testTLSDestructor(void* unused) {
|
||||
static void testTLSDestructor(void*) {
|
||||
SkTLS::Get(FakeCreateTLS, FakeDeleteTLS);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
MockCanvas(SkDevice* device) : SkCanvas(device)
|
||||
{}
|
||||
|
||||
virtual void drawRect(const SkRect& rect, const SkPaint& paint)
|
||||
virtual void drawRect(const SkRect& rect, const SkPaint&)
|
||||
{
|
||||
// This capture occurs before quick reject.
|
||||
fRects.push(rect);
|
||||
|
|
|
@ -103,7 +103,7 @@ uint32_t packConfig8888(SkCanvas::Config8888 config8888,
|
|||
return r32;
|
||||
}
|
||||
|
||||
uint32_t getBitmapColor(int x, int y, int w, int h, SkCanvas::Config8888 config8888) {
|
||||
uint32_t getBitmapColor(int x, int y, int w, SkCanvas::Config8888 config8888) {
|
||||
int n = y * w + x;
|
||||
U8CPU b = n & 0xff;
|
||||
U8CPU g = (n >> 8) & 0xff;
|
||||
|
@ -250,7 +250,7 @@ bool checkWrite(skiatest::Reporter* reporter,
|
|||
if (writeRect.contains(cx, cy)) {
|
||||
int bx = cx - writeX;
|
||||
int by = cy - writeY;
|
||||
uint32_t bmpColor8888 = getBitmapColor(bx, by, bitmap.width(), bitmap.height(), config8888);
|
||||
uint32_t bmpColor8888 = getBitmapColor(bx, by, bitmap.width(), config8888);
|
||||
bool mul;
|
||||
SkPMColor bmpPMColor = convertConfig8888ToPMColor(config8888, bmpColor8888, &mul);
|
||||
bool check;
|
||||
|
@ -354,7 +354,7 @@ bool setupBitmap(SkBitmap* bitmap,
|
|||
for (int y = 0; y < h; ++y) {
|
||||
for (int x = 0; x < w; ++x) {
|
||||
uint32_t* pixel = reinterpret_cast<uint32_t*>(pixels + y * bitmap->rowBytes() + x * 4);
|
||||
*pixel = getBitmapColor(x, y, w, h, config8888);
|
||||
*pixel = getBitmapColor(x, y, w, config8888);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -74,7 +74,7 @@ protected:
|
|||
virtual void onReport(const char desc[], Reporter::Result result) {
|
||||
SkDebugf("\t%s: %s\n", result2string(result), desc);
|
||||
}
|
||||
virtual void onEnd(Test* test) {
|
||||
virtual void onEnd(Test*) {
|
||||
if (!this->getCurrSuccess()) {
|
||||
SkDebugf("---- FAILED\n");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче