diff options
author | Robert Phillips <robertphillips@google.com> | 2018-07-18 13:56:48 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-18 18:51:02 +0000 |
commit | 715d08c381b4cc8af33d7dcdefc9533dcc97e4c9 (patch) | |
tree | 328830165cfa268c5a6645e30088472836283a18 /src/gpu/GrSurfaceProxyPriv.h | |
parent | 946c37057f2618af7eda34fd6d2dd8625a9e9b61 (diff) |
Fix explicit allocation bug
Change-Id: I9866f563e02b2ab290cc46ede05f8eda21f6d3b2
Reviewed-on: https://skia-review.googlesource.com/142163
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrSurfaceProxyPriv.h')
-rw-r--r-- | src/gpu/GrSurfaceProxyPriv.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/GrSurfaceProxyPriv.h b/src/gpu/GrSurfaceProxyPriv.h index 8d7d8d02d7..a5113f22d5 100644 --- a/src/gpu/GrSurfaceProxyPriv.h +++ b/src/gpu/GrSurfaceProxyPriv.h @@ -37,6 +37,12 @@ public: return fProxy->fTarget ? fProxy->fTarget->asRenderTarget() : nullptr; } + // Beware! Woe betide anyone whosoever calls this method. + // The refs on proxies and their backing GrSurfaces shift around based on whether the proxy + // is instantiated or not. Additionally, the lifetime of a proxy (and a GrSurface) also + // depends on the read and write refs (So this method can validly return 0). + int32_t getProxyRefCnt() const { return fProxy->getProxyRefCnt(); } + // Beware! This call is only guaranteed to tell you if the proxy in question has // any pending IO in its current state. It won't tell you about the IO state in the // future when the proxy is actually used/instantiated. |