From: reed@google.com Date: Mon, 6 Jan 2014 15:01:48 +0000 (+0000) Subject: add rowBytes param to setPreLock, in prep for onNewLockPixels change X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~9519 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7627c657b039ea9aa2a01a7d74e652fe7e27def4;p=platform%2Fupstream%2FlibSkiaSharp.git add rowBytes param to setPreLock, in prep for onNewLockPixels change need _win.cc change from https://codereview.chromium.org/124503002/ when this lands in chrome R=robertphillips@google.com Review URL: https://codereview.chromium.org/125063002 git-svn-id: http://skia.googlecode.com/svn/trunk@12907 2bbb7eff-a529-9590-31e7-b0007b416f81 --- diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h index 6700eb4..3c260be 100644 --- a/include/core/SkPixelRef.h +++ b/include/core/SkPixelRef.h @@ -305,7 +305,7 @@ protected: // only call from constructor. Flags this to always be locked, removing // the need to grab the mutex and call onLockPixels/onUnlockPixels. // Performance tweak to avoid those calls (esp. in multi-thread use case). - void setPreLocked(void* pixels, SkColorTable* ctable); + void setPreLocked(void* pixels, size_t rowBytes, SkColorTable* ctable); private: SkBaseMutex* fMutex; // must remain in scope for the life of this object diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp index c3e605c..075b5f6 100644 --- a/src/core/SkMallocPixelRef.cpp +++ b/src/core/SkMallocPixelRef.cpp @@ -152,7 +152,7 @@ SkMallocPixelRef::SkMallocPixelRef(const SkImageInfo& info, void* storage, fRB = rowBytes; SkSafeRef(ctable); - this->setPreLocked(fStorage, fCTable); + this->setPreLocked(fStorage, rowBytes, fCTable); } SkMallocPixelRef::SkMallocPixelRef(const SkImageInfo& info, void* storage, @@ -175,7 +175,7 @@ SkMallocPixelRef::SkMallocPixelRef(const SkImageInfo& info, void* storage, fRB = rowBytes; SkSafeRef(ctable); - this->setPreLocked(fStorage, fCTable); + this->setPreLocked(fStorage, rowBytes, fCTable); } @@ -234,5 +234,5 @@ SkMallocPixelRef::SkMallocPixelRef(SkFlattenableReadBuffer& buffer) fCTable = NULL; } - this->setPreLocked(fStorage, fCTable); + this->setPreLocked(fStorage, fRB, fCTable); } diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp index fedbb5a..8bf1f4e 100644 --- a/src/core/SkPixelRef.cpp +++ b/src/core/SkPixelRef.cpp @@ -138,7 +138,8 @@ void SkPixelRef::cloneGenID(const SkPixelRef& that) { that.fUniqueGenerationID = false; } -void SkPixelRef::setPreLocked(void* pixels, SkColorTable* ctable) { +// rowBytes will be respected when we land the onNewLockPixels CL +void SkPixelRef::setPreLocked(void* pixels, size_t rowBytes, SkColorTable* ctable) { #ifndef SK_IGNORE_PIXELREF_SETPRELOCKED // only call me in your constructor, otherwise fLockCount tracking can get // out of sync.