summaryrefslogtreecommitdiff
path: root/libs/gui/BufferItem.cpp
diff options
context:
space:
mode:
author Yi Kong <yikong@google.com> 2018-06-07 23:46:04 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-06-07 23:46:04 +0000
commita160f5a70ffba3715c8a92f4f469922d59635356 (patch)
tree627f17cbd47a952696913884b21d100cc15c855b /libs/gui/BufferItem.cpp
parent978e43d7a14f75a0d2d32517d906e173de48110b (diff)
parent9c804c47fc86a45ac517e9c91d3c986cb9d315dd (diff)
Merge "Replace NULL/0 with nullptr"
Diffstat (limited to 'libs/gui/BufferItem.cpp')
-rw-r--r--libs/gui/BufferItem.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libs/gui/BufferItem.cpp b/libs/gui/BufferItem.cpp
index 69b5962441..9da4ea80e0 100644
--- a/libs/gui/BufferItem.cpp
+++ b/libs/gui/BufferItem.cpp
@@ -39,8 +39,8 @@ static inline constexpr T to64(const uint32_t lo, const uint32_t hi) {
}
BufferItem::BufferItem() :
- mGraphicBuffer(NULL),
- mFence(NULL),
+ mGraphicBuffer(nullptr),
+ mFence(nullptr),
mCrop(Rect::INVALID_RECT),
mTransform(0),
mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
@@ -89,11 +89,11 @@ size_t BufferItem::getPodSize() const {
size_t BufferItem::getFlattenedSize() const {
size_t size = sizeof(uint32_t); // Flags
- if (mGraphicBuffer != 0) {
+ if (mGraphicBuffer != nullptr) {
size += mGraphicBuffer->getFlattenedSize();
size = FlattenableUtils::align<4>(size);
}
- if (mFence != 0) {
+ if (mFence != nullptr) {
size += mFence->getFlattenedSize();
size = FlattenableUtils::align<4>(size);
}
@@ -104,10 +104,10 @@ size_t BufferItem::getFlattenedSize() const {
size_t BufferItem::getFdCount() const {
size_t count = 0;
- if (mGraphicBuffer != 0) {
+ if (mGraphicBuffer != nullptr) {
count += mGraphicBuffer->getFdCount();
}
- if (mFence != 0) {
+ if (mFence != nullptr) {
count += mFence->getFdCount();
}
return count;
@@ -134,13 +134,13 @@ status_t BufferItem::flatten(
FlattenableUtils::advance(buffer, size, sizeof(uint32_t));
flags = 0;
- if (mGraphicBuffer != 0) {
+ if (mGraphicBuffer != nullptr) {
status_t err = mGraphicBuffer->flatten(buffer, size, fds, count);
if (err) return err;
size -= FlattenableUtils::align<4>(buffer);
flags |= 1;
}
- if (mFence != 0) {
+ if (mFence != nullptr) {
status_t err = mFence->flatten(buffer, size, fds, count);
if (err) return err;
size -= FlattenableUtils::align<4>(buffer);