diff options
author | humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-07 19:54:40 +0000 |
---|---|---|
committer | humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-07 19:54:40 +0000 |
commit | 0e51577a14f903ffeafa117a75954baeb173ffb9 (patch) | |
tree | 3f3d849f3b6ec7778660f0da19f5d4175ba9f800 /samplecode | |
parent | af2bd7bdf593b3fc91bb1acffcc4a51bdb2f29ec (diff) |
fix warning from scalar --> int32 conversion
BUG=
Review URL: https://codereview.appspot.com/7065050
git-svn-id: http://skia.googlecode.com/svn/trunk@7061 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode')
-rw-r--r-- | samplecode/SampleAAClip.cpp | 2 | ||||
-rw-r--r-- | samplecode/SampleColorFilter.cpp | 5 | ||||
-rw-r--r-- | samplecode/SampleRegion.cpp | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/samplecode/SampleAAClip.cpp b/samplecode/SampleAAClip.cpp index 196641e201..617d786069 100644 --- a/samplecode/SampleAAClip.cpp +++ b/samplecode/SampleAAClip.cpp @@ -18,7 +18,7 @@ static void testop(const SkIRect& r0, const SkIRect& r1, SkRegion::Op op, c1.setRect(r1); c2.op(c0, c1, op); - SkIRect r2 = c2.getBounds(); + SkDEBUGCODE(SkIRect r2 = c2.getBounds()); SkASSERT(r2 == expectedR); } diff --git a/samplecode/SampleColorFilter.cpp b/samplecode/SampleColorFilter.cpp index e57ccb0d43..393f9b8c4f 100644 --- a/samplecode/SampleColorFilter.cpp +++ b/samplecode/SampleColorFilter.cpp @@ -23,6 +23,7 @@ static int trunc5(int x) { #define SK_R16_BITS 5 +#ifdef SK_DEBUG static int round5_slow(int x) { int orig = x & 7; int fake = x >> 5; @@ -38,15 +39,17 @@ static int round5_slow(int x) { } return trunc + bias; } +#endif static int round5_fast(int x) { int result = x + 3 - (x >> 5) + (x >> 7); result >>= 3; - +#ifdef SK_DEBUG { int r2 = round5_slow(x); SkASSERT(r2 == result); } +#endif return result; } diff --git a/samplecode/SampleRegion.cpp b/samplecode/SampleRegion.cpp index 8b3a03c8c6..b493ee4b60 100644 --- a/samplecode/SampleRegion.cpp +++ b/samplecode/SampleRegion.cpp @@ -274,13 +274,13 @@ protected: { char buffer[1000]; - size_t size = tmp.writeToMemory(NULL); + SkDEBUGCODE(size_t size = ) tmp.writeToMemory(NULL); SkASSERT(size <= sizeof(buffer)); - size_t size2 = tmp.writeToMemory(buffer); + SkDEBUGCODE(size_t size2 = ) tmp.writeToMemory(buffer); SkASSERT(size == size2); SkRegion tmp3; - size2 = tmp3.readFromMemory(buffer); + SkDEBUGCODE(size2 = ) tmp3.readFromMemory(buffer); SkASSERT(size == size2); SkASSERT(tmp3 == tmp); |