add rowBytes param to setPreLock, in prep for onNewLockPixels change
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 6 Jan 2014 15:01:48 +0000 (15:01 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 6 Jan 2014 15:01:48 +0000 (15:01 +0000)
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

include/core/SkPixelRef.h
src/core/SkMallocPixelRef.cpp
src/core/SkPixelRef.cpp

index 6700eb4..3c260be 100644 (file)
@@ -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
index c3e605c..075b5f6 100644 (file)
@@ -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);
 }
index fedbb5a..8bf1f4e 100644 (file)
@@ -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.