diff options
author | 2013-12-02 13:36:22 +0000 | |
---|---|---|
committer | 2013-12-02 13:36:22 +0000 | |
commit | 5b39f5ba9c339d1e4dae391fee9ec1396feec180 (patch) | |
tree | 1c9ae56ec4e8faec6f4422d7a506423425ccde6b /include | |
parent | 742058f0ca473dd871a1235a0f30b1736b045ec9 (diff) |
Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@12427 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkBitmap.h | 22 | ||||
-rw-r--r-- | include/core/SkImageDecoder.h | 2 | ||||
-rw-r--r-- | include/core/SkPicture.h | 3 | ||||
-rw-r--r-- | include/core/SkString.h | 4 | ||||
-rw-r--r-- | include/effects/SkDropShadowImageFilter.h | 3 | ||||
-rw-r--r-- | include/ports/SkFontMgr.h | 1 |
6 files changed, 26 insertions, 9 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index cd85b6a9b1..b58925c9db 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -42,6 +42,12 @@ public: enum Config { kNo_Config, //!< bitmap has not been configured + /** + * 1-bit per pixel, (0 is transparent, 1 is opaque) + * Valid as a destination (target of a canvas), but not valid as a src. + * i.e. you can draw into a 1-bit bitmap, but you cannot draw from one. + */ + kA1_Config, kA8_Config, //!< 8-bits per pixel, with only alpha specified (0 is transparent, 0xFF is opaque) kIndex8_Config, //!< 8-bits per pixel, using SkColorTable to specify the colors kRGB_565_Config, //!< 16-bits per pixel, (see SkColorPriv.h for packing) @@ -483,6 +489,14 @@ public: */ inline uint8_t* getAddr8(int x, int y) const; + /** Returns the address of the byte containing the pixel specified by x,y + * for 1bit pixels. + * In debug build, this asserts that the pixels are allocated and locked, + * and that the config is 1-bit, however none of these checks are performed + * in the release build. + */ + inline uint8_t* getAddr1(int x, int y) const; + /** Returns the color corresponding to the pixel specified by x,y for * colortable based bitmaps. * In debug build, this asserts that the pixels are allocated and locked, @@ -804,4 +818,12 @@ inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; } +// returns the address of the byte that contains the x coordinate +inline uint8_t* SkBitmap::getAddr1(int x, int y) const { + SkASSERT(fPixels); + SkASSERT(fConfig == kA1_Config); + SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); + return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); +} + #endif diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h index 5745dbd5ba..a7e3646553 100644 --- a/include/core/SkImageDecoder.h +++ b/include/core/SkImageDecoder.h @@ -186,7 +186,7 @@ public: src: 32/24, no-alpha -> 4 src: 32/24, yes-alpha -> 5 */ - void setPrefConfigTable(const SkBitmap::Config pref[5]); + void setPrefConfigTable(const SkBitmap::Config pref[6]); /** * Optional table describing the caller's preferred config based on diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h index 42566eddbd..e371c4369d 100644 --- a/include/core/SkPicture.h +++ b/include/core/SkPicture.h @@ -218,14 +218,13 @@ protected: // V13: add flag to drawBitmapRectToRect // parameterize blurs by sigma rather than radius // V14: Add flags word to PathRef serialization - // V15: Remove A1 bitmpa config (and renumber remaining configs) #ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V13_AND_ALL_OTHER_INSTANCES_TOO static const uint32_t PRIOR_PRIOR_PICTURE_VERSION = 12; // TODO: remove when .skps regenerated #endif #ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V14_AND_ALL_OTHER_INSTANCES_TOO static const uint32_t PRIOR_PICTURE_VERSION2 = 13; // TODO: remove when .skps regenerated #endif - static const uint32_t PICTURE_VERSION = 15; + static const uint32_t PICTURE_VERSION = 14; // fPlayback, fRecord, fWidth & fHeight are protected to allow derived classes to // install their own SkPicturePlayback-derived players,SkPictureRecord-derived diff --git a/include/core/SkString.h b/include/core/SkString.h index ce87312f12..291bd65696 100644 --- a/include/core/SkString.h +++ b/include/core/SkString.h @@ -11,7 +11,6 @@ #define SkString_DEFINED #include "SkScalar.h" -#include "SkTArray.h" #include <stdarg.h> @@ -245,7 +244,4 @@ template <> inline void SkTSwap(SkString& a, SkString& b) { a.swap(b); } -// Split str on any characters in delimiters into out. (Think, strtok with a sane API.) -void SkStrSplit(const char* str, const char* delimiters, SkTArray<SkString>* out); - #endif diff --git a/include/effects/SkDropShadowImageFilter.h b/include/effects/SkDropShadowImageFilter.h index 5a58a0a06a..501df7cf7f 100644 --- a/include/effects/SkDropShadowImageFilter.h +++ b/include/effects/SkDropShadowImageFilter.h @@ -12,7 +12,6 @@ class SK_API SkDropShadowImageFilter : public SkImageFilter { public: SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkScalar sigma, SkColor, SkImageFilter* input = NULL); - SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor, SkImageFilter* input = NULL, const CropRect* cropRect = NULL); SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDropShadowImageFilter) protected: @@ -21,7 +20,7 @@ protected: virtual bool onFilterImage(Proxy*, const SkBitmap& source, const SkMatrix&, SkBitmap* result, SkIPoint* loc) SK_OVERRIDE; private: - SkScalar fDx, fDy, fSigmaX, fSigmaY; + SkScalar fDx, fDy, fSigma; SkColor fColor; typedef SkImageFilter INHERITED; }; diff --git a/include/ports/SkFontMgr.h b/include/ports/SkFontMgr.h index 97ae2f15be..accb0c5860 100644 --- a/include/ports/SkFontMgr.h +++ b/include/ports/SkFontMgr.h @@ -105,6 +105,7 @@ protected: virtual SkTypeface* onCreateFromStream(SkStream*, int ttcIndex) = 0; virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) = 0; + // TODO: make this pure-virtual once all ports know about it virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBits) = 0; private: |