2020-10-08 20:00:14 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2020 Google LLC
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "tools/gpu/ManagedBackendTexture.h"
|
|
|
|
|
|
|
|
namespace sk_gpu_test {
|
|
|
|
|
2020-10-12 21:30:00 +00:00
|
|
|
void ManagedBackendTexture::ReleaseProc(void* context) {
|
|
|
|
static_cast<ManagedBackendTexture*>(context)->unref();
|
2020-10-08 20:00:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ManagedBackendTexture::~ManagedBackendTexture() {
|
|
|
|
if (fDContext && fTexture.isValid()) {
|
|
|
|
fDContext->deleteBackendTexture(fTexture);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-12 21:30:00 +00:00
|
|
|
void* ManagedBackendTexture::releaseContext() {
|
|
|
|
this->ref();
|
|
|
|
return static_cast<void*>(this);
|
2020-10-08 20:00:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace sk_gpu_test
|