diff options
author | 2013-10-31 17:28:30 +0000 | |
---|---|---|
committer | 2013-10-31 17:28:30 +0000 | |
commit | 4469938e92d779dff05e745559e67907bbf21e78 (patch) | |
tree | c87072ff8cef5709436279a1f771160511debd2a /include | |
parent | 6fcbfcead5dc1b61fa5b4c139a1a3714e8c58091 (diff) |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkBitmap.h | 29 | ||||
-rw-r--r-- | include/core/SkBitmapDevice.h | 2 | ||||
-rw-r--r-- | include/core/SkCanvas.h | 11 | ||||
-rw-r--r-- | include/core/SkDevice.h | 3 | ||||
-rw-r--r-- | include/core/SkPaint.h | 7 | ||||
-rw-r--r-- | include/core/SkPath.h | 3 | ||||
-rw-r--r-- | include/core/SkPoint.h | 7 | ||||
-rw-r--r-- | include/core/SkPostConfig.h | 5 | ||||
-rw-r--r-- | include/core/SkPreConfig.h | 7 | ||||
-rw-r--r-- | include/core/SkRect.h | 2 | ||||
-rw-r--r-- | include/core/SkWriter32.h | 3 | ||||
-rw-r--r-- | include/core/SkXfermode.h | 2 | ||||
-rw-r--r-- | include/effects/SkBlurDrawLooper.h | 2 | ||||
-rw-r--r-- | include/effects/SkBlurMaskFilter.h | 6 | ||||
-rw-r--r-- | include/effects/SkEmbossMaskFilter.h | 2 | ||||
-rw-r--r-- | include/effects/SkPorterDuff.h | 4 | ||||
-rw-r--r-- | include/effects/SkRectShaderImageFilter.h | 4 | ||||
-rw-r--r-- | include/gpu/SkGpuDevice.h | 4 | ||||
-rw-r--r-- | include/utils/SkMatrix44.h | 9 |
19 files changed, 57 insertions, 55 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 3e22069e60..59b6482735 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -96,20 +96,19 @@ public: */ 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 @@ public: 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 @@ public: */ 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 @@ public: */ 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 a288f8a3e2..530b85c9f8 100644 --- a/include/core/SkBitmapDevice.h +++ b/include/core/SkBitmapDevice.h @@ -87,7 +87,7 @@ public: /** 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 dc3953ed4b..d0b8fc94be 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -57,7 +57,7 @@ public: */ 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 @@ public: */ 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 @@ protected: // 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 ed1c8fd63b..22a56d007d 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -90,8 +90,9 @@ public: */ 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 6c3a10f9ef..1244795819 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -304,18 +304,18 @@ public: 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 @@ public: /** * 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 02e3423550..785eb7793f 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -123,7 +123,6 @@ public: 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 @@ public: } /** - * 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 5eca72f6b6..b94f730ec2 100644 --- a/include/core/SkPoint.h +++ b/include/core/SkPoint.h @@ -353,7 +353,7 @@ struct SK_API SkPoint { /** 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 @@ struct SK_API SkPoint { 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 0c2358aeb8..61998f621a 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 db40f695b0..ab995d7aa8 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 d9ac3a6910..98acb1cda3 100644 --- a/include/core/SkRect.h +++ b/include/core/SkRect.h @@ -401,7 +401,7 @@ struct SK_API SkRect { 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 ba8893eab9..9fb1f7b85b 100644 --- a/include/core/SkWriter32.h +++ b/include/core/SkWriter32.h @@ -46,7 +46,8 @@ public: // 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 5bf8a22517..3ef2241c7d 100644 --- a/include/core/SkXfermode.h +++ b/include/core/SkXfermode.h @@ -186,7 +186,7 @@ public: */ 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 8e0c2dd001..013e80714f 100644 --- a/include/effects/SkBlurDrawLooper.h +++ b/include/effects/SkBlurDrawLooper.h @@ -38,7 +38,7 @@ public: 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 d590b275d8..9b352dc1e4 100644 --- a/include/effects/SkBlurMaskFilter.h +++ b/include/effects/SkBlurMaskFilter.h @@ -33,9 +33,7 @@ public: 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 @@ public: 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 4b5bd6f983..7210b78c5c 100644 --- a/include/effects/SkEmbossMaskFilter.h +++ b/include/effects/SkEmbossMaskFilter.h @@ -25,7 +25,7 @@ public: 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 c5f549211d..e984e8e9b4 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 @@ public: /** 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 650a5833ad..ea974785a3 100644 --- a/include/effects/SkRectShaderImageFilter.h +++ b/include/effects/SkRectShaderImageFilter.h @@ -25,7 +25,9 @@ public: * 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 0862514e78..29f59f28df 100644 --- a/include/gpu/SkGpuDevice.h +++ b/include/gpu/SkGpuDevice.h @@ -43,16 +43,16 @@ public: 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 9282770588..26247a01e9 100644 --- a/include/utils/SkMatrix44.h +++ b/include/utils/SkMatrix44.h @@ -112,7 +112,7 @@ public: 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 @@ public: 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 @@ public: 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; } |