aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-06-22 09:48:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-25 12:09:55 +0000
commit752e08b1ae3eeae807a8262380dc02ba9af9c989 (patch)
treed3d528d1d823be721ca9fb4065666a76aa8e5e5f /include
parent900b5364d12e6dc05c89892d72ed7de5488584b8 (diff)
Fix abandonment of programs
Bug: skia:8092 TBR=bsalomon@google.com Change-Id: If9cf4ed9f8ded4b7fbb58a244ec0b179b8430ca2 Reviewed-on: https://skia-review.googlesource.com/137121 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/gpu/gl/GrGLFunctions.h2
-rw-r--r--include/gpu/gl/GrGLInterface.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/include/gpu/gl/GrGLFunctions.h b/include/gpu/gl/GrGLFunctions.h
index e0bc39015f..15dc154a01 100644
--- a/include/gpu/gl/GrGLFunctions.h
+++ b/include/gpu/gl/GrGLFunctions.h
@@ -308,6 +308,8 @@ public:
return fCall != nullptr;
}
+ void reset() { fCall = nullptr; }
+
private:
R (*fCall)(const void*, Args...);
size_t fBuf[4];
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h
index bf2685eb1c..0b7bd96814 100644
--- a/include/gpu/gl/GrGLInterface.h
+++ b/include/gpu/gl/GrGLInterface.h
@@ -77,6 +77,7 @@ public:
/**
* The function pointers are in a struct so that we can have a compiler generated assignment
* operator.
+ * If one were to add a new function to this struct, one should also clear it in abandon.
*/
struct Functions {
GrGLFunction<GrGLActiveTextureProc> fActiveTexture;
@@ -335,8 +336,10 @@ public:
GrGLFunction<GrEGLDestroyImageProc> fEGLDestroyImage;
} fFunctions;
+#if GR_TEST_UTILS
// This exists for internal testing.
- virtual void abandon() const {}
+ virtual void abandon() const;
+#endif
};
#endif