Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1115)

Unified Diff: include/core/SkPixelRef.h

Issue 1289623004: Every pixel ref gets its own mutex. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: mutable Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkPixelRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPixelRef.h
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h
index 0ed3099126de3481c384996cc9c55cd0d0306891..194c74f5efdc4012dd5e5165af04396ad788b960 100644
--- a/include/core/SkPixelRef.h
+++ b/include/core/SkPixelRef.h
@@ -36,7 +36,6 @@ class GrTexture;
class SK_API SkPixelRef : public SkRefCnt {
public:
explicit SkPixelRef(const SkImageInfo&);
- SkPixelRef(const SkImageInfo&, SkBaseMutex* mutex);
virtual ~SkPixelRef();
const SkImageInfo& info() const {
@@ -319,7 +318,7 @@ protected:
/** Return the mutex associated with this pixelref. This value is assigned
in the constructor, and cannot change during the lifetime of the object.
*/
- SkBaseMutex* mutex() const { return fMutex; }
+ SkBaseMutex* mutex() const { return &fMutex; }
// only call from constructor. Flags this to always be locked, removing
// the need to grab the mutex and call onLockPixels/onUnlockPixels.
@@ -327,7 +326,7 @@ protected:
void setPreLocked(void*, size_t rowBytes, SkColorTable*);
private:
- SkBaseMutex* fMutex; // must remain in scope for the life of this object
+ mutable SkMutex fMutex;
// mostly const. fInfo.fAlpahType can be changed at runtime.
const SkImageInfo fInfo;
@@ -365,8 +364,6 @@ private:
void needsNewGenID();
void callGenIDChangeListeners();
- void setMutex(SkBaseMutex* mutex);
-
void setTemporarilyImmutable();
void restoreMutability();
friend class SkSurface_Raster; // For the two methods above.
« no previous file with comments | « no previous file | src/core/SkPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698