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

Unified Diff: include/core/SkPixelRef.h

Issue 1266143003: lock pixels in image when bitmap is immutable and not-lazy (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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') | tests/DeferredCanvasTest.cpp » ('J')
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 a67855de5fbf03fa8872f9f02dd6ac75e1b3007c..1dc01f79abb1f650dd0688bb84367d2c3f4d38fa 100644
--- a/include/core/SkPixelRef.h
+++ b/include/core/SkPixelRef.h
@@ -19,20 +19,6 @@
#include "SkString.h"
#include "SkTDArray.h"
-#ifdef SK_DEBUG
- /**
- * Defining SK_IGNORE_PIXELREF_SETPRELOCKED will force all pixelref
- * subclasses to correctly handle lock/unlock pixels. For performance
- * reasons, simple malloc-based subclasses call setPreLocked() to skip
- * the overhead of implementing these calls.
- *
- * This build-flag disables that optimization, to add in debugging our
- * call-sites, to ensure that they correctly balance their calls of
- * lock and unlock.
- */
-// #define SK_IGNORE_PIXELREF_SETPRELOCKED
-#endif
-
class SkColorTable;
class SkData;
struct SkIRect;
@@ -385,6 +371,9 @@ private:
void restoreMutability();
friend class SkSurface_Raster; // For the two methods above.
+ bool isPreLocked() const { return fPreLocked; }
+ friend class SkImage_Raster;
+
// When copying a bitmap to another with the same shape and config, we can safely
// clone the pixelref generation ID too, which makes them equivalent under caching.
friend class SkBitmap; // only for cloneGenID
« no previous file with comments | « no previous file | src/core/SkPixelRef.cpp » ('j') | tests/DeferredCanvasTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698