Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning""

This reverts commit 1e787c38fa71f2a21fd728f1b1d620b9b09b0d3d.

BUG=

Review URL: https://codereview.chromium.org/54603004

git-svn-id: http://skia.googlecode.com/svn/trunk@12057 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 3e22069..59b6482 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -96,20 +96,19 @@
     */
     bool isNull() const { return NULL == fPixelRef; }
 
-    /** Return the config for the bitmap.
-    */
+    /** Return the config for the bitmap. */
     Config  config() const { return (Config)fConfig; }
-    /** DEPRECATED, use config()
-    */
+
+    SK_ATTR_DEPRECATED("use config()")
     Config  getConfig() const { return this->config(); }
-    /** Return the bitmap's width, in pixels.
-    */
+
+    /** Return the bitmap's width, in pixels. */
     int width() const { return fWidth; }
-    /** Return the bitmap's height, in pixels.
-    */
+
+    /** Return the bitmap's height, in pixels. */
     int height() const { return fHeight; }
-    /** Return the number of bytes between subsequent rows of the bitmap.
-    */
+
+    /** Return the number of bytes between subsequent rows of the bitmap. */
     size_t rowBytes() const { return fRowBytes; }
 
     /** Return the shift amount per pixel (i.e. 0 for 1-byte per pixel, 1 for
@@ -189,9 +188,7 @@
         return SkAlphaTypeIsOpaque(this->alphaType());
     }
 
-    /**
-     *  DEPRECATED: use setAlpahType() instead.
-     */
+    SK_ATTR_DEPRECATED("use setAlphaType")
     void setIsOpaque(bool opaque) {
         this->setAlphaType(opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
     }
@@ -419,7 +416,7 @@
      */
     void eraseARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) const;
 
-    // DEPRECATED -- call eraseColor or eraseARGB
+    SK_ATTR_DEPRECATED("use eraseARGB or eraseColor")
     void eraseRGB(U8CPU r, U8CPU g, U8CPU b) const {
         this->eraseARGB(0xFF, r, g, b);
     }
@@ -553,9 +550,7 @@
      */
     bool canCopyTo(Config newConfig) const;
 
-    /**
-     *  DEPRECATED -- will be replaced with API on SkPaint
-     */
+    SK_ATTR_DEPRECATED("use setFilterLevel on SkPaint")
     void buildMipMap(bool forceRebuild = false);
 
 #ifdef SK_BUILD_FOR_ANDROID
diff --git a/include/core/SkBitmapDevice.h b/include/core/SkBitmapDevice.h
index a288f8a..530b85c 100644
--- a/include/core/SkBitmapDevice.h
+++ b/include/core/SkBitmapDevice.h
@@ -87,7 +87,7 @@
 
     /** Return the bitmap config of the device's pixels
     */
-    virtual SkBitmap::Config config() const SK_OVERRIDE { return fBitmap.getConfig(); }
+    virtual SkBitmap::Config config() const SK_OVERRIDE { return fBitmap.config(); }
 
     /**
      *  DEPRECATED: This will be made protected once WebKit stops using it.
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index dc3953e..d0b8fc9 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -57,7 +57,7 @@
     */
     explicit SkCanvas(SkBaseDevice* device);
 
-    /** Deprecated - Construct a canvas with the specified bitmap to draw into.
+    /** Construct a canvas with the specified bitmap to draw into.
         @param bitmap   Specifies a bitmap for the canvas to draw into. Its
                         structure are copied to the canvas.
     */
@@ -942,11 +942,10 @@
     */
     ClipType getClipType() const;
 
-    /** Return the current device clip (concatenation of all clip calls).
+    /** DEPRECATED -- need to move this guy to private/friend
+     *  Return the current device clip (concatenation of all clip calls).
      *  This does not account for the translate in any of the devices.
      *  @return the current device clip (concatenation of all clip calls).
-     *
-     *  DEPRECATED -- call getClipDeviceBounds() instead.
      */
     const SkRegion& getTotalClip() const;
 
@@ -1034,8 +1033,8 @@
     // can perform copy-on-write or invalidate any cached images
     void predrawNotify();
 
-    /** DEPRECATED -- use constructor(device)
-
+    /**
+     DEPRECATED -- need to remove when subclass stop relying on it.
      Marked as 'protected' to avoid new clients using this before we can
      completely remove it.
 
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index ed1c8fd..22a56d0 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -90,8 +90,9 @@
     */
     virtual bool isOpaque() const = 0;
 
-    /** DEPRECATED - Return the bitmap config of the device's pixels
+    /** Return the bitmap config of the device's pixels
      */
+    SK_ATTR_DEPRECATED("want to hide configness of the device -- don't use")
     virtual SkBitmap::Config config() const = 0;
 
     /** Return the bitmap associated with this device. Call this each time you need
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index 6c3a10f..1244795 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -304,18 +304,18 @@
     void setFilterLevel(FilterLevel);
 
     /**
-     *  DEPRECATED: use setFilterLevel instead.
      *  If the predicate is true, set the filterLevel to Low, else set it to
      *  None.
      */
+    SK_ATTR_DEPRECATED("use setFilterLevel")
     void setFilterBitmap(bool doFilter) {
         this->setFilterLevel(doFilter ? kLow_FilterLevel : kNone_FilterLevel);
     }
 
     /**
-     *  DEPRECATED: call getFilterLevel() instead.
      *  Returns true if getFilterLevel() returns anything other than None.
      */
+    SK_ATTR_DEPRECATED("use getFilterLevel")
     bool isFilterBitmap() const {
         return kNone_FilterLevel != this->getFilterLevel();
     }
@@ -638,9 +638,8 @@
     /**
      *  Returns true if there is an annotation installed on this paint, and
      *  the annotation specifics no-drawing.
-     *
-     *  Deprecated: all annotations are no-draw.  Please just check getAnnotation().
      */
+    SK_ATTR_DEPRECATED("use getAnnotation and check for non-null")
     bool isNoDrawAnnotation() const { return this->getAnnotation() != NULL; }
 
     /**
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index 02e3423..785eb77 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -123,7 +123,6 @@
     void setConvexity(Convexity);
 
     /**
-     *  DEPRECATED: use getConvexity()
      *  Returns true if the path is flagged as being convex. This is not a
      *  confirmed by any analysis, it is just the value set earlier.
      */
@@ -132,12 +131,12 @@
     }
 
     /**
-     *  DEPRECATED: use setConvexity()
      *  Set the isConvex flag to true or false. Convex paths may draw faster if
      *  this flag is set, though setting this to true on a path that is in fact
      *  not convex can give undefined results when drawn. Paths default to
      *  isConvex == false
      */
+    SK_ATTR_DEPRECATED("use setConvexity")
     void setIsConvex(bool isConvex) {
         this->setConvexity(isConvex ? kConvex_Convexity : kConcave_Convexity);
     }
diff --git a/include/core/SkPoint.h b/include/core/SkPoint.h
index 5eca72f..b94f730 100644
--- a/include/core/SkPoint.h
+++ b/include/core/SkPoint.h
@@ -353,7 +353,7 @@
     /** Return true if this point and the given point are far enough apart
         such that a vector between them would be non-degenerate.
 
-        WARNING: Unlike the deprecated version of equalsWithinTolerance(),
+        WARNING: Unlike the explicit tolerance version,
         this method does not use componentwise comparison.  Instead, it
         uses a comparison designed to match judgments elsewhere regarding
         degeneracy ("points A and B are so close that the vector between them
@@ -363,10 +363,7 @@
         return !CanNormalize(fX - p.fX, fY - p.fY);
     }
 
-    /** DEPRECATED: Return true if this and the given point are componentwise
-        within tolerance "tol".
-
-        WARNING: There is no guarantee that the result will reflect judgments
+    /** WARNING: There is no guarantee that the result will reflect judgments
         elsewhere regarding degeneracy ("points A and B are so close that the
         vector between them is essentially zero").
     */
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index 0c2358a..61998f6 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -374,6 +374,11 @@
     #define SK_UNUSED SK_ATTRIBUTE(unused)
 #endif
 
+#if !defined(SK_ATTR_DEPRECATED)
+    // we ignore msg for now...
+    #define SK_ATTR_DEPRECATED(msg) SK_ATTRIBUTE(deprecated)
+#endif
+
 //////////////////////////////////////////////////////////////////////
 
 #ifndef SK_PRINTF_LIKE
diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h
index db40f69..ab995d7 100644
--- a/include/core/SkPreConfig.h
+++ b/include/core/SkPreConfig.h
@@ -14,6 +14,13 @@
     #include "config.h"
 #endif
 
+// Allows embedders that want to disable macros that take arguments to just
+// define that symbol to be one of these
+//
+#define SK_NOTHING_ARG1(arg1)
+#define SK_NOTHING_ARG2(arg1, arg2)
+#define SK_NOTHING_ARG3(arg1, arg2, arg3)
+
 //////////////////////////////////////////////////////////////////////
 
 #if !defined(SK_BUILD_FOR_ANDROID) && !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_PALM) && !defined(SK_BUILD_FOR_WINCE) && !defined(SK_BUILD_FOR_WIN32) && !defined(SK_BUILD_FOR_UNIX) && !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_SDL) && !defined(SK_BUILD_FOR_BREW) && !defined(SK_BUILD_FOR_NACL)
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index d9ac3a6..98acb1c 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -401,7 +401,7 @@
         return r;
     }
 
-    // DEPRECATED: call Make(r)
+    SK_ATTR_DEPRECATED("use Make()")
     static SkRect SK_WARN_UNUSED_RESULT MakeFromIRect(const SkIRect& irect) {
         SkRect r;
         r.set(SkIntToScalar(irect.fLeft),
diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h
index ba8893e..9fb1f7b 100644
--- a/include/core/SkWriter32.h
+++ b/include/core/SkWriter32.h
@@ -46,7 +46,8 @@
 
     // return the current offset (will always be a multiple of 4)
     size_t bytesWritten() const { return fSize; }
-    // DEPRECATED: use bytesWritten instead  TODO(mtklein): clean up
+
+    SK_ATTR_DEPRECATED("use bytesWritten")
     size_t size() const { return this->bytesWritten(); }
 
     // Returns true if we've written only into the storage passed into constructor or reset.
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h
index 5bf8a22..3ef2241 100644
--- a/include/core/SkXfermode.h
+++ b/include/core/SkXfermode.h
@@ -186,7 +186,7 @@
      */
     static bool ModeAsCoeff(Mode mode, Coeff* src, Coeff* dst);
 
-    // DEPRECATED: call AsMode(...)
+    SK_ATTR_DEPRECATED("use AsMode(...)")
     static bool IsMode(const SkXfermode* xfer, Mode* mode) {
         return AsMode(xfer, mode);
     }
diff --git a/include/effects/SkBlurDrawLooper.h b/include/effects/SkBlurDrawLooper.h
index 8e0c2dd..013e807 100644
--- a/include/effects/SkBlurDrawLooper.h
+++ b/include/effects/SkBlurDrawLooper.h
@@ -38,7 +38,7 @@
     SkBlurDrawLooper(SkColor color, SkScalar sigma, SkScalar dx, SkScalar dy,
                      uint32_t flags = kNone_BlurFlag);
 
-    // DEPRECATED - radius-based
+//    SK_ATTR_DEPRECATED("use sigma version")
     SkBlurDrawLooper(SkScalar radius, SkScalar dx, SkScalar dy, SkColor color,
                      uint32_t flags = kNone_BlurFlag);
     virtual ~SkBlurDrawLooper();
diff --git a/include/effects/SkBlurMaskFilter.h b/include/effects/SkBlurMaskFilter.h
index d590b27..9b352dc 100644
--- a/include/effects/SkBlurMaskFilter.h
+++ b/include/effects/SkBlurMaskFilter.h
@@ -33,9 +33,7 @@
         kAll_BlurFlag = 0x03
     };
 
-    /**
-     *  DEPRECATED - radius-based
-     */
+    SK_ATTR_DEPRECATED("use sigma version")
     static SkMaskFilter* Create(SkScalar radius, BlurStyle style,
                                 uint32_t flags = kNone_BlurFlag);
 
@@ -59,7 +57,7 @@
     static SkMaskFilter* CreateEmboss(SkScalar blurSigma, const SkScalar direction[3],
                                       SkScalar ambient, SkScalar specular);
 
-    // DEPRECATED - radius-based
+    SK_ATTR_DEPRECATED("use sigma version")
     static SkMaskFilter* CreateEmboss(const SkScalar direction[3],
                                       SkScalar ambient, SkScalar specular,
                                       SkScalar blurRadius);
diff --git a/include/effects/SkEmbossMaskFilter.h b/include/effects/SkEmbossMaskFilter.h
index 4b5bd6f..7210b78 100644
--- a/include/effects/SkEmbossMaskFilter.h
+++ b/include/effects/SkEmbossMaskFilter.h
@@ -25,7 +25,7 @@
 
     SkEmbossMaskFilter(SkScalar blurSigma, const Light& light);
 
-    // DEPRECATED - radius-based
+    SK_ATTR_DEPRECATED("use sigma version")
     SkEmbossMaskFilter(const Light& light, SkScalar blurRadius);
 
     // overrides from SkMaskFilter
diff --git a/include/effects/SkPorterDuff.h b/include/effects/SkPorterDuff.h
index c5f5492..e984e8e 100644
--- a/include/effects/SkPorterDuff.h
+++ b/include/effects/SkPorterDuff.h
@@ -13,8 +13,6 @@
 
 class SkXfermode;
 
-/** DEPRECATED - use SkXfermode::Mode instead
- */
 class SK_API SkPorterDuff {
 public:
     /** List of predefined xfermodes. In general, the algebra for the modes
@@ -76,6 +74,6 @@
     /** Return the corersponding SkXfermode::Mode
      */
     static SkXfermode::Mode ToXfermodeMode(Mode);
-};
+} SK_ATTR_DEPRECATED("use SkXfermode::Mode");
 
 #endif
diff --git a/include/effects/SkRectShaderImageFilter.h b/include/effects/SkRectShaderImageFilter.h
index 650a583..ea97478 100644
--- a/include/effects/SkRectShaderImageFilter.h
+++ b/include/effects/SkRectShaderImageFilter.h
@@ -25,7 +25,9 @@
      *               If NULL or a given crop edge is not specified, the source
      *               primitive's bounds are used instead.
      */
-    /* DEPRECATED */ static SkRectShaderImageFilter* Create(SkShader* s, const SkRect& rect);
+    SK_ATTR_DEPRECATED("use Create(SkShader*, const CropRect*)")
+    static SkRectShaderImageFilter* Create(SkShader* s, const SkRect& rect);
+
     static SkRectShaderImageFilter* Create(SkShader* s, const CropRect* rect = NULL);
     virtual ~SkRectShaderImageFilter();
 
diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h
index 0862514..29f59f2 100644
--- a/include/gpu/SkGpuDevice.h
+++ b/include/gpu/SkGpuDevice.h
@@ -43,16 +43,16 @@
     SkGpuDevice(GrContext*, SkBitmap::Config, int width, int height, int sampleCount = 0);
 
     /**
+     *  DEPRECATED -- need to make this private, call Create(surface)
      *  New device that will render to the specified renderTarget.
-     *  DEPRECATED: Use Create(surface)
      */
     SkGpuDevice(GrContext*, GrRenderTarget*);
 
     /**
+     *  DEPRECATED -- need to make this private, call Create(surface)
      *  New device that will render to the texture (as a rendertarget).
      *  The GrTexture's asRenderTarget() must be non-NULL or device will not
      *  function.
-     *  DEPRECATED: Use Create(surface)
      */
     SkGpuDevice(GrContext*, GrTexture*);
 
diff --git a/include/utils/SkMatrix44.h b/include/utils/SkMatrix44.h
index 9282770..26247a0 100644
--- a/include/utils/SkMatrix44.h
+++ b/include/utils/SkMatrix44.h
@@ -112,7 +112,7 @@
     SkMatrix44(Uninitialized_Constructor) { }
     SkMatrix44(Identity_Constructor) { this->setIdentity(); }
 
-    // DEPRECATED: use the constructors that take an enum
+    SK_ATTR_DEPRECATED("use the constructors that take an enum")
     SkMatrix44() { this->setIdentity(); }
 
     SkMatrix44(const SkMatrix44& src) {
@@ -335,11 +335,12 @@
         this->mapScalars(vec, vec);
     }
 
-    // DEPRECATED: call mapScalars()
+    SK_ATTR_DEPRECATED("use mapScalars")
     void map(const SkScalar src[4], SkScalar dst[4]) const {
         this->mapScalars(src, dst);
     }
-    // DEPRECATED: call mapScalars()
+
+    SK_ATTR_DEPRECATED("use mapScalars")
     void map(SkScalar vec[4]) const {
         this->mapScalars(vec, vec);
     }
@@ -357,7 +358,7 @@
 
     friend SkVector4 operator*(const SkMatrix44& m, const SkVector4& src) {
         SkVector4 dst;
-        m.map(src.fData, dst.fData);
+        m.mapScalars(src.fData, dst.fData);
         return dst;
     }