Add tracing to GrContext resource cleanup
For https://github.com/flutter/flutter/issues/35296 The change is suggested by bsalomon@google.com Change-Id: I70a2f5298b49d7a64e51cb1f364834e62dcaf4a9 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225119 Commit-Queue: Yuqian Li <liyuqian@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Auto-Submit: Yuqian Li <liyuqian@google.com>
This commit is contained in:
parent
b2adbef6f6
commit
40aa85f589
@ -180,6 +180,8 @@ void GrContext::purgeUnlockedResources(bool scratchResourcesOnly) {
|
||||
}
|
||||
|
||||
void GrContext::performDeferredCleanup(std::chrono::milliseconds msNotUsed) {
|
||||
TRACE_EVENT0("skia.gpu", TRACE_FUNC);
|
||||
|
||||
ASSERT_SINGLE_OWNER
|
||||
|
||||
auto purgeTime = GrStdSteadyClock::now() - msNotUsed;
|
||||
|
@ -134,6 +134,8 @@ inline const GrGLCaps& GrGLBuffer::glCaps() const {
|
||||
}
|
||||
|
||||
void GrGLBuffer::onRelease() {
|
||||
TRACE_EVENT0("skia.gpu", TRACE_FUNC);
|
||||
|
||||
if (!this->wasDestroyed()) {
|
||||
VALIDATE();
|
||||
// make sure we've not been abandoned or already released
|
||||
|
@ -330,6 +330,8 @@ GrGLPath::GrGLPath(GrGLGpu* gpu, const SkPath& origSkPath, const GrStyle& style)
|
||||
}
|
||||
|
||||
void GrGLPath::onRelease() {
|
||||
TRACE_EVENT0("skia.gpu", TRACE_FUNC);
|
||||
|
||||
if (0 != fPathID) {
|
||||
static_cast<GrGLGpu*>(this->getGpu())->glPathRendering()->deletePaths(fPathID, 1);
|
||||
fPathID = 0;
|
||||
|
@ -93,6 +93,8 @@ GrGLenum GrGLTexture::target() const {
|
||||
}
|
||||
|
||||
void GrGLTexture::onRelease() {
|
||||
TRACE_EVENT0("skia.gpu", TRACE_FUNC);
|
||||
|
||||
if (fID) {
|
||||
if (GrBackendObjectOwnership::kBorrowed != fTextureIDOwnership) {
|
||||
GL_CALL(DeleteTextures(1, &fID));
|
||||
|
Loading…
Reference in New Issue
Block a user