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

Unified Diff: src/image/SkImage_Raster.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
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | src/image/SkSurface_Gpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Raster.cpp
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index bde4c347aafcaedfb784ae4ff2d4291ce405564c..7b5cf9bb1ba10caf2e82bfda8fa70d0e5c679355 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -82,7 +82,7 @@ public:
bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const override;
SkImage_Raster(const SkBitmap& bm, const SkSurfaceProps* props, bool lockPixels = false)
- : INHERITED(bm.width(), bm.height(), props)
+ : INHERITED(bm.width(), bm.height(), bm.getGenerationID(), props)
, fBitmap(bm) {
if (lockPixels) {
fBitmap.lockPixels();
@@ -91,7 +91,7 @@ public:
}
private:
- SkImage_Raster() : INHERITED(0, 0, NULL) {
+ SkImage_Raster() : INHERITED(0, 0, fBitmap.getGenerationID(), NULL) {
fBitmap.setImmutable();
}
@@ -109,7 +109,7 @@ static void release_data(void* addr, void* context) {
SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes,
SkColorTable* ctable, const SkSurfaceProps* props)
- : INHERITED(info.width(), info.height(), props)
+ : INHERITED(info.width(), info.height(), kNeedNewImageUniqueID, props)
{
data->ref();
void* addr = const_cast<void*>(data->data());
@@ -121,7 +121,7 @@ SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes,
SkImage_Raster::SkImage_Raster(const Info& info, SkPixelRef* pr, const SkIPoint& pixelRefOrigin,
size_t rowBytes, const SkSurfaceProps* props)
- : INHERITED(info.width(), info.height(), props)
+ : INHERITED(info.width(), info.height(), pr->getGenerationID(), props)
{
fBitmap.setInfo(info, rowBytes);
fBitmap.setPixelRef(pr, pixelRefOrigin);
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | src/image/SkSurface_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698