summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsStream.h
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2010-11-09 17:00:54 -0800
committerAlex Sakhartchouk <alexst@google.com>2010-11-10 11:30:51 -0800
commited9f210568082dd6d1d8a0c92c693d574d87d545 (patch)
treed1b9a5c7862ac078064946a122dd89f05d88f38b /libs/rs/rsStream.h
parentc65347f239e0adae4fe9fad5248b69a5a6d3bbe8 (diff)
downloadframeworks_base-ed9f210568082dd6d1d8a0c92c693d574d87d545.zip
frameworks_base-ed9f210568082dd6d1d8a0c92c693d574d87d545.tar.gz
frameworks_base-ed9f210568082dd6d1d8a0c92c693d574d87d545.tar.bz2
Code cleanup to make formatting consistent
across all the renderscript files. Change-Id: Idf5fcc60877e44c8f074f7176e37f70b3b895a3c
Diffstat (limited to 'libs/rs/rsStream.h')
-rw-r--r--libs/rs/rsStream.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/libs/rs/rsStream.h b/libs/rs/rsStream.h
index d401cd1..62bcf94 100644
--- a/libs/rs/rsStream.h
+++ b/libs/rs/rsStream.h
@@ -24,8 +24,7 @@
namespace android {
namespace renderscript {
-class IStream
-{
+class IStream {
public:
IStream(const uint8_t *, bool use64);
@@ -70,7 +69,7 @@ public:
void reset() {
mPos = 0;
}
-
+
const uint8_t * getPtr() const {
return mData;
}
@@ -80,26 +79,25 @@ protected:
bool mUse64;
};
-class OStream
-{
+class OStream {
public:
OStream(uint64_t length, bool use64);
~OStream();
-
+
void align(uint32_t bytes) {
mPos = (mPos + (bytes - 1)) & (~(bytes - 1));
- if(mPos >= mLength) {
+ if (mPos >= mLength) {
growSize();
}
}
-
+
void addF(float v) {
uint32_t uintV = *reinterpret_cast<uint32_t*> (&v);
addU32(uintV);
}
void addI32(int32_t v) {
mPos = (mPos + 3) & (~3);
- if(mPos + sizeof(v) >= mLength) {
+ if (mPos + sizeof(v) >= mLength) {
growSize();
}
mData[mPos++] = (uint8_t)(v & 0xff);
@@ -109,7 +107,7 @@ public:
}
void addU32(uint32_t v) {
mPos = (mPos + 3) & (~3);
- if(mPos + sizeof(v) >= mLength) {
+ if (mPos + sizeof(v) >= mLength) {
growSize();
}
mData[mPos++] = (uint8_t)(v & 0xff);
@@ -119,14 +117,14 @@ public:
}
void addU16(uint16_t v) {
mPos = (mPos + 1) & (~1);
- if(mPos + sizeof(v) >= mLength) {
+ if (mPos + sizeof(v) >= mLength) {
growSize();
}
mData[mPos++] = (uint8_t)(v & 0xff);
mData[mPos++] = (uint8_t)(v >> 8);
}
inline void addU8(uint8_t v) {
- if(mPos + 1 >= mLength) {
+ if (mPos + 1 >= mLength) {
growSize();
}
reinterpret_cast<uint8_t *>(&mData[mPos])[0] = v;
@@ -154,7 +152,7 @@ protected:
uint64_t mPos;
bool mUse64;
};
-
+
} // renderscript
} // android