Index: src/core/SkManagedBitmapDevice.cpp |
diff --git a/src/core/SkManagedBitmapDevice.cpp b/src/core/SkManagedBitmapDevice.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..04f02937733d97015d6bf8a9ca191ad664ef5867 |
--- /dev/null |
+++ b/src/core/SkManagedBitmapDevice.cpp |
@@ -0,0 +1,23 @@ |
+/* |
+ * Copyright 2016 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#include "SkManagedBitmapDevice.h" |
+ |
+SkManagedBitmapDevice::SkManagedBitmapDevice(const SkBitmap& bitmap, |
+ const SkSurfaceProps& surfaceProps, |
+ void (*deallocator) (void*), |
+ void* deallocatorPayload) : |
+ INHERITED(bitmap, surfaceProps), |
+ fDeallocator(deallocator), |
+ fDeallocatorPayload(deallocatorPayload) { } |
+ |
+SkManagedBitmapDevice::~SkManagedBitmapDevice() { |
+ if (fDeallocator) { |
+ fDeallocator(fDeallocatorPayload); |
+ } |
+} |
+ |