summaryrefslogtreecommitdiffstats
path: root/libs/hwui/PixelBuffer.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2015-01-05 15:51:13 -0800
committerChris Craik <ccraik@google.com>2015-01-05 16:49:13 -0800
commitd41c4d8c732095ae99c955b6b82f7306633004b1 (patch)
treedbb2e26c6c5a80c7ccf43e5cd5fb1554cc603555 /libs/hwui/PixelBuffer.cpp
parent8dfaa4904205772cdceee63ef3989bcdedf1a914 (diff)
downloadframeworks_base-d41c4d8c732095ae99c955b6b82f7306633004b1.zip
frameworks_base-d41c4d8c732095ae99c955b6b82f7306633004b1.tar.gz
frameworks_base-d41c4d8c732095ae99c955b6b82f7306633004b1.tar.bz2
Add overrides and switch to nullptr keyword for all files
Adds remaining missing overrides and nullptr usages, missed due to an extreme failure in tool usage. Change-Id: I56abd72975a3999ad13330003c348db40f59aebf
Diffstat (limited to 'libs/hwui/PixelBuffer.cpp')
-rw-r--r--libs/hwui/PixelBuffer.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/libs/hwui/PixelBuffer.cpp b/libs/hwui/PixelBuffer.cpp
index 6c448f0..efa271e 100644
--- a/libs/hwui/PixelBuffer.cpp
+++ b/libs/hwui/PixelBuffer.cpp
@@ -35,12 +35,12 @@ class CpuPixelBuffer: public PixelBuffer {
public:
CpuPixelBuffer(GLenum format, uint32_t width, uint32_t height);
- uint8_t* map(AccessMode mode = kAccessMode_ReadWrite);
- void unmap();
+ uint8_t* map(AccessMode mode = kAccessMode_ReadWrite) override;
+ void unmap() override;
- uint8_t* getMappedPointer() const;
+ uint8_t* getMappedPointer() const override;
- void upload(uint32_t x, uint32_t y, uint32_t width, uint32_t height, int offset);
+ void upload(uint32_t x, uint32_t y, uint32_t width, uint32_t height, int offset) override;
private:
std::unique_ptr<uint8_t[]> mBuffer;
@@ -80,12 +80,12 @@ public:
GpuPixelBuffer(GLenum format, uint32_t width, uint32_t height);
~GpuPixelBuffer();
- uint8_t* map(AccessMode mode = kAccessMode_ReadWrite);
- void unmap();
+ uint8_t* map(AccessMode mode = kAccessMode_ReadWrite) override;
+ void unmap() override;
- uint8_t* getMappedPointer() const;
+ uint8_t* getMappedPointer() const override;
- void upload(uint32_t x, uint32_t y, uint32_t width, uint32_t height, int offset);
+ void upload(uint32_t x, uint32_t y, uint32_t width, uint32_t height, int offset) override;
private:
GLuint mBuffer;
@@ -93,11 +93,13 @@ private:
Caches& mCaches;
};
-GpuPixelBuffer::GpuPixelBuffer(GLenum format, uint32_t width, uint32_t height):
- PixelBuffer(format, width, height), mMappedPointer(0), mCaches(Caches::getInstance()) {
+GpuPixelBuffer::GpuPixelBuffer(GLenum format, uint32_t width, uint32_t height)
+ : PixelBuffer(format, width, height)
+ , mMappedPointer(nullptr)
+ , mCaches(Caches::getInstance()) {
glGenBuffers(1, &mBuffer);
mCaches.bindPixelBuffer(mBuffer);
- glBufferData(GL_PIXEL_UNPACK_BUFFER, getSize(), NULL, GL_DYNAMIC_DRAW);
+ glBufferData(GL_PIXEL_UNPACK_BUFFER, getSize(), nullptr, GL_DYNAMIC_DRAW);
mCaches.unbindPixelBuffer();
}
@@ -133,7 +135,7 @@ void GpuPixelBuffer::unmap() {
}
}
mAccessMode = kAccessMode_None;
- mMappedPointer = NULL;
+ mMappedPointer = nullptr;
}
}