summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Luc Brouillet <jeanluc@google.com>2015-06-14 08:21:11 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-14 08:21:12 +0000
commitd3fe2229b74e7af0dbe2c7b8615d060ffa4462ef (patch)
treeb0f4a5ac6c982dec6404c99d1a9fc8ce6d15f8f4
parentef300c36411acc9c89a9f0267493249ea7c69f9c (diff)
parent496d0f8f3ce1b12d7d76bae2ecf6fe15a8b3811f (diff)
downloadrs-d3fe2229b74e7af0dbe2c7b8615d060ffa4462ef.tar.gz
Merge "Obsolete the graphics API in the .rsh files." into mnc-dev
-rw-r--r--api/GenerateDocumentation.cpp2
-rw-r--r--api/GenerateHeaderFiles.cpp41
-rw-r--r--api/Specification.cpp18
-rw-r--r--api/Specification.h6
-rw-r--r--api/rs_graphics.spec100
-rwxr-xr-xdriver/runtime/Android.mk18
-rw-r--r--scriptc/rs_convert.rsh10
-rw-r--r--scriptc/rs_graphics.rsh172
8 files changed, 280 insertions, 87 deletions
diff --git a/api/GenerateDocumentation.cpp b/api/GenerateDocumentation.cpp
index e5f238aa..bb1e8103 100644
--- a/api/GenerateDocumentation.cpp
+++ b/api/GenerateDocumentation.cpp
@@ -320,7 +320,7 @@ static void writeHtmlVersionTag(GeneratedFile* file, VersionInfo info) {
if (info.minVersion <= 1) {
// No minimum
if (info.maxVersion > 0) {
- stream << "Removed from " << mid << info.maxVersion + 1;
+ stream << "Removed from " << mid << info.maxVersion + 1 << " and beyond";
}
} else {
if (info.maxVersion == 0) {
diff --git a/api/GenerateHeaderFiles.cpp b/api/GenerateHeaderFiles.cpp
index 97ccab61..45cdba94 100644
--- a/api/GenerateHeaderFiles.cpp
+++ b/api/GenerateHeaderFiles.cpp
@@ -38,27 +38,37 @@ static string makeGuardString(const string& filename) {
return s;
}
-// Write #ifdef's that ensure that the specified version is present
-static void writeVersionGuardStart(GeneratedFile* file, VersionInfo info) {
+/* Write #ifdef's that ensure that the specified version is present. If we're at the final version,
+ * add a check on a flag that can be set for internal builds. This enables us to keep supporting
+ * old APIs in the runtime code.
+ */
+static void writeVersionGuardStart(GeneratedFile* file, VersionInfo info, int finalVersion) {
if (info.intSize == 32) {
*file << "#ifndef __LP64__\n";
} else if (info.intSize == 64) {
*file << "#ifdef __LP64__\n";
}
+ ostringstream checkMaxVersion;
+ if (info.maxVersion > 0) {
+ checkMaxVersion << "(";
+ if (info.maxVersion == finalVersion) {
+ checkMaxVersion << "defined(RS_DECLARE_EXPIRED_APIS) || ";
+ }
+ checkMaxVersion << "RS_VERSION <= " << info.maxVersion << ")";
+ }
+
if (info.minVersion <= 1) {
// No minimum
if (info.maxVersion > 0) {
- *file << "#if !defined(RS_VERSION) || (RS_VERSION <= " << info.maxVersion << ")\n";
+ *file << "#if !defined(RS_VERSION) || " << checkMaxVersion.str() << "\n";
}
} else {
- if (info.maxVersion == 0) {
- // No maximum
- *file << "#if (defined(RS_VERSION) && (RS_VERSION >= " << info.minVersion << "))\n";
- } else {
- *file << "#if (defined(RS_VERSION) && (RS_VERSION >= " << info.minVersion
- << ") && (RS_VERSION <= " << info.maxVersion << "))\n";
+ *file << "#if (defined(RS_VERSION) && (RS_VERSION >= " << info.minVersion << ")";
+ if (info.maxVersion > 0) {
+ *file << " && " << checkMaxVersion.str();
}
+ *file << ")\n";
}
}
@@ -107,16 +117,18 @@ static void writeConstantComment(GeneratedFile* file, const Constant& constant)
}
static void writeConstantSpecification(GeneratedFile* file, const ConstantSpecification& spec) {
+ const Constant* constant = spec.getConstant();
VersionInfo info = spec.getVersionInfo();
- writeVersionGuardStart(file, info);
- *file << "#define " << spec.getConstant()->getName() << " " << spec.getValue() << "\n\n";
+ writeVersionGuardStart(file, info, constant->getFinalVersion());
+ *file << "#define " << constant->getName() << " " << spec.getValue() << "\n\n";
writeVersionGuardEnd(file, info);
}
static void writeTypeSpecification(GeneratedFile* file, const TypeSpecification& spec) {
- const string& typeName = spec.getType()->getName();
+ const Type* type = spec.getType();
+ const string& typeName = type->getName();
const VersionInfo info = spec.getVersionInfo();
- writeVersionGuardStart(file, info);
+ writeVersionGuardStart(file, info, type->getFinalVersion());
switch (spec.getKind()) {
case SIMPLE:
*file << "typedef " << spec.getSimpleType() << " " << typeName << ";\n";
@@ -182,7 +194,8 @@ static void writeTypeComment(GeneratedFile* file, const Type& type) {
static void writeFunctionPermutation(GeneratedFile* file, const FunctionSpecification& spec,
const FunctionPermutation& permutation) {
- writeVersionGuardStart(file, spec.getVersionInfo());
+ Function* function = spec.getFunction();
+ writeVersionGuardStart(file, spec.getVersionInfo(), function->getFinalVersion());
// Write linkage info.
const auto inlineCodeLines = permutation.getInline();
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;
diff --git a/api/Specification.h b/api/Specification.h
index e808e600..97833106 100644
--- a/api/Specification.h
+++ b/api/Specification.h
@@ -147,6 +147,7 @@ protected:
std::string mSummary; // A one-line description
std::vector<std::string> mDescription; // The comments to be included in the header
std::string mUrl; // The URL of the detailed documentation
+ int mFinalVersion; // API level at which this API was removed, 0 if API is still valid
public:
Definition(const std::string& name);
@@ -158,8 +159,11 @@ public:
std::string getSummary() const { return mSummary; }
const std::vector<std::string>& getDescription() const { return mDescription; }
std::string getUrl() const { return mUrl; }
+ int getFinalVersion() const { return mFinalVersion; }
void scanDocumentationTags(Scanner* scanner, bool firstOccurence, const SpecFile* specFile);
+ // Keep track of the final version of this API, if any.
+ void updateFinalVersion(const VersionInfo& info);
};
/* Represents a constant, like M_PI. This is a grouping of the version specific specifications.
@@ -368,7 +372,7 @@ public:
FunctionSpecification(Function* function) : mFunction(function), mReturn(nullptr) {}
~FunctionSpecification();
- Function* getFunction() { return mFunction; }
+ Function* getFunction() const { return mFunction; }
std::string getAttribute() const { return mAttribute; }
std::string getTest() const { return mTest; }
std::string getPrecisionLimit() const { return mPrecisionLimit; }
diff --git a/api/rs_graphics.spec b/api/rs_graphics.spec
index 4f9d9712..a932a53d 100644
--- a/api/rs_graphics.spec
+++ b/api/rs_graphics.spec
@@ -17,7 +17,7 @@
header:
summary: Graphics Functions and Types
description:
- The graphics subsystem of RenderScript has been deprecated.
+ The graphics subsystem of RenderScript was removed at API level 23.
include:
#ifdef __LP64__
// TODO We need to fix some of the builds before enabling this error:
@@ -29,7 +29,7 @@ include:
end:
type: rs_blend_src_func
-version: 16
+version: 16 22
size: 32
enum:
value: RS_BLEND_SRC_ZERO = 0
@@ -48,7 +48,7 @@ description:
end:
type: rs_blend_dst_func
-version: 16
+version: 16 22
size: 32
enum:
value: RS_BLEND_DST_ZERO = 0
@@ -66,7 +66,7 @@ description:
end:
type: rs_cull_mode
-version: 16
+version: 16 22
size: 32
enum:
value: RS_CULL_BACK = 0
@@ -79,7 +79,7 @@ description:
end:
type: rs_depth_func
-version: 16
+version: 16 22
size: 32
enum:
value: RS_DEPTH_FUNC_ALWAYS = 0, "Always drawn"
@@ -98,7 +98,7 @@ description:
end:
type: rs_primitive
-version: 16
+version: 16 22
size: 32
enum:
value: RS_PRIMITIVE_POINT = 0, "Vertex data will be rendered as a series of points"
@@ -115,6 +115,7 @@ description:
end:
type: rs_font
+version: 9 22
size: 32
simple: _RS_HANDLE
deprecated:
@@ -126,6 +127,7 @@ end:
type: rs_mesh
+version: 9 22
size: 32
simple: _RS_HANDLE
deprecated:
@@ -136,6 +138,7 @@ description:
end:
type: rs_program_fragment
+version: 9 22
size: 32
simple: _RS_HANDLE
deprecated:
@@ -146,6 +149,7 @@ description:
end:
type: rs_program_vertex
+version: 9 22
size: 32
simple: _RS_HANDLE
deprecated:
@@ -156,6 +160,7 @@ description:
end:
type: rs_program_raster
+version: 9 22
size: 32
simple: _RS_HANDLE
deprecated:
@@ -166,6 +171,7 @@ description:
end:
type: rs_program_store
+version: 9 22
size: 32
simple: _RS_HANDLE
deprecated:
@@ -176,6 +182,7 @@ description:
end:
function: rsClearObject
+version: 9 22
size: 32
t: rs_mesh, rs_program_fragment, rs_program_vertex, rs_program_raster, rs_program_store, rs_font
ret: void
@@ -184,6 +191,7 @@ test: none
end:
function: rsIsObject
+version: 9 22
size: 32
t: rs_mesh, rs_program_fragment, rs_program_vertex, rs_program_raster, rs_program_store, rs_font
ret: bool
@@ -192,6 +200,7 @@ test: none
end:
function: rsSetObject
+version: 9 22
size: 32
t: rs_mesh, rs_program_fragment, rs_program_vertex, rs_program_raster, rs_program_store, rs_font
ret: void
@@ -201,6 +210,7 @@ test: none
end:
function: rsgAllocationSyncAll
+version: 9 22
size: 32
ret: void
arg: rs_allocation alloc
@@ -217,7 +227,7 @@ test: none
end:
function: rsgAllocationSyncAll
-version: 14
+version: 14 22
size: 32
ret: void
arg: rs_allocation alloc
@@ -226,7 +236,7 @@ test: none
end:
function: rsgBindColorTarget
-version: 14
+version: 14 22
size: 32
ret: void
arg: rs_allocation colorTarget
@@ -239,6 +249,7 @@ test: none
end:
function: rsgBindConstant
+version: 9 22
size: 32
ret: void
arg: rs_program_fragment ps, "program fragment object"
@@ -253,6 +264,7 @@ test: none
end:
function: rsgBindConstant
+version: 9 22
size: 32
ret: void
arg: rs_program_vertex pv, "program vertex object"
@@ -262,7 +274,7 @@ test: none
end:
function: rsgBindDepthTarget
-version: 14
+version: 14 22
size: 32
ret: void
arg: rs_allocation depthTarget
@@ -274,6 +286,7 @@ test: none
end:
function: rsgBindFont
+version: 9 22
size: 32
ret: void
arg: rs_font font, "object to bind"
@@ -285,6 +298,7 @@ test: none
end:
function: rsgBindProgramFragment
+version: 9 22
size: 32
ret: void
arg: rs_program_fragment pf
@@ -296,6 +310,7 @@ test: none
end:
function: rsgBindProgramRaster
+version: 9 22
size: 32
ret: void
arg: rs_program_raster pr
@@ -307,6 +322,7 @@ test: none
end:
function: rsgBindProgramStore
+version: 9 22
size: 32
ret: void
arg: rs_program_store ps
@@ -318,6 +334,7 @@ test: none
end:
function: rsgBindProgramVertex
+version: 9 22
size: 32
ret: void
arg: rs_program_vertex pv
@@ -329,6 +346,7 @@ test: none
end:
function: rsgBindSampler
+version: 9 22
size: 32
ret: void
arg: rs_program_fragment fragment
@@ -343,6 +361,7 @@ test: none
end:
function: rsgBindTexture
+version: 9 22
size: 32
ret: void
arg: rs_program_fragment v
@@ -359,7 +378,7 @@ test: none
end:
function: rsgClearAllRenderTargets
-version: 14
+version: 14 22
size: 32
ret: void
deprecated:
@@ -371,6 +390,7 @@ test: none
end:
function: rsgClearColor
+version: 9 22
size: 32
ret: void
arg: float r
@@ -385,7 +405,7 @@ test: none
end:
function: rsgClearColorTarget
-version: 14
+version: 14 22
size: 32
ret: void
arg: uint slot
@@ -397,6 +417,7 @@ test: none
end:
function: rsgClearDepth
+version: 9 22
size: 32
ret: void
arg: float value
@@ -408,7 +429,7 @@ test: none
end:
function: rsgClearDepthTarget
-version: 14
+version: 14 22
size: 32
ret: void
deprecated:
@@ -419,6 +440,7 @@ test: none
end:
function: rsgDrawMesh
+version: 9 22
size: 32
ret: void
arg: rs_mesh ism, "mesh object to render"
@@ -436,6 +458,7 @@ test: none
end:
function: rsgDrawMesh
+version: 9 22
size: 32
ret: void
arg: rs_mesh ism
@@ -444,6 +467,7 @@ test: none
end:
function: rsgDrawMesh
+version: 9 22
size: 32
ret: void
arg: rs_mesh ism
@@ -454,6 +478,7 @@ test: none
end:
function: rsgDrawQuad
+version: 9 22
size: 32
ret: void
arg: float x1
@@ -477,6 +502,7 @@ test: none
end:
function: rsgDrawQuadTexCoords
+version: 9 22
size: 32
ret: void
arg: float x1
@@ -508,6 +534,7 @@ test: none
end:
function: rsgDrawRect
+version: 9 22
size: 32
ret: void
arg: float x1
@@ -524,6 +551,7 @@ test: none
end:
function: rsgDrawSpriteScreenspace
+version: 9 22
size: 32
ret: void
arg: float x
@@ -542,6 +570,7 @@ test: none
end:
function: rsgDrawText
+version: 9 22
size: 32
ret: void
arg: const char* text
@@ -555,6 +584,7 @@ test: none
end:
function: rsgDrawText
+version: 9 22
size: 32
ret: void
arg: rs_allocation alloc
@@ -564,7 +594,7 @@ test: none
end:
function: rsgFinish
-version: 14
+version: 14 22
size: 32
ret: uint
deprecated:
@@ -575,6 +605,7 @@ test: none
end:
function: rsgFontColor
+version: 9 22
size: 32
ret: void
arg: float r, "red component"
@@ -589,6 +620,7 @@ test: none
end:
function: rsgGetHeight
+version: 9 22
size: 32
ret: uint
deprecated:
@@ -599,6 +631,7 @@ test: none
end:
function: rsgGetWidth
+version: 9 22
size: 32
ret: uint
deprecated:
@@ -609,6 +642,7 @@ test: none
end:
function: rsgMeasureText
+version: 9 22
size: 32
ret: void
arg: const char* text
@@ -625,6 +659,7 @@ test: none
end:
function: rsgMeasureText
+version: 9 22
size: 32
ret: void
arg: rs_allocation alloc
@@ -636,6 +671,7 @@ test: none
end:
function: rsgMeshComputeBoundingBox
+version: 9 22
size: 32
ret: void
arg: rs_mesh mesh
@@ -653,6 +689,7 @@ test: none
end:
function: rsgMeshComputeBoundingBox
+version: 9 22
size: 32
attrib: always_inline
ret: void
@@ -672,7 +709,7 @@ test: none
end:
function: rsgMeshGetIndexAllocation
-version: 16
+version: 16 22
size: 32
ret: rs_allocation, "allocation containing index data"
arg: rs_mesh m, "mesh to get data from"
@@ -686,7 +723,7 @@ test: none
end:
function: rsgMeshGetPrimitive
-version: 16
+version: 16 22
size: 32
ret: rs_primitive, "primitive describing how the mesh is rendered"
arg: rs_mesh m, "mesh to get data from"
@@ -700,7 +737,7 @@ test: none
end:
function: rsgMeshGetPrimitiveCount
-version: 16
+version: 16 22
size: 32
ret: uint32_t, "number of primitive groups in the mesh. This would include simple primitives as well as allocations containing index data"
arg: rs_mesh m, "mesh to get data from"
@@ -713,7 +750,7 @@ test: none
end:
function: rsgMeshGetVertexAllocation
-version: 16
+version: 16 22
size: 32
ret: rs_allocation, "allocation containing vertex data"
arg: rs_mesh m, "mesh to get data from"
@@ -727,7 +764,7 @@ test: none
end:
function: rsgMeshGetVertexAllocationCount
-version: 16
+version: 16 22
size: 32
ret: uint32_t, "number of allocations in the mesh that contain vertex data"
arg: rs_mesh m, "mesh to get data from"
@@ -740,6 +777,7 @@ test: none
end:
function: rsgProgramFragmentConstantColor
+version: 9 22
size: 32
ret: void
arg: rs_program_fragment pf
@@ -755,6 +793,7 @@ test: none
end:
function: rsgProgramVertexGetProjectionMatrix
+version: 9 22
size: 32
ret: void
arg: rs_matrix4x4* proj, "matrix to store the current projection matrix into"
@@ -768,6 +807,7 @@ test: none
end:
function: rsgProgramVertexLoadModelMatrix
+version: 9 22
size: 32
ret: void
arg: const rs_matrix4x4* model, "model matrix"
@@ -781,6 +821,7 @@ test: none
end:
function: rsgProgramVertexLoadProjectionMatrix
+version: 9 22
size: 32
ret: void
arg: const rs_matrix4x4* proj, "projection matrix"
@@ -794,6 +835,7 @@ test: none
end:
function: rsgProgramVertexLoadTextureMatrix
+version: 9 22
size: 32
ret: void
arg: const rs_matrix4x4* tex, "texture matrix"
@@ -807,7 +849,7 @@ test: none
end:
function: rsgProgramRasterGetCullMode
-version: 16
+version: 16 22
size: 32
ret: rs_cull_mode
arg: rs_program_raster pr, "program raster to query"
@@ -819,7 +861,7 @@ test: none
end:
function: rsgProgramRasterIsPointSpriteEnabled
-version: 16
+version: 16 22
size: 32
ret: bool
arg: rs_program_raster pr, "program raster to query"
@@ -831,7 +873,7 @@ test: none
end:
function: rsgProgramStoreGetBlendDstFunc
-version: 16
+version: 16 22
size: 32
ret: rs_blend_dst_func
arg: rs_program_store ps, "program store to query"
@@ -843,7 +885,7 @@ test: none
end:
function: rsgProgramStoreGetBlendSrcFunc
-version: 16
+version: 16 22
size: 32
ret: rs_blend_src_func
arg: rs_program_store ps, "program store to query"
@@ -855,7 +897,7 @@ test: none
end:
function: rsgProgramStoreGetDepthFunc
-version: 16
+version: 16 22
size: 32
ret: rs_depth_func
arg: rs_program_store ps, "program store to query"
@@ -867,7 +909,7 @@ test: none
end:
function: rsgProgramStoreIsColorMaskAlphaEnabled
-version: 16
+version: 16 22
size: 32
ret: bool
arg: rs_program_store ps, "program store to query"
@@ -879,7 +921,7 @@ test: none
end:
function: rsgProgramStoreIsColorMaskBlueEnabled
-version: 16
+version: 16 22
size: 32
ret: bool
arg: rs_program_store ps, "program store to query"
@@ -891,7 +933,7 @@ test: none
end:
function: rsgProgramStoreIsColorMaskGreenEnabled
-version: 16
+version: 16 22
size: 32
ret: bool
arg: rs_program_store ps, "program store to query"
@@ -903,7 +945,7 @@ test: none
end:
function: rsgProgramStoreIsColorMaskRedEnabled
-version: 16
+version: 16 22
size: 32
ret: bool
arg: rs_program_store ps, "program store to query"
@@ -915,7 +957,7 @@ test: none
end:
function: rsgProgramStoreIsDepthMaskEnabled
-version: 16
+version: 16 22
size: 32
ret: bool
arg: rs_program_store ps, "program store to query"
@@ -927,7 +969,7 @@ test: none
end:
function: rsgProgramStoreIsDitherEnabled
-version: 16
+version: 16 22
size: 32
ret: bool
arg: rs_program_store ps, "program store to query"
diff --git a/driver/runtime/Android.mk b/driver/runtime/Android.mk
index a249bea0..d44f70d2 100755
--- a/driver/runtime/Android.mk
+++ b/driver/runtime/Android.mk
@@ -29,7 +29,7 @@ clcore_base_files := \
rs_sampler.c \
rs_convert.c
-clcore_includes := -Iframeworks/rs/cpu_ref
+clcore_cflags := -Iframeworks/rs/cpu_ref -DRS_DECLARE_EXPIRED_APIS
clcore_base_files_32 := \
ll32/allocation.ll
@@ -73,7 +73,7 @@ include frameworks/compile/slang/rs_version.mk
include $(CLEAR_VARS)
LOCAL_MODULE := libclcore.bc
-LOCAL_CFLAGS += $(clcore_includes)
+LOCAL_CFLAGS += $(clcore_cflags)
LOCAL_SRC_FILES := $(clcore_base_files)
LOCAL_SRC_FILES_32 := $(clcore_files_32)
LOCAL_SRC_FILES_32 += arch/generic.c
@@ -92,7 +92,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libclcore_debug.bc
rs_debug_runtime := 1
-LOCAL_CFLAGS += $(clcore_includes)
+LOCAL_CFLAGS += $(clcore_cflags)
LOCAL_SRC_FILES := $(clcore_base_files)
LOCAL_SRC_FILES_32 := $(clcore_files_32)
LOCAL_SRC_FILES_32 += arch/generic.c
@@ -112,7 +112,7 @@ ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
include $(CLEAR_VARS)
LOCAL_MODULE := libclcore_x86.bc
-LOCAL_CFLAGS += $(clcore_includes)
+LOCAL_CFLAGS += $(clcore_cflags)
LOCAL_SRC_FILES := $(clcore_x86_files)
LOCAL_SRC_FILES_32 := $(clcore_base_files_32)
LOCAL_SRC_FILES_64 := $(clcore_base_files_64)
@@ -128,7 +128,7 @@ ifeq ($(ARCH_ARM_HAVE_NEON),true)
LOCAL_32_BIT_ONLY := true
LOCAL_MODULE := libclcore_neon.bc
- LOCAL_CFLAGS += $(clcore_includes)
+ LOCAL_CFLAGS += $(clcore_cflags)
LOCAL_SRC_FILES := $(clcore_neon_files)
LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON
@@ -148,7 +148,7 @@ BCC_RS_TRIPLE := armv7-none-linux-gnueabi
RS_TRIPLE_CFLAGS :=
LOCAL_MODULE := librsrt_arm.bc
LOCAL_IS_HOST_MODULE := true
-LOCAL_CFLAGS += $(clcore_includes)
+LOCAL_CFLAGS += $(clcore_cflags)
LOCAL_SRC_FILES := $(clcore_files) $(clcore_files_32)
include $(LOCAL_PATH)/build_bc_lib.mk
@@ -162,7 +162,7 @@ BCC_RS_TRIPLE := armv7-none-linux-gnueabi
RS_TRIPLE_CFLAGS :=
LOCAL_MODULE := librsrt_mips.bc
LOCAL_IS_HOST_MODULE := true
-LOCAL_CFLAGS += $(clcore_includes)
+LOCAL_CFLAGS += $(clcore_cflags)
LOCAL_SRC_FILES := $(clcore_files) $(clcore_files_32)
include $(LOCAL_PATH)/build_bc_lib.mk
@@ -176,7 +176,7 @@ BCC_RS_TRIPLE := armv7-none-linux-gnueabi
RS_TRIPLE_CFLAGS := -D__i386__
LOCAL_MODULE := librsrt_x86.bc
LOCAL_IS_HOST_MODULE := true
-LOCAL_CFLAGS += $(clcore_includes)
+LOCAL_CFLAGS += $(clcore_cflags)
LOCAL_SRC_FILES := $(clcore_x86_files) $(clcore_base_files_32)
include $(LOCAL_PATH)/build_bc_lib.mk
@@ -186,6 +186,6 @@ BCC_RS_TRIPLE := aarch64-linux-android
RS_TRIPLE_CFLAGS :=
LOCAL_MODULE := librsrt_arm64.bc
LOCAL_IS_HOST_MODULE := true
-LOCAL_CFLAGS += $(clcore_includes)
+LOCAL_CFLAGS += $(clcore_cflags)
LOCAL_SRC_FILES := $(clcore_files) $(clcore_files_64)
include $(LOCAL_PATH)/build_bc_lib.mk
diff --git a/scriptc/rs_convert.rsh b/scriptc/rs_convert.rsh
index 7cf6c504..66e47c64 100644
--- a/scriptc/rs_convert.rsh
+++ b/scriptc/rs_convert.rsh
@@ -1249,9 +1249,13 @@ extern ulong4 __attribute__((const, overloadable))
/*
* rsPackColorTo8888: Create a uchar4 RGBA from floats
*
- * Packs three or four floating point RGBA values into a uchar4. The RGBA values should be
- * between 0.0 and 1.0 inclusive. Values outside of this range are clamped to this range.
- * However numbers greater than INT_MAX or less than INT_MIN can result in undefined behavior.
+ * Packs three or four floating point RGBA values into a uchar4.
+ *
+ * The input values are typically between 0.0 and 1.0 inclusive. For input values outside
+ * of this range, the resulting outputs will be clamped to be between 0 and 255. As this
+ * clamping may be done after the input is multiplied by 255.f and converted to an integer,
+ * input numbers greater than INT_MAX/255.f or less than INT_MIN/255.f can result in
+ * undefined behavior.
*
* If the alpha component is not specified, it is assumed to be 1.0, i.e. the result will
* have an alpha set to 255.
diff --git a/scriptc/rs_graphics.rsh b/scriptc/rs_graphics.rsh
index 5439f061..dc06d985 100644
--- a/scriptc/rs_graphics.rsh
+++ b/scriptc/rs_graphics.rsh
@@ -19,7 +19,7 @@
/*
* rs_graphics.rsh: Graphics Functions and Types
*
- * The graphics subsystem of RenderScript has been deprecated.
+ * The graphics subsystem of RenderScript was removed at API level 23.
*/
#ifndef RENDERSCRIPT_RS_GRAPHICS_RSH
@@ -40,7 +40,7 @@
*
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
typedef enum {
RS_BLEND_SRC_ZERO = 0,
RS_BLEND_SRC_ONE = 1,
@@ -63,7 +63,7 @@ typedef enum {
*
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
typedef enum {
RS_BLEND_DST_ZERO = 0,
RS_BLEND_DST_ONE = 1,
@@ -85,7 +85,7 @@ typedef enum {
*
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
typedef enum {
RS_CULL_BACK = 0,
RS_CULL_FRONT = 1,
@@ -104,7 +104,7 @@ typedef enum {
* depth to that found in the depth buffer.
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
typedef enum {
RS_DEPTH_FUNC_ALWAYS = 0, // Always drawn
RS_DEPTH_FUNC_LESS = 1, // Drawn if the incoming depth value is less than that in the depth buffer
@@ -126,7 +126,7 @@ typedef enum {
* Describes the way mesh vertex data is interpreted when rendering
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
typedef enum {
RS_PRIMITIVE_POINT = 0, // Vertex data will be rendered as a series of points
RS_PRIMITIVE_LINE = 1, // Vertex pairs will be rendered as lines
@@ -148,8 +148,10 @@ typedef enum {
* See: android.renderscript.Font
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
typedef _RS_HANDLE rs_font;
#endif
+#endif
/*
* rs_mesh: Handle to a Mesh
@@ -160,8 +162,10 @@ typedef _RS_HANDLE rs_font;
* See: android.renderscript.Mesh
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
typedef _RS_HANDLE rs_mesh;
#endif
+#endif
/*
* rs_program_fragment: Handle to a ProgramFragment
@@ -172,8 +176,10 @@ typedef _RS_HANDLE rs_mesh;
* See: android.renderscript.ProgramFragment
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
typedef _RS_HANDLE rs_program_fragment;
#endif
+#endif
/*
* rs_program_vertex: Handle to a ProgramVertex
@@ -184,8 +190,10 @@ typedef _RS_HANDLE rs_program_fragment;
* See: android.renderscript.ProgramVertex
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
typedef _RS_HANDLE rs_program_vertex;
#endif
+#endif
/*
* rs_program_raster: Handle to a ProgramRaster
@@ -196,8 +204,10 @@ typedef _RS_HANDLE rs_program_vertex;
* See: android.renderscript.ProgramRaster
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
typedef _RS_HANDLE rs_program_raster;
#endif
+#endif
/*
* rs_program_store: Handle to a ProgramStore
@@ -208,8 +218,10 @@ typedef _RS_HANDLE rs_program_raster;
* See: android.renderscript.ProgramStore
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
typedef _RS_HANDLE rs_program_store;
#endif
+#endif
/*
* rsClearObject: Release an object
@@ -220,34 +232,46 @@ typedef _RS_HANDLE rs_program_store;
* After calling this function, *dst will be set to an empty handle. See rsIsObject().
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsClearObject(rs_mesh* dst);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsClearObject(rs_program_fragment* dst);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsClearObject(rs_program_vertex* dst);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsClearObject(rs_program_raster* dst);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsClearObject(rs_program_store* dst);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsClearObject(rs_font* dst);
#endif
+#endif
/*
* rsIsObject: Check for an empty handle
@@ -261,68 +285,92 @@ extern void __attribute__((overloadable))
* or see if rsClearObject() has been called on a handle.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern bool __attribute__((overloadable))
rsIsObject(rs_mesh v);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern bool __attribute__((overloadable))
rsIsObject(rs_program_fragment v);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern bool __attribute__((overloadable))
rsIsObject(rs_program_vertex v);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern bool __attribute__((overloadable))
rsIsObject(rs_program_raster v);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern bool __attribute__((overloadable))
rsIsObject(rs_program_store v);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern bool __attribute__((overloadable))
rsIsObject(rs_font v);
#endif
+#endif
/*
* rsSetObject: For internal use.
*
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsSetObject(rs_mesh* dst, rs_mesh src);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsSetObject(rs_program_fragment* dst, rs_program_fragment src);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsSetObject(rs_program_vertex* dst, rs_program_vertex src);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsSetObject(rs_program_raster* dst, rs_program_raster src);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsSetObject(rs_program_store* dst, rs_program_store src);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsSetObject(rs_font* dst, rs_font src);
#endif
+#endif
/*
* rsgAllocationSyncAll: Sync the contents of an allocation
@@ -337,12 +385,14 @@ extern void __attribute__((overloadable))
* memory spaces.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgAllocationSyncAll(rs_allocation alloc);
#endif
+#endif
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 14))
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern void __attribute__((overloadable))
rsgAllocationSyncAll(rs_allocation alloc, rs_allocation_usage_type source);
#endif
@@ -356,7 +406,7 @@ extern void __attribute__((overloadable))
* Set the color target used for all subsequent rendering calls
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 14))
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern void __attribute__((overloadable))
rsgBindColorTarget(rs_allocation colorTarget, uint slot);
#endif
@@ -377,14 +427,18 @@ extern void __attribute__((overloadable))
* pv: program vertex object
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgBindConstant(rs_program_fragment ps, uint slot, rs_allocation c);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgBindConstant(rs_program_vertex pv, uint slot, rs_allocation c);
#endif
+#endif
/*
* rsgBindDepthTarget: Set the depth target
@@ -394,7 +448,7 @@ extern void __attribute__((overloadable))
* Set the depth target used for all subsequent rendering calls
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 14))
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern void __attribute__((overloadable))
rsgBindDepthTarget(rs_allocation depthTarget);
#endif
@@ -411,9 +465,11 @@ extern void __attribute__((overloadable))
* font: object to bind
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgBindFont(rs_font font);
#endif
+#endif
/*
* rsgBindProgramFragment: Bind a ProgramFragment
@@ -423,9 +479,11 @@ extern void __attribute__((overloadable))
* Bind a new ProgramFragment to the rendering context.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgBindProgramFragment(rs_program_fragment pf);
#endif
+#endif
/*
* rsgBindProgramRaster: Bind a ProgramRaster
@@ -435,9 +493,11 @@ extern void __attribute__((overloadable))
* Bind a new ProgramRaster to the rendering context.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgBindProgramRaster(rs_program_raster pr);
#endif
+#endif
/*
* rsgBindProgramStore: Bind a ProgramStore
@@ -447,9 +507,11 @@ extern void __attribute__((overloadable))
* Bind a new ProgramStore to the rendering context.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgBindProgramStore(rs_program_store ps);
#endif
+#endif
/*
* rsgBindProgramVertex: Bind a ProgramVertex
@@ -459,9 +521,11 @@ extern void __attribute__((overloadable))
* Bind a new ProgramVertex to the rendering context.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgBindProgramVertex(rs_program_vertex pv);
#endif
+#endif
/*
* rsgBindSampler: Bind a sampler
@@ -472,9 +536,11 @@ extern void __attribute__((overloadable))
* operate on the texture bound at the matching slot.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgBindSampler(rs_program_fragment fragment, uint slot, rs_sampler sampler);
#endif
+#endif
/*
* rsgBindTexture: Bind a texture allocation
@@ -487,9 +553,11 @@ extern void __attribute__((overloadable))
* matching slot.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgBindTexture(rs_program_fragment v, uint slot, rs_allocation alloc);
#endif
+#endif
/*
* rsgClearAllRenderTargets: Clear all color and depth targets
@@ -500,7 +568,7 @@ extern void __attribute__((overloadable))
* the framebuffer
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 14))
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern void __attribute__((overloadable))
rsgClearAllRenderTargets(void);
#endif
@@ -514,9 +582,11 @@ extern void __attribute__((overloadable))
* Clears the rendering surface to the specified color.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgClearColor(float r, float g, float b, float a);
#endif
+#endif
/*
* rsgClearColorTarget: Clear the color target
@@ -526,7 +596,7 @@ extern void __attribute__((overloadable))
* Clear the previously set color target
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 14))
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern void __attribute__((overloadable))
rsgClearColorTarget(uint slot);
#endif
@@ -540,9 +610,11 @@ extern void __attribute__((overloadable))
* Clears the depth suface to the specified value.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgClearDepth(float value);
#endif
+#endif
/*
* rsgClearDepthTarget: Clear the depth target
@@ -552,7 +624,7 @@ extern void __attribute__((overloadable))
* Clear the previously set depth target
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 14))
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern void __attribute__((overloadable))
rsgClearDepthTarget(void);
#endif
@@ -578,19 +650,25 @@ extern void __attribute__((overloadable))
* len: number of indices to draw
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgDrawMesh(rs_mesh ism);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgDrawMesh(rs_mesh ism, uint primitiveIndex);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgDrawMesh(rs_mesh ism, uint primitiveIndex, uint start, uint len);
#endif
+#endif
/*
* rsgDrawQuad: Draw a quad
@@ -601,10 +679,12 @@ extern void __attribute__((overloadable))
* drawing large quantities of geometry.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgDrawQuad(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3,
float z3, float x4, float y4, float z4);
#endif
+#endif
/*
* rsgDrawQuadTexCoords: Draw a textured quad
@@ -615,11 +695,13 @@ extern void __attribute__((overloadable))
* for drawing large quantities of geometry.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgDrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, float x2, float y2,
float z2, float u2, float v2, float x3, float y3, float z3, float u3,
float v3, float x4, float y4, float z4, float u4, float v4);
#endif
+#endif
/*
* rsgDrawRect: Draw a rectangle
@@ -630,9 +712,11 @@ extern void __attribute__((overloadable))
* intended for drawing large quantities of geometry.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgDrawRect(float x1, float y1, float x2, float y2, float z);
#endif
+#endif
/*
* rsgDrawSpriteScreenspace: Draw rectangles in screenspace
@@ -645,9 +729,11 @@ extern void __attribute__((overloadable))
* for drawing in shipping applications.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgDrawSpriteScreenspace(float x, float y, float z, float w, float h);
#endif
+#endif
/*
* rsgDrawText: Draw a text string
@@ -657,14 +743,18 @@ extern void __attribute__((overloadable))
* Draws text given a string and location
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgDrawText(const char* text, int x, int y);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgDrawText(rs_allocation alloc, int x, int y);
#endif
+#endif
/*
* rsgFinish: End rendering commands
@@ -674,7 +764,7 @@ extern void __attribute__((overloadable))
* Force RenderScript to finish all rendering commands
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 14))
+#if (defined(RS_VERSION) && (RS_VERSION >= 14) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern uint __attribute__((overloadable))
rsgFinish(void);
#endif
@@ -694,9 +784,11 @@ extern uint __attribute__((overloadable))
* a: alpha component
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgFontColor(float r, float g, float b, float a);
#endif
+#endif
/*
* rsgGetHeight: Get the surface height
@@ -706,9 +798,11 @@ extern void __attribute__((overloadable))
* Get the height of the current rendering surface.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern uint __attribute__((overloadable))
rsgGetHeight(void);
#endif
+#endif
/*
* rsgGetWidth: Get the surface width
@@ -718,9 +812,11 @@ extern uint __attribute__((overloadable))
* Get the width of the current rendering surface.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern uint __attribute__((overloadable))
rsgGetWidth(void);
#endif
+#endif
/*
* rsgMeasureText: Get the bounding box for a text string
@@ -731,14 +827,18 @@ extern uint __attribute__((overloadable))
* Any of left, right, top, bottom could be NULL
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgMeasureText(const char* text, int* left, int* right, int* top, int* bottom);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgMeasureText(rs_allocation alloc, int* left, int* right, int* top, int* bottom);
#endif
+#endif
/*
* rsgMeshComputeBoundingBox: Compute a bounding box
@@ -748,12 +848,15 @@ extern void __attribute__((overloadable))
* Computes an axis aligned bounding box of a mesh object
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgMeshComputeBoundingBox(rs_mesh mesh, float* minX, float* minY, float* min, float* maxX,
float* maxY, float* maxZ);
#endif
+#endif
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
static inline void __attribute__((always_inline, overloadable))
rsgMeshComputeBoundingBox(rs_mesh mesh, float3* bBoxMin, float3* bBoxMax) {
float x1, y1, z1, x2, y2, z2;
@@ -766,6 +869,7 @@ static inline void __attribute__((always_inline, overloadable))
bBoxMax->z = z2;
}
#endif
+#endif
/*
* rsgMeshGetIndexAllocation: Return an allocation containing index data
@@ -782,7 +886,7 @@ static inline void __attribute__((always_inline, overloadable))
* Returns: allocation containing index data
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern rs_allocation __attribute__((overloadable))
rsgMeshGetIndexAllocation(rs_mesh m, uint32_t index);
#endif
@@ -803,7 +907,7 @@ extern rs_allocation __attribute__((overloadable))
* Returns: primitive describing how the mesh is rendered
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern rs_primitive __attribute__((overloadable))
rsgMeshGetPrimitive(rs_mesh m, uint32_t index);
#endif
@@ -823,7 +927,7 @@ extern rs_primitive __attribute__((overloadable))
* Returns: number of primitive groups in the mesh. This would include simple primitives as well as allocations containing index data
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern uint32_t __attribute__((overloadable))
rsgMeshGetPrimitiveCount(rs_mesh m);
#endif
@@ -844,7 +948,7 @@ extern uint32_t __attribute__((overloadable))
* Returns: allocation containing vertex data
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern rs_allocation __attribute__((overloadable))
rsgMeshGetVertexAllocation(rs_mesh m, uint32_t index);
#endif
@@ -864,7 +968,7 @@ extern rs_allocation __attribute__((overloadable))
* Returns: number of allocations in the mesh that contain vertex data
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern uint32_t __attribute__((overloadable))
rsgMeshGetVertexAllocationCount(rs_mesh m);
#endif
@@ -878,9 +982,11 @@ extern uint32_t __attribute__((overloadable))
* Set the constant color for a fixed function emulation program.
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgProgramFragmentConstantColor(rs_program_fragment pf, float r, float g, float b, float a);
#endif
+#endif
/*
* rsgProgramVertexGetProjectionMatrix: Get the projection matrix for a fixed function vertex program
@@ -895,9 +1001,11 @@ extern void __attribute__((overloadable))
* proj: matrix to store the current projection matrix into
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgProgramVertexGetProjectionMatrix(rs_matrix4x4* proj);
#endif
+#endif
/*
* rsgProgramVertexLoadModelMatrix: Load the model matrix for a bound fixed function vertex program
@@ -912,9 +1020,11 @@ extern void __attribute__((overloadable))
* model: model matrix
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgProgramVertexLoadModelMatrix(const rs_matrix4x4* model);
#endif
+#endif
/*
* rsgProgramVertexLoadProjectionMatrix: Load the projection matrix for a bound fixed function vertex program
@@ -929,9 +1039,11 @@ extern void __attribute__((overloadable))
* proj: projection matrix
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgProgramVertexLoadProjectionMatrix(const rs_matrix4x4* proj);
#endif
+#endif
/*
* rsgProgramVertexLoadTextureMatrix: Load the texture matrix for a bound fixed function vertex program
@@ -946,9 +1058,11 @@ extern void __attribute__((overloadable))
* tex: texture matrix
*/
#ifndef __LP64__
+#if !defined(RS_VERSION) || (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22)
extern void __attribute__((overloadable))
rsgProgramVertexLoadTextureMatrix(const rs_matrix4x4* tex);
#endif
+#endif
/*
* rsgProgramRasterGetCullMode: Get program raster cull mode
@@ -961,7 +1075,7 @@ extern void __attribute__((overloadable))
* pr: program raster to query
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern rs_cull_mode __attribute__((overloadable))
rsgProgramRasterGetCullMode(rs_program_raster pr);
#endif
@@ -978,7 +1092,7 @@ extern rs_cull_mode __attribute__((overloadable))
* pr: program raster to query
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern bool __attribute__((overloadable))
rsgProgramRasterIsPointSpriteEnabled(rs_program_raster pr);
#endif
@@ -995,7 +1109,7 @@ extern bool __attribute__((overloadable))
* ps: program store to query
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern rs_blend_dst_func __attribute__((overloadable))
rsgProgramStoreGetBlendDstFunc(rs_program_store ps);
#endif
@@ -1012,7 +1126,7 @@ extern rs_blend_dst_func __attribute__((overloadable))
* ps: program store to query
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern rs_blend_src_func __attribute__((overloadable))
rsgProgramStoreGetBlendSrcFunc(rs_program_store ps);
#endif
@@ -1029,7 +1143,7 @@ extern rs_blend_src_func __attribute__((overloadable))
* ps: program store to query
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern rs_depth_func __attribute__((overloadable))
rsgProgramStoreGetDepthFunc(rs_program_store ps);
#endif
@@ -1046,7 +1160,7 @@ extern rs_depth_func __attribute__((overloadable))
* ps: program store to query
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern bool __attribute__((overloadable))
rsgProgramStoreIsColorMaskAlphaEnabled(rs_program_store ps);
#endif
@@ -1063,7 +1177,7 @@ extern bool __attribute__((overloadable))
* ps: program store to query
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern bool __attribute__((overloadable))
rsgProgramStoreIsColorMaskBlueEnabled(rs_program_store ps);
#endif
@@ -1080,7 +1194,7 @@ extern bool __attribute__((overloadable))
* ps: program store to query
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern bool __attribute__((overloadable))
rsgProgramStoreIsColorMaskGreenEnabled(rs_program_store ps);
#endif
@@ -1097,7 +1211,7 @@ extern bool __attribute__((overloadable))
* ps: program store to query
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern bool __attribute__((overloadable))
rsgProgramStoreIsColorMaskRedEnabled(rs_program_store ps);
#endif
@@ -1114,7 +1228,7 @@ extern bool __attribute__((overloadable))
* ps: program store to query
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern bool __attribute__((overloadable))
rsgProgramStoreIsDepthMaskEnabled(rs_program_store ps);
#endif
@@ -1131,7 +1245,7 @@ extern bool __attribute__((overloadable))
* ps: program store to query
*/
#ifndef __LP64__
-#if (defined(RS_VERSION) && (RS_VERSION >= 16))
+#if (defined(RS_VERSION) && (RS_VERSION >= 16) && (defined(RS_DECLARE_EXPIRED_APIS) || RS_VERSION <= 22))
extern bool __attribute__((overloadable))
rsgProgramStoreIsDitherEnabled(rs_program_store ps);
#endif