aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2018-01-04 23:04:23 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-08 13:50:59 +0000
commit3c7d882c483b693124f94c07253807422583080f (patch)
treeacca402ca17ccd1d668dbbf87ce2f72c5d80238c /include/core
parent2985987cac72bf0a56fe75d751191d88d3b8582f (diff)
SkBitmap::fPixelRefOrigin removed
Motivation: makes SkBitmap 8 bytes smaller. fPixelRefOrigin is rarely used, and can be recaluated when needed. Also, remove two of SkBitmap's private methods and fold in their functions. Change-Id: I2cddb9e4b5480404bf6da3edfb0155ab82cf47d2 Reviewed-on: https://skia-review.googlesource.com/91300 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkBitmap.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index ed17c864a7..c0287b393b 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -380,8 +380,8 @@ public:
@return bounds within SkPixelRef bounds
*/
SkIRect getSubset() const {
- return SkIRect::MakeXYWH(fPixelRefOrigin.x(), fPixelRefOrigin.y(),
- fInfo.width(), fInfo.height());
+ SkIPoint origin = this->pixelRefOrigin();
+ return SkIRect::MakeXYWH(origin.x(), origin.y(), this->width(), this->height());
}
/** Sets width, height, SkAlphaType, SkColorType, SkColorSpace, and optional
@@ -737,7 +737,7 @@ public:
@return pixel origin within SkPixelRef
*/
- SkIPoint pixelRefOrigin() const { return fPixelRefOrigin; }
+ SkIPoint pixelRefOrigin() const;
/** Replaces pixelRef and origin in SkBitmap. dx and dy specify the offset
within the SkPixelRef pixels for the top-left corner of the bitmap.
@@ -1282,16 +1282,10 @@ private:
sk_sp<SkPixelRef> fPixelRef;
void* fPixels;
- SkIPoint fPixelRefOrigin;
SkImageInfo fInfo;
uint32_t fRowBytes;
uint8_t fFlags;
- /* Unreference any pixelrefs
- */
- void freePixels();
- void updatePixelsFromRef();
-
friend class SkReadBuffer; // unflatten
};