diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-01 16:15:01 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-01 16:15:01 +0000 |
commit | eea3ab78e9f1680ada9bd471badc975e4d3cf8be (patch) | |
tree | ea55cf29ad2f0cbbc586b1c023cfe07cc84e8bea | |
parent | f91aaecbe9d3630123d803d80f7b29f06c8976c7 (diff) |
fix mac 10.6 build
- double -> float implicit conversion (for literals like 1.3)
- locally defined (and named) struct
R=scroggo@google.com
Review URL: https://codereview.chromium.org/56103002
git-svn-id: http://skia.googlecode.com/svn/trunk@12086 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | tests/ClipStackTest.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp index 5f85e6a83e..3161674a77 100644 --- a/tests/ClipStackTest.cpp +++ b/tests/ClipStackTest.cpp @@ -1006,7 +1006,7 @@ static void test_reduced_clip_stack_genid(skiatest::Reporter* reporter) { { SkClipStack stack; stack.clipDevRect(SkRect::MakeXYWH(0, 0, 100, 100), SkRegion::kReplace_Op, true); - stack.clipDevRect(SkRect::MakeXYWH(0, 0, 50.3, 50.3), SkRegion::kReplace_Op, true); + stack.clipDevRect(SkRect::MakeXYWH(0, 0, 50.3f, 50.3f), SkRegion::kReplace_Op, true); SkIRect inflatedIBounds = SkIRect::MakeXYWH(0, 0, 100, 100); GrReducedClip::ElementList reducedClips; @@ -1032,39 +1032,37 @@ static void test_reduced_clip_stack_genid(skiatest::Reporter* reporter) { // A B // C D - stack.clipDevRect(SkRect::MakeXYWH(0, 0, 25.3, 25.3), SkRegion::kReplace_Op, true); + stack.clipDevRect(SkRect::MakeXYWH(0, 0, 25.3f, 25.3f), SkRegion::kReplace_Op, true); int32_t genIDA = stack.getTopmostGenID(); - stack.clipDevRect(SkRect::MakeXYWH(50, 0, 25.3, 25.3), SkRegion::kUnion_Op, true); + stack.clipDevRect(SkRect::MakeXYWH(50, 0, 25.3f, 25.3f), SkRegion::kUnion_Op, true); int32_t genIDB = stack.getTopmostGenID(); - stack.clipDevRect(SkRect::MakeXYWH(0, 50, 25.3, 25.3), SkRegion::kUnion_Op, true); + stack.clipDevRect(SkRect::MakeXYWH(0, 50, 25.3f, 25.3f), SkRegion::kUnion_Op, true); int32_t genIDC = stack.getTopmostGenID(); - stack.clipDevRect(SkRect::MakeXYWH(50, 50, 25.3, 25.3), SkRegion::kUnion_Op, true); + stack.clipDevRect(SkRect::MakeXYWH(50, 50, 25.3f, 25.3f), SkRegion::kUnion_Op, true); int32_t genIDD = stack.getTopmostGenID(); +#define XYWH SkIRect::MakeXYWH + + SkIRect unused; + unused.setEmpty(); + SkIRect stackBounds = XYWH(0, 0, 76, 76); + // The base test is to test each rect in two ways: // 1) The box dimensions. (Should reduce to "all in", no elements). // 2) A bit over the box dimensions. // In the case 2, test that the generation id is what is expected. // The rects are of fractional size so that case 2 never gets optimized to an empty element // list. - + // Not passing in tighter bounds is tested for consistency. - struct GenIDTestCase { + struct { SkIRect testBounds; int reducedClipCount; int32_t reducedGenID; GrReducedClip::InitialState initialState; SkIRect tighterBounds; // If this is empty, the query will not pass tighter bounds - // parameter. - }; - -#define XYWH SkIRect::MakeXYWH - - SkIRect unused; - unused.setEmpty(); - SkIRect stackBounds = XYWH(0, 0, 76, 76); - - GenIDTestCase testCases[] = { + // parameter. + } testCases[] = { // Rect A. { XYWH(0, 0, 25, 25), 0, SkClipStack::kWideOpenGenID, GrReducedClip::kAllIn_InitialState, XYWH(0, 0, 25, 25) }, { XYWH(0, 0, 25, 25), 0, SkClipStack::kWideOpenGenID, GrReducedClip::kAllIn_InitialState, unused }, |