Shut up some Mac (xcode 3) warnings
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 5 Sep 2012 17:40:04 +0000 (17:40 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 5 Sep 2012 17:40:04 +0000 (17:40 +0000)
Review URL: http://codereview.appspot.com/6503053/

git-svn-id: http://skia.googlecode.com/svn/trunk@5402 2bbb7eff-a529-9590-31e7-b0007b416f81

13 files changed:
experimental/Debugger/DebuggerContentView.cpp
gm/gradtext.cpp
src/animator/SkScriptTokenizer.cpp
src/core/SkBitmapProcState_shaderproc.h
src/core/SkPixelRef.cpp
src/effects/gradients/SkTwoPointConicalGradient.cpp
src/gpu/GrClipMaskManager.cpp
src/gpu/gl/GrGLProgram.cpp
src/gpu/gl/GrGpuGL.cpp
src/utils/SkDeferredCanvas.cpp
tests/ClipStackTest.cpp
tests/DeferredCanvasTest.cpp
tools/skdiff_main.cpp

index 02ea404c0b79879e389b147dd201cdf2e942dd4f..8039e57faa5653ce4931aeb794590854c13a5069 100644 (file)
@@ -258,10 +258,14 @@ private:
 
 ///////////////////////////////////////////////////////////////////////////////
 
+SkView* create_debugger(const char* data, size_t size);
+
 SkView* create_debugger(const char* data, size_t size) {
     return SkNEW_ARGS(DebuggerView, (data, size));
 };
 
+bool is_debugger(SkView* view);
+
 bool is_debugger(SkView* view) {
     SkEvent isDebugger(gIsDebuggerQuery);
     return view->doQuery(&isDebugger);
index f26222af0b94a0bc1b5f6a95c15228d02a6bb6cd..d080e3e9c1c57c5f78c7539cfdd9f4b475f61eb4 100644 (file)
@@ -47,7 +47,6 @@ protected:
     virtual SkISize onISize() { return make_isize(500, 480); }
     virtual void onDraw(SkCanvas* canvas) {
         SkPaint paint;
-        const SkISize& size = this->getISize();
         SkRect r = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100));
 
         canvas->clipRect(r);
@@ -76,7 +75,6 @@ protected:
     virtual SkISize onISize() { return make_isize(500, 480); }
     virtual void onDraw(SkCanvas* canvas) {
         SkPaint paint;
-        const SkISize& size = this->getISize();
         SkRect r = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100));
 
 
index 9547a988b2f7c4e35b2d817440226c61281327cb..a1de5e579261533ab3b714a675d9c6dd17a3d30a 100644 (file)
@@ -1276,8 +1276,8 @@ bool SkScriptEngine2::ValueToString(const SkScriptValue2& value, SkString* strin
 
 #define testInt(expression) { #expression, SkOperand2::kS32, expression, 0, NULL }
 #ifdef SK_SCALAR_IS_FLOAT
-#define testScalar(expression) { #expression, SkOperand2::kScalar, 0, (float) expression, NULL }
-#define testRemainder(exp1, exp2) { #exp1 "%" #exp2, SkOperand2::kScalar, 0, fmodf(exp1, exp2), NULL }
+#define testScalar(expression) { #expression, SkOperand2::kScalar, 0, (float) (expression), NULL }
+#define testRemainder(exp1, exp2) { #exp1 "%" #exp2, SkOperand2::kScalar, 0, fmodf((float) exp1, (float) exp2), NULL }
 #else
 #define testScalar(expression) { #expression, SkOperand2::kScalar, 0, (int) ((expression) * 65536.0f), NULL }
 #define testRemainder(exp1, exp2) { #exp1 "%" #exp2, SkOperand2::kScalar, 0, (int) (fmod(exp1, exp2)  * 65536.0f), NULL }
index 6f2bbe722dc6ff03bfb4824d8d9dfc38c7419e12..cf15a505988a2988d84c0cbe6a2d046110aa56c9 100644 (file)
@@ -12,6 +12,9 @@
 
 // Can't be static in the general case because some of these implementations
 // will be defined and referenced in different object files.
+void SCALE_FILTER_NAME(const SkBitmapProcState& s, int x, int y,
+                       DSTTYPE* SK_RESTRICT colors, int count);
+
 void SCALE_FILTER_NAME(const SkBitmapProcState& s, int x, int y,
                        DSTTYPE* SK_RESTRICT colors, int count) {
     SkASSERT((s.fInvType & ~(SkMatrix::kTranslate_Mask |
index f71458b7dd1f6b32395b4d444fec286b7397f6ff..69bbad7502efeac518e91b2b09fc85f959ac9a46 100644 (file)
@@ -34,6 +34,8 @@ static SkBaseMutex* get_default_mutex() {
 
 ///////////////////////////////////////////////////////////////////////////////
 
+int32_t SkNextPixelRefGenerationID();
+
 int32_t SkNextPixelRefGenerationID() {
     static int32_t  gPixelRefGenerationID;
     // do a loop in case our global wraps around, as we never want to
index c84989b67fda5419a2aa4b053989a7a94d1f84a6..38733f3b1f9acb1024ea7d8567264a426c59c6fc 100644 (file)
@@ -188,7 +188,7 @@ void SkTwoPointConicalGradient::shadeSpan(int x, int y, SkPMColor* dstCParam,
     SkPMColor* SK_RESTRICT dstC = dstCParam;
 
     SkMatrix::MapXYProc dstProc = fDstToIndexProc;
-    TileProc            proc = fTileProc;
+
     const SkPMColor* SK_RESTRICT cache = this->getCache32();
 
     TwoPointRadialProc shadeProc = twopoint_repeat;
@@ -254,8 +254,6 @@ bool SkTwoPointConicalGradient::setContext(const SkBitmap& device,
 SkShader::BitmapType SkTwoPointConicalGradient::asABitmap(
     SkBitmap* bitmap, SkMatrix* matrix, SkShader::TileMode* xy) const {
     SkPoint diff = fCenter2 - fCenter1;
-    SkScalar diffRadius = fRadius2 - fRadius1;
-    SkScalar startRadius = fRadius1;
     SkScalar diffLen = 0;
 
     if (bitmap) {
index c4c2edf17bcae823a65020e176ee9ba78af10a6e..5e1bd362b7109a4fc77cfbff19bbbe5e73a44d63 100644 (file)
@@ -159,9 +159,9 @@ bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn) {
         return false;
     }
 
+#if GR_SW_CLIP
     bool requiresAA = requires_AA(*clipDataIn->fClipStack);
 
-#if GR_SW_CLIP
     // If MSAA is enabled we can do everything in the stencil buffer.
     // Otherwise check if we should just create the entire clip mask
     // in software (this will only happen if the clip mask is anti-aliased
index ff29bd402852b7afe30d0af935c663548fe9560e..664f1c02fd0f9e89d25afcbc960759c82edd382e 100644 (file)
@@ -947,7 +947,7 @@ void GrGLProgram::genStageCode(int stageNum,
     } else {
         uniforms.fTextureMatrixUni = builder->addUniform(GrGLShaderBuilder::kVertex_ShaderType,
                                                          kMat33f_GrSLType, "TexM", &matName);
-        const GrGLShaderVar& mat = builder->getUniformVariable(uniforms.fTextureMatrixUni);
+        builder->getUniformVariable(uniforms.fTextureMatrixUni);
 
         if (desc.fOptFlags & StageDesc::kNoPerspective_OptFlagBit) {
             texCoordVaryingType = kVec2f_GrSLType;
index 33c79b401b16256c8ca3ec989850b69e7674cd5d..8d55abb01764ed71f75df52cc268e3a44a25bcca 100644 (file)
@@ -1655,12 +1655,14 @@ void GrGpuGL::onGpuDrawNonIndexed(GrPrimitiveType type,
 }
 
 namespace {
+
+static const uint16_t kOnes16 = static_cast<uint16_t>(~0);
 const GrStencilSettings& winding_nv_path_stencil_settings() {
     GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings,
         kIncClamp_StencilOp,
         kIncClamp_StencilOp,
         kAlwaysIfInClip_StencilFunc,
-        ~0, ~0, ~0);
+        kOnes16, kOnes16, kOnes16);
     return *GR_CONST_STENCIL_SETTINGS_PTR_FROM_STRUCT_PTR(&gSettings);
 }
 const GrStencilSettings& even_odd_nv_path_stencil_settings() {
@@ -1668,7 +1670,7 @@ const GrStencilSettings& even_odd_nv_path_stencil_settings() {
         kInvert_StencilOp,
         kInvert_StencilOp,
         kAlwaysIfInClip_StencilFunc,
-        ~0, ~0, ~0);
+        kOnes16, kOnes16, kOnes16);
     return *GR_CONST_STENCIL_SETTINGS_PTR_FROM_STRUCT_PTR(&gSettings);
 }
 }
index 81ebcbdc8083ef78b5d458236eead8d333bbc1f6..bbd3ae88010f7f205945b1eb7f285d505d868750 100644 (file)
@@ -470,7 +470,7 @@ void DeferredDevice::recordedDrawCommand() {
             this->flushPending();
             // Free as much as possible to avoid oscillating around fMaxRecordingStorageBytes
             // which could cause a high flushing frequency.
-            this->freeMemoryIfPossible(~0);
+            this->freeMemoryIfPossible(~0U);
         }
         storageAllocated = this->storageAllocatedForRecording();
     }
index 19e28ad64783bc524c871013f9be45c64b762212..8a74dc8712f5a99a7fdfd56619965a037d19f93c 100644 (file)
@@ -354,7 +354,7 @@ static void test_isWideOpen(skiatest::Reporter* reporter) {
     }
 }
 
-int count(const SkClipStack& stack) {
+static int count(const SkClipStack& stack) {
 
     SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart);
 
index 5eda56832f786bc9271b66bb95410cdb3bc96100..95b3f7353c1c7099d6a23addb9d9c7d4f349dfab 100644 (file)
@@ -260,7 +260,7 @@ static void TestDeferredCanvasBitmapCaching(skiatest::Reporter* reporter) {
     REPORTER_ASSERT(reporter, canvas.storageAllocatedForRecording() > bitmapSize);
 
     // verify that nothing can be freed at this point
-    REPORTER_ASSERT(reporter, 0 == canvas.freeMemoryIfPossible(~0));
+    REPORTER_ASSERT(reporter, 0 == canvas.freeMemoryIfPossible(~0U));
 
     // verify that flush leaves image in cache
     REPORTER_ASSERT(reporter, 0 == notificationCounter.fFlushedDrawCommandsCount);
@@ -271,7 +271,7 @@ static void TestDeferredCanvasBitmapCaching(skiatest::Reporter* reporter) {
     REPORTER_ASSERT(reporter, canvas.storageAllocatedForRecording() >= bitmapSize);
 
     // verify that after a flush, cached image can be freed
-    REPORTER_ASSERT(reporter, canvas.freeMemoryIfPossible(~0) >= bitmapSize);
+    REPORTER_ASSERT(reporter, canvas.freeMemoryIfPossible(~0U) >= bitmapSize);
 
     // Verify that caching works for avoiding multiple copies of the same bitmap
     canvas.drawBitmap(sourceImages[0], 0, 0, NULL);
@@ -294,18 +294,18 @@ static void TestDeferredCanvasBitmapCaching(skiatest::Reporter* reporter) {
 
     // Verifiy that partial purge works, image zero is in cache but not reffed by
     // a pending draw, while image 1 is locked-in.
-    canvas.freeMemoryIfPossible(~0);
+    canvas.freeMemoryIfPossible(~0U);
     REPORTER_ASSERT(reporter, 2 == notificationCounter.fFlushedDrawCommandsCount);
     canvas.drawBitmap(sourceImages[0], 0, 0, NULL);
     canvas.flush();
     canvas.drawBitmap(sourceImages[1], 0, 0, NULL);
-    bytesFreed = canvas.freeMemoryIfPossible(~0);
+    bytesFreed = canvas.freeMemoryIfPossible(~0U);
     // only one bitmap should have been freed.
     REPORTER_ASSERT(reporter,  bytesFreed >= bitmapSize);
     REPORTER_ASSERT(reporter,  bytesFreed < 2*bitmapSize);
     // Clear for next test
     canvas.flush();
-    canvas.freeMemoryIfPossible(~0);
+    canvas.freeMemoryIfPossible(~0U);
     REPORTER_ASSERT(reporter, canvas.storageAllocatedForRecording() < bitmapSize);
 
     // Verify the image cache is sensitive to genID bumps
index aa31ec94e84c719416e8d7d5cf81c3a7cb529811..5fbf3ff515d0db3452d6d821f0a23fea1c43fa46 100644 (file)
@@ -57,7 +57,7 @@ enum Result {
 // Returns the Result with this name.
 // If there is no Result with this name, returns kNumResultTypes.
 // TODO: Is there a better return value for the fall-through case?
-Result getResultByName(const char *name) {
+static Result getResultByName(const char *name) {
     if (0 == strcmp("EqualBits", name)) {
         return kEqualBits;
     }
@@ -86,7 +86,7 @@ Result getResultByName(const char *name) {
 }
 
 // Returns a text description of the given Result type.
-const char *getResultDescription(Result result) {
+static const char *getResultDescription(Result result) {
     switch (result) {
       case kEqualBits:
         return "contain exactly the same bits";