Chromium Code Reviews| Index: include/core/SkBitmap.h |
| diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h |
| index 2b900bef341ddbc678714c758b8c7d81e9abec0c..e53593805666e1ece3ebf6e0743de34938e8d343 100644 |
| --- a/include/core/SkBitmap.h |
| +++ b/include/core/SkBitmap.h |
| @@ -353,12 +353,21 @@ public: |
| /** Return the offset into the pixelref, if any. Will return 0 if there is |
| no pixelref installed. |
| */ |
| - size_t pixelRefOffset() const { return fPixelRefOffset; } |
| +// size_t pixelRefOffset() const { return fPixelRefOffset; } |
|
scroggo
2014/01/07 22:11:33
Any reason not to delete this outright?
reed1
2014/01/07 22:37:59
Done.
|
| + |
| + SkIPoint pixelRefOrigin() const { return fPixelRefOrigin; } |
| + |
| /** Assign a pixelref and optional offset. Pixelrefs are reference counted, |
| so the existing one (if any) will be unref'd and the new one will be |
| ref'd. |
| */ |
| - SkPixelRef* setPixelRef(SkPixelRef* pr, size_t offset = 0); |
| + SkPixelRef* setPixelRef(SkPixelRef* pr, int dx, int dy); |
| + SkPixelRef* setPixelRef(SkPixelRef* pr) { |
| + return this->setPixelRef(pr, 0, 0); |
| + } |
| + SkPixelRef* setPixelRef(SkPixelRef* pr, const SkIPoint& origin) { |
| + return this->setPixelRef(pr, origin.fX, origin.fY); |
| + } |
| /** Call this to ensure that the bitmap points to the current pixel address |
| in the pixelref. Balance it with a call to unlockPixels(). These calls |
| @@ -665,13 +674,14 @@ private: |
| mutable MipMap* fMipMap; |
| mutable SkPixelRef* fPixelRef; |
| - mutable size_t fPixelRefOffset; |
| mutable int fPixelLockCount; |
| // either user-specified (in which case it is not treated as mutable) |
| // or a cache of the returned value from fPixelRef->lockPixels() |
| mutable void* fPixels; |
| mutable SkColorTable* fColorTable; // only meaningful for kIndex8 |
| + SkIPoint fPixelRefOrigin; |
|
scroggo
2014/01/07 22:11:33
Why was the old one mutable, and this one not? (My
|
| + |
| enum Flags { |
| kImageIsOpaque_Flag = 0x01, |
| kImageIsVolatile_Flag = 0x02, |