From c4e09204941ea6bd9b24af228f0b6ec2c5979f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 23 Feb 2018 13:03:50 +0100 Subject: [PATCH] Removed long-deprecated parameterless Query constructors and related. Use constructors taking Target as a parameter and a parameterless begin() instead. --- src/Magnum/AbstractQuery.cpp | 23 ----------------------- src/Magnum/AbstractQuery.h | 5 ----- src/Magnum/PrimitiveQuery.cpp | 17 ----------------- src/Magnum/PrimitiveQuery.h | 20 -------------------- src/Magnum/SampleQuery.h | 24 ------------------------ src/Magnum/TimeQuery.h | 24 ------------------------ 6 files changed, 113 deletions(-) diff --git a/src/Magnum/AbstractQuery.cpp b/src/Magnum/AbstractQuery.cpp index b6d615ef7..cea279b83 100644 --- a/src/Magnum/AbstractQuery.cpp +++ b/src/Magnum/AbstractQuery.cpp @@ -40,12 +40,6 @@ AbstractQuery::AbstractQuery(GLenum target): _target{target}, _flags{ObjectFlag: (this->*Context::current().state().query->createImplementation)(); } -#ifdef MAGNUM_BUILD_DEPRECATED -AbstractQuery::AbstractQuery(): _target{}, _flags{ObjectFlag::DeleteOnDestruction} { - createImplementationDefault(); -} -#endif - AbstractQuery::~AbstractQuery() { /* Moved out or not deleting on destruction, nothing to do */ if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return; @@ -152,10 +146,6 @@ template<> Long AbstractQuery::result() { #endif void AbstractQuery::begin() { - #ifdef MAGNUM_BUILD_DEPRECATED - CORRADE_INTERNAL_ASSERT(_target); - #endif - #ifndef MAGNUM_TARGET_GLES2 glBeginQuery(_target, _id); #else @@ -163,20 +153,7 @@ void AbstractQuery::begin() { #endif } -#ifdef MAGNUM_BUILD_DEPRECATED -void AbstractQuery::begin(const GLenum target) { - CORRADE_INTERNAL_ASSERT(!_target || _target == target); - - _target = target; - begin(); -} -#endif - void AbstractQuery::end() { - #ifdef MAGNUM_BUILD_DEPRECATED - CORRADE_INTERNAL_ASSERT(_target); - #endif - #ifndef MAGNUM_TARGET_GLES2 glEndQuery(_target); #else diff --git a/src/Magnum/AbstractQuery.h b/src/Magnum/AbstractQuery.h index 603f8d018..cd35cb586 100644 --- a/src/Magnum/AbstractQuery.h +++ b/src/Magnum/AbstractQuery.h @@ -179,11 +179,6 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject { explicit AbstractQuery(NoCreateT, GLenum target) noexcept: _id{0}, _target{target}, _flags{ObjectFlag::DeleteOnDestruction} {} explicit AbstractQuery(GLuint id, GLenum target, ObjectFlags flags) noexcept: _id{id}, _target{target}, _flags{flags} {} - #ifdef MAGNUM_BUILD_DEPRECATED - explicit AbstractQuery(); - void begin(GLenum target); - #endif - GLuint _id; GLenum _target; diff --git a/src/Magnum/PrimitiveQuery.cpp b/src/Magnum/PrimitiveQuery.cpp index f26bfae41..bb623d9b5 100644 --- a/src/Magnum/PrimitiveQuery.cpp +++ b/src/Magnum/PrimitiveQuery.cpp @@ -34,30 +34,13 @@ void PrimitiveQuery::begin() { AbstractQuery::begin(); } -#ifdef MAGNUM_BUILD_DEPRECATED -void PrimitiveQuery::begin(const Target target) { - #ifndef MAGNUM_TARGET_GLES - _index = 0; - #endif - AbstractQuery::begin(GLenum(target)); -} -#endif - #ifndef MAGNUM_TARGET_GLES void PrimitiveQuery::begin(const UnsignedInt index) { - #ifdef MAGNUM_BUILD_DEPRECATED - CORRADE_INTERNAL_ASSERT(_target); - #endif - glBeginQueryIndexed(_target, _index = index, _id); } #endif void PrimitiveQuery::end() { - #ifdef MAGNUM_BUILD_DEPRECATED - CORRADE_INTERNAL_ASSERT(_target); - #endif - #ifndef MAGNUM_TARGET_GLES if(!_index) glEndQuery(_target); else glEndQueryIndexed(_target, _index); diff --git a/src/Magnum/PrimitiveQuery.h b/src/Magnum/PrimitiveQuery.h index abbb8bd19..d03cbd63e 100644 --- a/src/Magnum/PrimitiveQuery.h +++ b/src/Magnum/PrimitiveQuery.h @@ -33,10 +33,6 @@ #include "Magnum/AbstractQuery.h" -#ifdef MAGNUM_BUILD_DEPRECATED -#include -#endif - #ifndef MAGNUM_TARGET_GLES2 namespace Magnum { @@ -143,14 +139,6 @@ class MAGNUM_EXPORT PrimitiveQuery: public AbstractQuery { return PrimitiveQuery{id, target, flags}; } - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * @brief @copybrief PrimitiveQuery(Target) - * @deprecated Use @ref PrimitiveQuery(Target) instead. - */ - CORRADE_DEPRECATED("use PrimitiveQuery(Target) instead") explicit PrimitiveQuery() {} - #endif - /** * @brief Constructor * @@ -185,14 +173,6 @@ class MAGNUM_EXPORT PrimitiveQuery: public AbstractQuery { */ void begin(); - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * @brief @copybrief begin() - * @deprecated Use @ref begin() instead. - */ - CORRADE_DEPRECATED("use begin() instead") void begin(Target target); - #endif - #ifndef MAGNUM_TARGET_GLES /** * @brief Begin indexed query diff --git a/src/Magnum/SampleQuery.h b/src/Magnum/SampleQuery.h index 5a3b7a881..d39a6d474 100644 --- a/src/Magnum/SampleQuery.h +++ b/src/Magnum/SampleQuery.h @@ -33,10 +33,6 @@ #include "Magnum/AbstractQuery.h" -#ifdef MAGNUM_BUILD_DEPRECATED -#include -#endif - #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) namespace Magnum { @@ -209,14 +205,6 @@ class SampleQuery: public AbstractQuery { return SampleQuery{id, target, flags}; } - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * @brief @copybrief SampleQuery(Target) - * @deprecated Use @ref SampleQuery(Target) instead. - */ - CORRADE_DEPRECATED("use SampleQuery(Target) instead") explicit SampleQuery() {} - #endif - /** * @brief Constructor * @@ -241,18 +229,6 @@ class SampleQuery: public AbstractQuery { */ explicit SampleQuery(NoCreateT) noexcept: AbstractQuery{NoCreate, GLenum(Target::AnySamplesPassed)} {} - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * @brief @copybrief AbstractQuery::begin() - * @deprecated Use @ref begin() instead. - */ - CORRADE_DEPRECATED("use begin() instead") void begin(Target target) { - AbstractQuery::begin(GLenum(target)); - } - - using AbstractQuery::begin; - #endif - #ifndef MAGNUM_TARGET_GLES /** * @brief Begin conditional rendering based on result value diff --git a/src/Magnum/TimeQuery.h b/src/Magnum/TimeQuery.h index 2e8d37f50..daaabdaca 100644 --- a/src/Magnum/TimeQuery.h +++ b/src/Magnum/TimeQuery.h @@ -33,10 +33,6 @@ #include "Magnum/AbstractQuery.h" -#ifdef MAGNUM_BUILD_DEPRECATED -#include -#endif - #ifndef MAGNUM_TARGET_WEBGL namespace Magnum { @@ -128,14 +124,6 @@ class TimeQuery: public AbstractQuery { return TimeQuery{id, target, flags}; } - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * @brief @copybrief TimeQuery(Target) - * @deprecated Use @ref TimeQuery(Target) instead. - */ - CORRADE_DEPRECATED("use TimeQuery(Target) instead") explicit TimeQuery() {} - #endif - /** * @brief Constructor * @@ -189,18 +177,6 @@ class TimeQuery: public AbstractQuery { #endif } - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * @brief @copybrief AbstractQuery::begin() - * @deprecated Use @ref AbstractQuery::begin() instead. - */ - CORRADE_DEPRECATED("use begin() instead") void begin(Target target) { - AbstractQuery::begin(GLenum(target)); - } - - using AbstractQuery::begin; - #endif - private: explicit TimeQuery(GLuint id, Target target, ObjectFlags flags) noexcept: AbstractQuery{id, GLenum(target), flags} {} };