aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkImage_Raster.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-07-30 18:58:23 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-30 18:58:23 -0700
commit80c772b2a46aea7efe0632e580fbc8233ff2a190 (patch)
tree7b9e83cf6aade7c081bafa00189799f32e2c058f /src/image/SkImage_Raster.cpp
parent58b4395b22eb0620605ff0674c6d1254ecd51374 (diff)
unify pixelref and image ID space, so we can share IDs when we share pixels
I view this as a performance opportunity, not a feature or bug fix per-se. BUG=skia: Review URL: https://codereview.chromium.org/1266883002
Diffstat (limited to 'src/image/SkImage_Raster.cpp')
-rw-r--r--src/image/SkImage_Raster.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index bde4c347aa..7b5cf9bb1b 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);