From 405d0f43d8fa03874aee23669e5fdb38f21cc3e7 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Wed, 29 Aug 2012 21:26:13 +0000 Subject: In which a series of things around attachToCanvas and writePixels are fixed Review URL: https://codereview.appspot.com/6506051/ git-svn-id: http://skia.googlecode.com/svn/trunk@5341 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkDevice.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/core') diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h index 41e316c9cc..da7842b566 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -145,6 +145,7 @@ public: * devices to prepare for drawing (e.g., locking their pixels, etc.) */ virtual void onAttachToCanvas(SkCanvas* canvas) { + SkASSERT(!fAttachedToCanvas); this->lockPixels(); #ifdef SK_DEBUG fAttachedToCanvas = true; @@ -158,6 +159,7 @@ public: * possibly from SkCanvas' dtor. */ virtual void onDetachFromCanvas() { + SkASSERT(fAttachedToCanvas); this->unlockPixels(); #ifdef SK_DEBUG fAttachedToCanvas = false; -- cgit v1.2.3