commit | f49c75a8f1eacf8e6cb19ce0dcc1cc9bcbf1f96e | [log] [tgz] |
---|---|---|
author | benjaminwagner <benjaminwagner@google.com> | Fri Feb 05 07:02:38 2016 -0800 |
committer | Commit bot <commit-bot@chromium.org> | Fri Feb 05 07:02:38 2016 -0800 |
tree | 54f07f63610fd7533a92fce949b97531a6cf875c | |
parent | 001cc1f41be1e6fce39f0cc1426a1497909d91cd [diff] [blame] |
Move Google3-specific stack limitation logic to template classes. Remove #ifdefs in other files. Reapplies https://codereview.chromium.org/1656143003; removing the implicit constructors for GLPtr and GLPtrAlias resolves the build issue on Android. Also reverts https://codereview.chromium.org/1663013004 Does not change the public API. TBR=reed GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1666203002 Review URL: https://codereview.chromium.org/1666203002
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h index 31429a8..5fa31ed 100644 --- a/include/gpu/gl/GrGLInterface.h +++ b/include/gpu/gl/GrGLInterface.h
@@ -109,7 +109,8 @@ template <typename FNPTR_TYPE> class GLPtr { public: GLPtr() : fPtr(NULL) {} - GLPtr operator=(FNPTR_TYPE ptr) { fPtr = ptr; return *this; } + GLPtr(const GLPtr&) = delete; + GLPtr& operator=(FNPTR_TYPE ptr) { fPtr = ptr; return *this; } operator FNPTR_TYPE() const { return fPtr; } private: FNPTR_TYPE fPtr; @@ -119,7 +120,8 @@ // they're updated to use the Functions struct. template <typename FNPTR_TYPE> class GLPtrAlias { public: - GLPtrAlias(GLPtr<FNPTR_TYPE>* base) : fBase(base) {} + explicit GLPtrAlias(GLPtr<FNPTR_TYPE>* base) : fBase(base) {} + GLPtrAlias(const GLPtrAlias&) = delete; void operator=(FNPTR_TYPE ptr) { *fBase = ptr; } private: GLPtr<FNPTR_TYPE>* fBase;