diff options
| author | Chris Craik <ccraik@google.com> | 2015-01-05 15:51:13 -0800 |
|---|---|---|
| committer | Chris Craik <ccraik@google.com> | 2015-01-05 16:49:13 -0800 |
| commit | d41c4d8c732095ae99c955b6b82f7306633004b1 (patch) | |
| tree | dbb2e26c6c5a80c7ccf43e5cd5fb1554cc603555 /libs/hwui/font | |
| parent | 8dfaa4904205772cdceee63ef3989bcdedf1a914 (diff) | |
| download | frameworks_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/font')
| -rw-r--r-- | libs/hwui/font/CacheTexture.cpp | 12 | ||||
| -rw-r--r-- | libs/hwui/font/Font.cpp | 14 |
2 files changed, 13 insertions, 13 deletions
diff --git a/libs/hwui/font/CacheTexture.cpp b/libs/hwui/font/CacheTexture.cpp index 380c0ed..128e392 100644 --- a/libs/hwui/font/CacheTexture.cpp +++ b/libs/hwui/font/CacheTexture.cpp @@ -43,7 +43,7 @@ CacheBlock* CacheBlock::insertBlock(CacheBlock* head, CacheBlock* newBlock) { #endif CacheBlock* currBlock = head; - CacheBlock* prevBlock = NULL; + CacheBlock* prevBlock = nullptr; while (currBlock && currBlock->mY != TEXTURE_BORDER_SIZE) { if (newBlock->mWidth < currBlock->mWidth) { @@ -110,9 +110,9 @@ CacheBlock* CacheBlock::removeBlock(CacheBlock* head, CacheBlock* blockToRemove) /////////////////////////////////////////////////////////////////////////////// CacheTexture::CacheTexture(uint16_t width, uint16_t height, GLenum format, uint32_t maxQuadCount) : - mTexture(NULL), mTextureId(0), mWidth(width), mHeight(height), mFormat(format), + mTexture(nullptr), mTextureId(0), mWidth(width), mHeight(height), mFormat(format), mLinearFiltering(false), mDirty(false), mNumGlyphs(0), - mMesh(NULL), mCurrentQuad(0), mMaxQuadCount(maxQuadCount), + mMesh(nullptr), mCurrentQuad(0), mMaxQuadCount(maxQuadCount), mCaches(Caches::getInstance()) { mCacheBlocks = new CacheBlock(TEXTURE_BORDER_SIZE, TEXTURE_BORDER_SIZE, mWidth - TEXTURE_BORDER_SIZE, mHeight - TEXTURE_BORDER_SIZE); @@ -131,7 +131,7 @@ CacheTexture::~CacheTexture() { void CacheTexture::reset() { // Delete existing cache blocks - while (mCacheBlocks != NULL) { + while (mCacheBlocks != nullptr) { CacheBlock* tmpBlock = mCacheBlocks; mCacheBlocks = mCacheBlocks->mNext; delete tmpBlock; @@ -154,7 +154,7 @@ void CacheTexture::releaseMesh() { void CacheTexture::releaseTexture() { if (mTexture) { delete mTexture; - mTexture = NULL; + mTexture = nullptr; } if (mTextureId) { mCaches.deleteTexture(mTextureId); @@ -193,7 +193,7 @@ void CacheTexture::allocateTexture() { glPixelStorei(GL_UNPACK_ALIGNMENT, 1); // Initialize texture dimensions glTexImage2D(GL_TEXTURE_2D, 0, mFormat, mWidth, mHeight, 0, - mFormat, GL_UNSIGNED_BYTE, 0); + mFormat, GL_UNSIGNED_BYTE, nullptr); const GLenum filtering = getLinearFiltering() ? GL_LINEAR : GL_NEAREST; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering); diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp index 2e6c528..b07a3c8 100644 --- a/libs/hwui/font/Font.cpp +++ b/libs/hwui/font/Font.cpp @@ -298,13 +298,13 @@ CachedGlyphInfo* Font::getCachedGlyph(const SkPaint* paint, glyph_t textUnit, bo void Font::render(const SkPaint* paint, const char *text, uint32_t start, uint32_t len, int numGlyphs, int x, int y, const float* positions) { - render(paint, text, start, len, numGlyphs, x, y, FRAMEBUFFER, NULL, - 0, 0, NULL, positions); + render(paint, text, start, len, numGlyphs, x, y, FRAMEBUFFER, nullptr, + 0, 0, nullptr, positions); } void Font::render(const SkPaint* paint, const char *text, uint32_t start, uint32_t len, int numGlyphs, const SkPath* path, float hOffset, float vOffset) { - if (numGlyphs == 0 || text == NULL || len == 0) { + if (numGlyphs == 0 || text == nullptr || len == 0) { return; } @@ -354,18 +354,18 @@ void Font::render(const SkPaint* paint, const char *text, uint32_t start, uint32 void Font::measure(const SkPaint* paint, const char* text, uint32_t start, uint32_t len, int numGlyphs, Rect *bounds, const float* positions) { - if (bounds == NULL) { + if (bounds == nullptr) { ALOGE("No return rectangle provided to measure text"); return; } bounds->set(1e6, -1e6, -1e6, 1e6); - render(paint, text, start, len, numGlyphs, 0, 0, MEASURE, NULL, 0, 0, bounds, positions); + render(paint, text, start, len, numGlyphs, 0, 0, MEASURE, nullptr, 0, 0, bounds, positions); } void Font::precache(const SkPaint* paint, const char* text, int numGlyphs) { ATRACE_NAME("Precache Glyphs"); - if (numGlyphs == 0 || text == NULL) { + if (numGlyphs == 0 || text == nullptr) { return; } @@ -386,7 +386,7 @@ void Font::precache(const SkPaint* paint, const char* text, int numGlyphs) { void Font::render(const SkPaint* paint, const char* text, uint32_t start, uint32_t len, int numGlyphs, int x, int y, RenderMode mode, uint8_t *bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* positions) { - if (numGlyphs == 0 || text == NULL || len == 0) { + if (numGlyphs == 0 || text == nullptr || len == 0) { return; } |
