summaryrefslogtreecommitdiff
path: root/api/Specification.cpp
diff options
context:
space:
mode:
authorJean-Luc Brouillet <jeanluc@google.com>2015-05-12 15:38:27 -0700
committerJean-Luc Brouillet <jeanluc@google.com>2015-06-14 08:20:49 +0000
commit496d0f8f3ce1b12d7d76bae2ecf6fe15a8b3811f (patch)
tree24e50bac8c47ad99f87570809332a68ee96f0747 /api/Specification.cpp
parent61c124a7be3c8900c34a27a64e84c73c549fa808 (diff)
downloadrs-496d0f8f3ce1b12d7d76bae2ecf6fe15a8b3811f.tar.gz
Obsolete the graphics API in the .rsh files.
Mark the graphics APIs as no longer available starting with version 23. Modify the generator to change the #ifdef guards around the API to enable internal code to still access the obsoleted APIs, as we still neeed to support them at runtime. Also, include a documentation change in the rs_convert header file that had not been included previously. b/19001259 Change-Id: Iaad4833f504da9aa9f5069a977c37b86d1316d3a (cherry picked from commit 67923a9e829d89522bb5338a6d635d807a7ee59b)
Diffstat (limited to 'api/Specification.cpp')
-rw-r--r--api/Specification.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/api/Specification.cpp b/api/Specification.cpp
index 09a0663d..6b0d09db 100644
--- a/api/Specification.cpp
+++ b/api/Specification.cpp
@@ -224,7 +224,20 @@ bool VersionInfo::scan(Scanner* scanner, int maxApiLevel) {
return minVersion == 0 || minVersion <= maxApiLevel;
}
-Definition::Definition(const std::string& name) : mName(name), mDeprecated(false), mHidden(false) {
+Definition::Definition(const std::string& name)
+ : mName(name), mDeprecated(false), mHidden(false), mFinalVersion(-1) {
+}
+
+void Definition::updateFinalVersion(const VersionInfo& info) {
+ /* We set it if:
+ * - We have never set mFinalVersion before, or
+ * - The max version is 0, which means we have not expired this API, or
+ * - We have a max that's later than what we currently have.
+ */
+ if (mFinalVersion < 0 || info.maxVersion == 0 ||
+ (mFinalVersion > 0 && info.maxVersion > mFinalVersion)) {
+ mFinalVersion = info.maxVersion;
+ }
}
void Definition::scanDocumentationTags(Scanner* scanner, bool firstOccurence,
@@ -323,6 +336,7 @@ void ConstantSpecification::scanConstantSpecification(Scanner* scanner, SpecFile
Constant* constant = systemSpecification.findOrCreateConstant(name, &created);
ConstantSpecification* spec = new ConstantSpecification(constant);
constant->addSpecification(spec);
+ constant->updateFinalVersion(info);
specFile->addConstantSpecification(spec, created);
spec->mVersionInfo = info;
@@ -348,6 +362,7 @@ void TypeSpecification::scanTypeSpecification(Scanner* scanner, SpecFile* specFi
Type* type = systemSpecification.findOrCreateType(name, &created);
TypeSpecification* spec = new TypeSpecification(type);
type->addSpecification(spec);
+ type->updateFinalVersion(info);
specFile->addTypeSpecification(spec, created);
spec->mVersionInfo = info;
@@ -529,6 +544,7 @@ void FunctionSpecification::scanFunctionSpecification(Scanner* scanner, SpecFile
Function* function = systemSpecification.findOrCreateFunction(name, &created);
FunctionSpecification* spec = new FunctionSpecification(function);
function->addSpecification(spec);
+ function->updateFinalVersion(info);
specFile->addFunctionSpecification(spec, created);
spec->mUnexpandedName = unexpandedName;