Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

libs/rs: Fix parameter swap in rsAllocation

This change swaps index and size parameter in rsAllocation calls as
Google's comment suggests

Change-Id: Id14ba3de342c8b0ec27fb8b62f3993d8f7e21e46
CRs-Fixed: 320824
  • Loading branch information...
commit f66331dd0c789836c7e711f039c71207cee74bcb 1 parent 0179465
Jeykumar Sankaran authored existz committed
View
2  graphics/jni/android_renderscript_RenderScript.cpp
@@ -567,7 +567,7 @@ nAllocationElementData1D(JNIEnv *_env, jobject _this, RsContext con, jint alloc,
jint len = _env->GetArrayLength(data);
LOG_API("nAllocationElementData1D, con(%p), alloc(%p), offset(%i), comp(%i), len(%i), sizeBytes(%i)", con, (RsAllocation)alloc, offset, compIdx, len, sizeBytes);
jbyte *ptr = _env->GetByteArrayElements(data, NULL);
- rsAllocation1DElementData(con, (RsAllocation)alloc, offset, lod, ptr, compIdx, sizeBytes);
+ rsAllocation1DElementData(con, (RsAllocation)alloc, offset, lod, ptr, sizeBytes, compIdx);
_env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
}
View
4 libs/rs/driver/rsdAllocation.cpp
@@ -494,7 +494,7 @@ void rsdAllocationData3D_alloc(const android::renderscript::Context *rsc,
void rsdAllocationElementData1D(const Context *rsc, const Allocation *alloc,
uint32_t x,
- const void *data, uint32_t cIdx, uint32_t sizeBytes) {
+ const void *data, uint32_t sizeBytes, uint32_t cIdx) {
DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv;
uint32_t eSize = alloc->mHal.state.elementSizeBytes;
@@ -515,7 +515,7 @@ void rsdAllocationElementData1D(const Context *rsc, const Allocation *alloc,
void rsdAllocationElementData2D(const Context *rsc, const Allocation *alloc,
uint32_t x, uint32_t y,
- const void *data, uint32_t cIdx, uint32_t sizeBytes) {
+ const void *data, uint32_t sizeBytes, uint32_t cIdx) {
DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv;
uint32_t eSize = alloc->mHal.state.elementSizeBytes;
View
8 libs/rs/rsAllocation.cpp
@@ -130,7 +130,7 @@ void Allocation::elementData(Context *rsc, uint32_t x, const void *data,
return;
}
- rsc->mHal.funcs.allocation.elementData1D(rsc, this, x, data, cIdx, sizeBytes);
+ rsc->mHal.funcs.allocation.elementData1D(rsc, this, x, data, sizeBytes, cIdx);
sendDirty(rsc);
}
@@ -164,7 +164,7 @@ void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y,
return;
}
- rsc->mHal.funcs.allocation.elementData2D(rsc, this, x, y, data, cIdx, sizeBytes);
+ rsc->mHal.funcs.allocation.elementData2D(rsc, this, x, y, data, sizeBytes, cIdx);
sendDirty(rsc);
}
@@ -429,13 +429,13 @@ void rsi_Allocation1DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t
}
void rsi_Allocation2DElementData(Context *rsc, RsAllocation va, uint32_t x, uint32_t y, uint32_t lod, RsAllocationCubemapFace face,
- const void *data, size_t eoff, uint32_t sizeBytes) { // TODO: this seems wrong, eoff and sizeBytes may be swapped
+ const void *data, uint32_t sizeBytes, size_t eoff) {
Allocation *a = static_cast<Allocation *>(va);
a->elementData(rsc, x, y, data, eoff, sizeBytes);
}
void rsi_Allocation1DElementData(Context *rsc, RsAllocation va, uint32_t x, uint32_t lod,
- const void *data, size_t eoff, uint32_t sizeBytes) { // TODO: this seems wrong, eoff and sizeBytes may be swapped
+ const void *data, uint32_t sizeBytes, size_t eoff) {
Allocation *a = static_cast<Allocation *>(va);
a->elementData(rsc, x, data, eoff, sizeBytes);
}
Please sign in to comment.
Something went wrong with that request. Please try again.