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

Unified Diff: skia/ext/bitmap_platform_device_win.cc

Issue 6949012: Assert on BeginPlatformPaint/EndPlatformPaint mismatch. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 7 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 | « skia/ext/bitmap_platform_device_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/bitmap_platform_device_win.cc
===================================================================
--- skia/ext/bitmap_platform_device_win.cc (revision 84213)
+++ skia/ext/bitmap_platform_device_win.cc (working copy)
@@ -177,6 +177,7 @@
: PlatformDevice(bitmap),
data_(data) {
// The data object is already ref'ed for us by create().
+ SkDEBUGCODE(begin_paint_count_ = 0);
}
// The copy constructor just adds another reference to the underlying data.
@@ -188,9 +189,11 @@
const_cast<BitmapPlatformDevice&>(other).accessBitmap(true)),
data_(other.data_) {
data_->ref();
+ SkDEBUGCODE(begin_paint_count_ = 0);
}
BitmapPlatformDevice::~BitmapPlatformDevice() {
+ SkASSERT(begin_paint_count_ == 0);
data_->unref();
}
@@ -202,9 +205,15 @@
}
HDC BitmapPlatformDevice::BeginPlatformPaint() {
+ SkDEBUGCODE(begin_paint_count_++);
return data_->GetBitmapDC();
}
+void BitmapPlatformDevice::EndPlatformPaint() {
+ SkASSERT(begin_paint_count_--);
+ PlatformDevice::EndPlatformPaint();
+}
+
void BitmapPlatformDevice::setMatrixClip(const SkMatrix& transform,
const SkRegion& region,
const SkClipStack&) {
« no previous file with comments | « skia/ext/bitmap_platform_device_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698