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

Unified Diff: src/image/SkImage.cpp

Issue 1266883002: unify pixelref and image ID space, so we can share IDs when we share pixels (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
Index: src/image/SkImage.cpp
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 081785f4b36856c590a8527e8c89afc24517e1cd..83aa3f2c9308ce61daa0e997ee87c4bc90e281a4 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -22,15 +22,9 @@
#include "SkImage_Gpu.h"
#endif
+#include "SkNextID.h"
uint32_t SkImage::NextUniqueID() {
f(malita) 2015/07/30 20:24:26 Nit: any reason to keep this wrapper around?
reed1 2015/07/30 21:17:08 Done.
- static int32_t gUniqueID;
-
- // never return 0;
- uint32_t id;
- do {
- id = sk_atomic_inc(&gUniqueID) + 1;
- } while (0 == id);
- return id;
+ return SkNextID::ImageID();
}
const void* SkImage::peekPixels(SkImageInfo* info, size_t* rowBytes) const {
@@ -248,8 +242,8 @@ SkImage* SkImage::NewFromBitmap(const SkBitmap& bm) {
unrefCopy.reset(tex);
}
const SkImageInfo info = bm.info();
- return SkNEW_ARGS(SkImage_Gpu, (info.width(), info.height(), info.alphaType(),
- tex, 0, SkSurface::kNo_Budgeted));
+ return SkNEW_ARGS(SkImage_Gpu, (info.width(), info.height(), bm.getGenerationID(),
+ info.alphaType(), tex, 0, SkSurface::kNo_Budgeted));
}
#endif
« include/core/SkImage.h ('K') | « src/core/SkPixelRef.cpp ('k') | src/image/SkImage_Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698