From 80c772b2a46aea7efe0632e580fbc8233ff2a190 Mon Sep 17 00:00:00 2001 From: reed Date: Thu, 30 Jul 2015 18:58:23 -0700 Subject: unify pixelref and image ID space, so we can share IDs when we share pixels I view this as a performance opportunity, not a feature or bug fix per-se. BUG=skia: Review URL: https://codereview.chromium.org/1266883002 --- src/image/SkImage_Raster.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/image/SkImage_Raster.cpp') diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp index bde4c347aa..7b5cf9bb1b 100644 --- a/src/image/SkImage_Raster.cpp +++ b/src/image/SkImage_Raster.cpp @@ -82,7 +82,7 @@ public: bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const override; SkImage_Raster(const SkBitmap& bm, const SkSurfaceProps* props, bool lockPixels = false) - : INHERITED(bm.width(), bm.height(), props) + : INHERITED(bm.width(), bm.height(), bm.getGenerationID(), props) , fBitmap(bm) { if (lockPixels) { fBitmap.lockPixels(); @@ -91,7 +91,7 @@ public: } private: - SkImage_Raster() : INHERITED(0, 0, NULL) { + SkImage_Raster() : INHERITED(0, 0, fBitmap.getGenerationID(), NULL) { fBitmap.setImmutable(); } @@ -109,7 +109,7 @@ static void release_data(void* addr, void* context) { SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes, SkColorTable* ctable, const SkSurfaceProps* props) - : INHERITED(info.width(), info.height(), props) + : INHERITED(info.width(), info.height(), kNeedNewImageUniqueID, props) { data->ref(); void* addr = const_cast(data->data()); @@ -121,7 +121,7 @@ SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes, SkImage_Raster::SkImage_Raster(const Info& info, SkPixelRef* pr, const SkIPoint& pixelRefOrigin, size_t rowBytes, const SkSurfaceProps* props) - : INHERITED(info.width(), info.height(), props) + : INHERITED(info.width(), info.height(), pr->getGenerationID(), props) { fBitmap.setInfo(info, rowBytes); fBitmap.setPixelRef(pr, pixelRefOrigin); -- cgit v1.2.3