From b38c1e8cfd27feb4dd17dfcb9b927777d2bf3024 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Tue, 3 Nov 2015 10:33:34 -0800 Subject: Use clang for libhwui bug:25417885 Change-Id: I0ef8034d79ba3682925e3c2a4b7ccd833fd4f156 --- libs/hwui/Android.common.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libs') diff --git a/libs/hwui/Android.common.mk b/libs/hwui/Android.common.mk index 38e8be9..c80f2cf 100644 --- a/libs/hwui/Android.common.mk +++ b/libs/hwui/Android.common.mk @@ -1,6 +1,9 @@ # getConfig in external/skia/include/core/SkBitmap.h is deprecated. # Allow Gnu extension: in-class initializer of static 'const float' member. # DeferredLayerUpdater.h: private field 'mRenderThread' is not used. + +LOCAL_CLANG := true + LOCAL_CLANG_CFLAGS += \ -Wno-deprecated-declarations \ -Wno-gnu-static-float-init \ -- cgit v1.1 From 09298272d1164e3c2df0f7337eb6598652becb10 Mon Sep 17 00:00:00 2001 From: John Reck Date: Wed, 4 Nov 2015 15:21:35 +0000 Subject: Revert "Use clang for libhwui" Bug 25462107 This reverts commit d354fd2c66855d116440eb4c936317f124241225. Change-Id: Ib7c50b5becf247f837f3cc20f9128d9411d22563 --- libs/hwui/Android.common.mk | 3 --- 1 file changed, 3 deletions(-) (limited to 'libs') diff --git a/libs/hwui/Android.common.mk b/libs/hwui/Android.common.mk index c80f2cf..38e8be9 100644 --- a/libs/hwui/Android.common.mk +++ b/libs/hwui/Android.common.mk @@ -1,9 +1,6 @@ # getConfig in external/skia/include/core/SkBitmap.h is deprecated. # Allow Gnu extension: in-class initializer of static 'const float' member. # DeferredLayerUpdater.h: private field 'mRenderThread' is not used. - -LOCAL_CLANG := true - LOCAL_CLANG_CFLAGS += \ -Wno-deprecated-declarations \ -Wno-gnu-static-float-init \ -- cgit v1.1 From 067470f063e87bcff7f8fb06220d1ed3f4eda5e8 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Wed, 4 Nov 2015 10:12:28 -0800 Subject: Remove -ffast-math from libhwui makefile bug:25417885 Change-Id: I8244bd28c2d46fc449398b9bf5104bf7cbaded8a --- libs/hwui/Android.common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/hwui/Android.common.mk b/libs/hwui/Android.common.mk index 38e8be9..94bb981 100644 --- a/libs/hwui/Android.common.mk +++ b/libs/hwui/Android.common.mk @@ -119,7 +119,7 @@ endif # Defaults for ATRACE_TAG and LOG_TAG for libhwui LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" LOCAL_CFLAGS += -Wall -Wno-unused-parameter -Wunreachable-code -LOCAL_CFLAGS += -ffast-math -O3 +LOCAL_CFLAGS += -O3 # b/21698669 ifneq ($(USE_CLANG_PLATFORM_BUILD),true) -- cgit v1.1 From 12412ce87025d41e3cd3ac3f93f8638c6dae1b32 Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Thu, 1 Oct 2015 16:49:16 -0700 Subject: Early return when the scale is 0. b/24534579 Change-Id: Ib3581ec99387ca70ca036026f64857a49657d94b (cherry picked from commit 8d0ec389531d071529fb0a800f10733b057205d9) --- libs/hwui/RenderNode.cpp | 9 +++++++-- libs/hwui/ShadowTessellator.cpp | 4 ++-- libs/hwui/SpotShadow.cpp | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'libs') diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index 0951fc1..642ec25 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -666,7 +666,9 @@ template void RenderNode::issueDrawShadowOperation(const Matrix4& transformFromParent, T& handler) { if (properties().getAlpha() <= 0.0f || properties().getOutline().getAlpha() <= 0.0f - || !properties().getOutline().getPath()) { + || !properties().getOutline().getPath() + || properties().getScaleX() == 0 + || properties().getScaleY() == 0) { // no shadow to draw return; } @@ -856,7 +858,10 @@ void RenderNode::issueOperations(OpenGLRenderer& renderer, T& handler) { const bool useViewProperties = (!mLayer || drawLayer); if (useViewProperties) { const Outline& outline = properties().getOutline(); - if (properties().getAlpha() <= 0 || (outline.getShouldClip() && outline.isEmpty())) { + if (properties().getAlpha() <= 0 + || (outline.getShouldClip() && outline.isEmpty()) + || properties().getScaleX() == 0 + || properties().getScaleY() == 0) { DISPLAY_LIST_LOGD("%*sRejected display list (%p, %s)", handler.level() * 2, "", this, getName()); return; diff --git a/libs/hwui/ShadowTessellator.cpp b/libs/hwui/ShadowTessellator.cpp index 09d1258..1bca3e7 100644 --- a/libs/hwui/ShadowTessellator.cpp +++ b/libs/hwui/ShadowTessellator.cpp @@ -77,8 +77,8 @@ void ShadowTessellator::tessellateSpotShadow(bool isCasterOpaque, } #if DEBUG_SHADOW - ALOGD("light center %f %f %f", - adjustedLightCenter.x, adjustedLightCenter.y, adjustedLightCenter.z); + ALOGD("light center %f %f %f %d", + adjustedLightCenter.x, adjustedLightCenter.y, adjustedLightCenter.z, lightRadius); #endif // light position (because it's in local space) needs to compensate for receiver transform diff --git a/libs/hwui/SpotShadow.cpp b/libs/hwui/SpotShadow.cpp index b8c9804..7a2b9af 100644 --- a/libs/hwui/SpotShadow.cpp +++ b/libs/hwui/SpotShadow.cpp @@ -1052,7 +1052,7 @@ void SpotShadow::dumpPolygon(const Vector2* poly, int polyLength, const char* po */ void SpotShadow::dumpPolygon(const Vector3* poly, int polyLength, const char* polyName) { for (int i = 0; i < polyLength; i++) { - ALOGD("polygon %s i %d x %f y %f", polyName, i, poly[i].x, poly[i].y); + ALOGD("polygon %s i %d x %f y %f z %f", polyName, i, poly[i].x, poly[i].y, poly[i].z); } } -- cgit v1.1 From 76cb25b6f2c3891477885b66d378bcf606568352 Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Wed, 4 Nov 2015 16:57:53 -0800 Subject: When the incoming light source is invalid, don't generate any shadow b/25417885 Change-Id: I4b87e35ca68091fd0409cb9fe9b9400af860a507 --- libs/hwui/ShadowTessellator.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libs') diff --git a/libs/hwui/ShadowTessellator.cpp b/libs/hwui/ShadowTessellator.cpp index 1bca3e7..6c8665b 100644 --- a/libs/hwui/ShadowTessellator.cpp +++ b/libs/hwui/ShadowTessellator.cpp @@ -80,6 +80,11 @@ void ShadowTessellator::tessellateSpotShadow(bool isCasterOpaque, ALOGD("light center %f %f %f %d", adjustedLightCenter.x, adjustedLightCenter.y, adjustedLightCenter.z, lightRadius); #endif + if (isnan(adjustedLightCenter.x) + || isnan(adjustedLightCenter.y) + || isnan(adjustedLightCenter.z)) { + return; + } // light position (because it's in local space) needs to compensate for receiver transform // TODO: should apply to light orientation, not just position -- cgit v1.1 From d028ee75c5675e38ae71b7aeb32fe10637af1a98 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Thu, 5 Nov 2015 17:58:28 +0000 Subject: Revert "Remove -ffast-math from libhwui makefile" This reverts commit e02ec7c37a92fd63748a610bac6a23d0409788cf. Change-Id: Iea7fadf04c4ffa62be28f783342ae749f89bf931 --- libs/hwui/Android.common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/hwui/Android.common.mk b/libs/hwui/Android.common.mk index 94bb981..38e8be9 100644 --- a/libs/hwui/Android.common.mk +++ b/libs/hwui/Android.common.mk @@ -119,7 +119,7 @@ endif # Defaults for ATRACE_TAG and LOG_TAG for libhwui LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" LOCAL_CFLAGS += -Wall -Wno-unused-parameter -Wunreachable-code -LOCAL_CFLAGS += -O3 +LOCAL_CFLAGS += -ffast-math -O3 # b/21698669 ifneq ($(USE_CLANG_PLATFORM_BUILD),true) -- cgit v1.1