diff --git a/gfx/2d/DrawTargetSkia.cpp b/gfx/2d/DrawTargetSkia.cpp index 8ff76aa2982..ff3a82a25d0 100644 --- a/gfx/2d/DrawTargetSkia.cpp +++ b/gfx/2d/DrawTargetSkia.cpp @@ -171,7 +171,14 @@ DrawTargetSkia::DrawTargetSkia() DrawTargetSkia::~DrawTargetSkia() { - MarkChanged(); + if (mSnapshots.size()) { + for (std::vector::iterator iter = mSnapshots.begin(); + iter != mSnapshots.end(); iter++) { + (*iter)->DrawTargetDestroyed(); + } + // All snapshots will now have copied data. + mSnapshots.clear(); + } } TemporaryRef diff --git a/gfx/2d/SourceSurfaceSkia.cpp b/gfx/2d/SourceSurfaceSkia.cpp index b2b84f5c3d9..27f92a212a1 100644 --- a/gfx/2d/SourceSurfaceSkia.cpp +++ b/gfx/2d/SourceSurfaceSkia.cpp @@ -129,6 +129,12 @@ SourceSurfaceSkia::DrawTargetWillChange() } } +void +SourceSurfaceSkia::DrawTargetDestroyed() +{ + mDrawTarget = NULL; +} + void SourceSurfaceSkia::MarkIndependent() { @@ -138,6 +144,5 @@ SourceSurfaceSkia::MarkIndependent() } } - } } diff --git a/gfx/2d/SourceSurfaceSkia.h b/gfx/2d/SourceSurfaceSkia.h index 9664ee92f33..97169732d36 100644 --- a/gfx/2d/SourceSurfaceSkia.h +++ b/gfx/2d/SourceSurfaceSkia.h @@ -82,6 +82,7 @@ private: friend class DrawTargetSkia; void DrawTargetWillChange(); + void DrawTargetDestroyed(); void MarkIndependent(); SkBitmap mBitmap;