blob: 8409caa409c6b2617ce43ba89dc55d425fe8d661 [file] [log] [blame]
Brian Salomonf9b00422020-10-08 16:00:14 -04001/*
2 * Copyright 2020 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "tools/gpu/ManagedBackendTexture.h"
9
10namespace sk_gpu_test {
11
12void ManagedBackendTexture::ReleaseProc(void* context) {
13 static_cast<ManagedBackendTexture*>(context)->unref();
14}
15
16ManagedBackendTexture::~ManagedBackendTexture() {
17 if (fDContext && fTexture.isValid()) {
18 fDContext->deleteBackendTexture(fTexture);
19 }
20}
21
22void* ManagedBackendTexture::releaseContext() {
23 this->ref();
24 return static_cast<void*>(this);
25}
26
27} // namespace sk_gpu_test