From 7d139ba2c331f11e9b485753cc727a0ff202f2a4 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Fri, 2 Jul 2010 11:20:34 -0700 Subject: [PATCH] Remove extra leftover logs and use uint32_t instead of unsigned int. Change-Id: I944f82fe3255de38dc04048cc8bd861f578f01a7 --- libs/hwui/GenerationCache.h | 8 ++++---- libs/hwui/OpenGLRenderer.cpp | 2 -- libs/hwui/Texture.h | 4 ++-- libs/hwui/TextureCache.cpp | 12 ++++++------ libs/hwui/TextureCache.h | 12 ++++++------ 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/libs/hwui/GenerationCache.h b/libs/hwui/GenerationCache.h index e215dafd8f55e..56693dac736e6 100644 --- a/libs/hwui/GenerationCache.h +++ b/libs/hwui/GenerationCache.h @@ -33,7 +33,7 @@ public: template class GenerationCache { public: - GenerationCache(unsigned int maxCapacity): mMaxCapacity(maxCapacity), mListener(NULL) { }; + GenerationCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity), mListener(NULL) { }; ~GenerationCache() { clear(); }; enum Capacity { @@ -50,7 +50,7 @@ public: V* remove(K* key); void removeOldest(); - unsigned int size() const; + uint32_t size() const; private: template @@ -72,7 +72,7 @@ private: void attachToCache(sp > entry); void detachFromCache(sp > entry); - unsigned int mMaxCapacity; + uint32_t mMaxCapacity; OnEntryRemoved* mListener; @@ -83,7 +83,7 @@ private: }; // class GenerationCache template -unsigned int GenerationCache::size() const { +uint32_t GenerationCache::size() const { return mCache.size(); } diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 095d58b81a89b..9df1c6765c501 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -411,8 +411,6 @@ bool OpenGLRenderer::clipRect(float left, float top, float right, float bottom) void OpenGLRenderer::drawBitmap(SkBitmap* bitmap, float left, float top, const SkPaint* paint) { const Texture* texture = mTextureCache.get(bitmap); - LOGD("Texture cache size %d", mTextureCache.getSize()); - LOGD(" max size %d", mTextureCache.getMaxSize()); int alpha; SkXfermode::Mode mode; diff --git a/libs/hwui/Texture.h b/libs/hwui/Texture.h index 6802c59f973f9..d37013d683ba9 100644 --- a/libs/hwui/Texture.h +++ b/libs/hwui/Texture.h @@ -41,11 +41,11 @@ struct Texture { /** * Width of the backing bitmap. */ - unsigned int width; + uint32_t width; /** * Height of the backing bitmap. */ - unsigned int height; + uint32_t height; }; // struct Texture }; // namespace uirenderer diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp index 10e4f9e5df538..93ee138a373c0 100644 --- a/libs/hwui/TextureCache.cpp +++ b/libs/hwui/TextureCache.cpp @@ -27,7 +27,7 @@ namespace uirenderer { // Constructors/destructor /////////////////////////////////////////////////////////////////////////////// -TextureCache::TextureCache(unsigned int maxByteSize): +TextureCache::TextureCache(uint32_t maxByteSize): mCache(GenerationCache::kUnlimitedCapacity), mSize(0), mMaxSize(maxByteSize) { mCache.setOnEntryRemovedListener(this); @@ -41,15 +41,15 @@ TextureCache::~TextureCache() { // Size management /////////////////////////////////////////////////////////////////////////////// -unsigned int TextureCache::getSize() { +uint32_t TextureCache::getSize() { return mSize; } -unsigned int TextureCache::getMaxSize() { +uint32_t TextureCache::getMaxSize() { return mMaxSize; } -void TextureCache::setMaxSize(unsigned int maxSize) { +void TextureCache::setMaxSize(uint32_t maxSize) { mMaxSize = maxSize; while (mSize > mMaxSize) { mCache.removeOldest(); @@ -62,7 +62,7 @@ void TextureCache::setMaxSize(unsigned int maxSize) { void TextureCache::operator()(SkBitmap* bitmap, Texture* texture) { if (bitmap) { - const unsigned int size = bitmap->rowBytes() * bitmap->height(); + const uint32_t size = bitmap->rowBytes() * bitmap->height(); mSize -= size; } @@ -79,7 +79,7 @@ void TextureCache::operator()(SkBitmap* bitmap, Texture* texture) { Texture* TextureCache::get(SkBitmap* bitmap) { Texture* texture = mCache.get(bitmap); if (!texture) { - const unsigned int size = bitmap->rowBytes() * bitmap->height(); + const uint32_t size = bitmap->rowBytes() * bitmap->height(); // Don't even try to cache a bitmap that's bigger than the cache if (size < mMaxSize) { while (mSize + size > mMaxSize) { diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h index c974b65b5432b..250efc56f60f4 100644 --- a/libs/hwui/TextureCache.h +++ b/libs/hwui/TextureCache.h @@ -32,7 +32,7 @@ namespace uirenderer { */ class TextureCache: public OnEntryRemoved { public: - TextureCache(unsigned int maxByteSize); + TextureCache(uint32_t maxByteSize); ~TextureCache(); /** @@ -59,15 +59,15 @@ public: /** * Sets the maximum size of the cache in bytes. */ - void setMaxSize(unsigned int maxSize); + void setMaxSize(uint32_t maxSize); /** * Returns the maximum size of the cache in bytes. */ - unsigned int getMaxSize(); + uint32_t getMaxSize(); /** * Returns the current size of the cache in bytes. */ - unsigned int getSize(); + uint32_t getSize(); private: /** @@ -80,8 +80,8 @@ private: GenerationCache mCache; - unsigned int mSize; - unsigned int mMaxSize; + uint32_t mSize; + uint32_t mMaxSize; }; // class TextureCache }; // namespace uirenderer