Stop refcounting SkDeferredCanvas::NotificationClient
User code (i.e. WebKit) is now responsible for the lifetime scope of the notification client.
With http://trac.webkit.org/changeset/125804 skia-side ref counting has become unnecessary and undesirable.
Review URL: https://codereview.appspot.com/6443146
git-svn-id: http://skia.googlecode.com/svn/trunk@5169 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index bb33e22..661e017 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -16,8 +16,6 @@
#include "SkPaint.h"
#include "SkShader.h"
-SK_DEFINE_INST_COUNT(SkDeferredCanvas::NotificationClient)
-
enum {
// Deferred canvas will auto-flush when recording reaches this limit
kDefaultMaxRecordingStorageBytes = 64*1024*1024,
@@ -354,7 +352,6 @@
fMaxRecordingStorageBytes = kDefaultMaxRecordingStorageBytes;
fNotificationClient = notificationClient;
- SkSafeRef(fNotificationClient);
fImmediateDevice = immediateDevice; // ref counted via fImmediateCanvas
fImmediateCanvas = SkNEW_ARGS(SkCanvas, (fImmediateDevice));
fPipeController.setPlaybackCanvas(fImmediateCanvas);
@@ -364,7 +361,6 @@
DeferredDevice::~DeferredDevice() {
this->flushPending();
SkSafeUnref(fImmediateCanvas);
- SkSafeUnref(fNotificationClient);
}
void DeferredDevice::setMaxRecordingStorage(size_t maxStorage) {
@@ -386,7 +382,7 @@
void DeferredDevice::setNotificationClient(
SkDeferredCanvas::NotificationClient* notificationClient) {
- SkRefCnt_SafeAssign(fNotificationClient, notificationClient);
+ fNotificationClient = notificationClient;
}
void DeferredDevice::contentsCleared() {