diff options
author | Romain Guy <romainguy@android.com> | 2010-08-08 00:14:31 -0700 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2010-08-08 17:45:07 -0700 |
commit | 163935113919a184122b8b3bd672ef08c8df65dc (patch) | |
tree | c8aa9b460ae7fd9e2e675d4bf25924a3459f8696 /libs/hwui | |
parent | 1ad7343409442a4a027c0092d07beff1b412a7dc (diff) | |
download | frameworks_base-163935113919a184122b8b3bd672ef08c8df65dc.zip frameworks_base-163935113919a184122b8b3bd672ef08c8df65dc.tar.gz frameworks_base-163935113919a184122b8b3bd672ef08c8df65dc.tar.bz2 |
Make libhwui entirely optional.
The makefile variable USE_OPENGL_RENDERER must be set to true to compile
libhwui and the related code in the JNI layer.
This change also removes obsolete APIs from Canvas that must not be used
and would be confusing if left in. These APIs were remnants of our first
attempt at an OpenGL renderer for the view hierarchy and had not been
taken out before Android 1.0 was released.
Change-Id: I2475ff1307212bab26c926724f3c508681c7dae1
Diffstat (limited to 'libs/hwui')
-rw-r--r-- | libs/hwui/Android.mk | 64 | ||||
-rw-r--r-- | libs/hwui/TextureCache.cpp | 6 | ||||
-rw-r--r-- | libs/hwui/TextureCache.h | 2 |
3 files changed, 39 insertions, 33 deletions
diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk index 0444964..1efe6b5 100644 --- a/libs/hwui/Android.mk +++ b/libs/hwui/Android.mk @@ -1,33 +1,41 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES:= \ - FontRenderer.cpp \ - GradientCache.cpp \ - LayerCache.cpp \ - Matrix.cpp \ - OpenGLRenderer.cpp \ - Patch.cpp \ - PatchCache.cpp \ - PathCache.cpp \ - Program.cpp \ - ProgramCache.cpp \ - SkiaColorFilter.cpp \ - SkiaShader.cpp \ - TextureCache.cpp +# Only build libhwui when USE_OPENGL_RENDERER is +# defined in the current device/board configuration +ifeq ($(USE_OPENGL_RENDERER),true) + LOCAL_SRC_FILES:= \ + FontRenderer.cpp \ + GradientCache.cpp \ + LayerCache.cpp \ + Matrix.cpp \ + OpenGLRenderer.cpp \ + Patch.cpp \ + PatchCache.cpp \ + PathCache.cpp \ + Program.cpp \ + ProgramCache.cpp \ + SkiaColorFilter.cpp \ + SkiaShader.cpp \ + TextureCache.cpp + + LOCAL_C_INCLUDES += \ + $(JNI_H_INCLUDE) \ + $(LOCAL_PATH)/../../include/utils \ + external/skia/include/core \ + external/skia/include/effects \ + external/skia/include/images \ + external/skia/src/ports \ + external/skia/include/utils -LOCAL_C_INCLUDES += \ - $(JNI_H_INCLUDE) \ - $(LOCAL_PATH)/../../include/utils \ - external/skia/include/core \ - external/skia/include/effects \ - external/skia/include/images \ - external/skia/src/ports \ - external/skia/include/utils + LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER + LOCAL_MODULE_CLASS := SHARED_LIBRARIES + LOCAL_SHARED_LIBRARIES := libcutils libutils libGLESv2 libskia + LOCAL_MODULE := libhwui + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + + include $(BUILD_SHARED_LIBRARY) -LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_SHARED_LIBRARIES := libcutils libutils libGLESv2 libskia -LOCAL_MODULE := libhwui -LOCAL_PRELINK_MODULE := false - -include $(BUILD_SHARED_LIBRARY) + include $(call all-makefiles-under,$(LOCAL_PATH)) +endif diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp index 1cb5932..3f9698d 100644 --- a/libs/hwui/TextureCache.cpp +++ b/libs/hwui/TextureCache.cpp @@ -32,10 +32,8 @@ TextureCache::TextureCache(uint32_t maxByteSize): mSize(0), mMaxSize(maxByteSize) { mCache.setOnEntryRemovedListener(this); - GLint maxTextureSize; - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); - LOGD("Maximum texture dimension is %d pixels", maxTextureSize); - mMaxTextureSize = maxTextureSize; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize); + LOGD("Maximum texture dimension is %d pixels", mMaxTextureSize); } TextureCache::~TextureCache() { diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h index c7e50a1..452716c 100644 --- a/libs/hwui/TextureCache.h +++ b/libs/hwui/TextureCache.h @@ -82,7 +82,7 @@ private: uint32_t mSize; uint32_t mMaxSize; - GLuint mMaxTextureSize; + GLint mMaxTextureSize; }; // class TextureCache }; // namespace uirenderer |