Updating Xamarin/Microsoft file headers
[platform/upstream/libSkiaSharp.git] / src / xamarin / SkManagedPixelSerializer.cpp
1 /*
2  * Copyright 2015 Xamarin Inc.
3  * Copyright 2017 Microsoft Corporation. All rights reserved.
4  *
5  * Use of this source code is governed by a BSD-style license that can be
6  * found in the LICENSE file.
7  */
8
9 #include "SkManagedPixelSerializer.h"
10
11 static use_delegate fUse = nullptr;
12 static encode_delegate fEncode = nullptr;
13
14 SkManagedPixelSerializer::SkManagedPixelSerializer() {
15 }
16
17 void SkManagedPixelSerializer::setDelegates(const use_delegate pUse, const encode_delegate pEncode)
18 {
19     ::fUse = pUse;
20     ::fEncode = pEncode;
21 }
22
23 bool SkManagedPixelSerializer::onUseEncodedData(const void* data, size_t len) {
24     return ::fUse(this, data, len);
25 }
26
27 SkData* SkManagedPixelSerializer::onEncode(const SkPixmap& pixmap) {
28     return ::fEncode(this, pixmap);
29 }