diff options
27 files changed, 72 insertions, 260 deletions
diff --git a/cmds/keystore/Android.mk b/cmds/keystore/Android.mk index 67dd9f8679..5a9b979c64 100644 --- a/cmds/keystore/Android.mk +++ b/cmds/keystore/Android.mk @@ -14,8 +14,6 @@ # limitations under the License. # -ifneq ($(TARGET_SIMULATOR),true) - LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) @@ -32,5 +30,3 @@ LOCAL_SHARED_LIBRARIES := libcutils libcrypto LOCAL_MODULE:= keystore_cli LOCAL_MODULE_TAGS := debug include $(BUILD_EXECUTABLE) - -endif diff --git a/include/private/binder/binder_module.h b/include/private/binder/binder_module.h index fdf327e1c5..a8dd64f235 100644 --- a/include/private/binder/binder_module.h +++ b/include/private/binder/binder_module.h @@ -21,126 +21,11 @@ namespace android { #endif -#if defined(HAVE_ANDROID_OS) - /* obtain structures and constants from the kernel header */ #include <sys/ioctl.h> #include <linux/binder.h> -#else - -/* Some parts of the simulator need fake versions of this - * stuff in order to compile. Really this should go away - * entirely... - */ - -#define BINDER_CURRENT_PROTOCOL_VERSION 7 - -#define BINDER_TYPE_BINDER 1 -#define BINDER_TYPE_WEAK_BINDER 2 -#define BINDER_TYPE_HANDLE 3 -#define BINDER_TYPE_WEAK_HANDLE 4 -#define BINDER_TYPE_FD 5 - -struct flat_binder_object { - unsigned long type; - unsigned long flags; - union { - void *binder; - signed long handle; - }; - void *cookie; -}; - -struct binder_write_read { - signed long write_size; - signed long write_consumed; - unsigned long write_buffer; - signed long read_size; - signed long read_consumed; - unsigned long read_buffer; -}; - -struct binder_transaction_data { - union { - size_t handle; - void *ptr; - } target; - void *cookie; - unsigned int code; - - unsigned int flags; - pid_t sender_pid; - uid_t sender_euid; - size_t data_size; - size_t offsets_size; - - union { - struct { - const void *buffer; - const void *offsets; - } ptr; - uint8_t buf[8]; - } data; -}; - -enum transaction_flags { - TF_ONE_WAY = 0x01, - TF_ROOT_OBJECT = 0x04, - TF_STATUS_CODE = 0x08, - TF_ACCEPT_FDS = 0x10, -}; - - -enum { - FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff, - FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100, -}; - -enum BinderDriverReturnProtocol { - BR_ERROR, - BR_OK, - BR_TRANSACTION, - BR_REPLY, - BR_ACQUIRE_RESULT, - BR_DEAD_REPLY, - BR_TRANSACTION_COMPLETE, - BR_INCREFS, - BR_ACQUIRE, - BR_RELEASE, - BR_DECREFS, - BR_ATTEMPT_ACQUIRE, - BR_NOOP, - BR_SPAWN_LOOPER, - BR_FINISHED, - BR_DEAD_BINDER, - BR_CLEAR_DEATH_NOTIFICATION_DONE, - BR_FAILED_REPLY, -}; - -enum BinderDriverCommandProtocol { - BC_TRANSACTION, - BC_REPLY, - BC_ACQUIRE_RESULT, - BC_FREE_BUFFER, - BC_INCREFS, - BC_ACQUIRE, - BC_RELEASE, - BC_DECREFS, - BC_INCREFS_DONE, - BC_ACQUIRE_DONE, - BC_ATTEMPT_ACQUIRE, - BC_REGISTER_LOOPER, - BC_ENTER_LOOPER, - BC_EXIT_LOOPER, - BC_REQUEST_DEATH_NOTIFICATION, - BC_CLEAR_DEATH_NOTIFICATION, - BC_DEAD_BINDER_DONE, -}; - -#endif - #ifdef __cplusplus } // namespace android #endif diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp index 7264ac4086..f5288c8c3e 100644 --- a/libs/binder/ProcessState.cpp +++ b/libs/binder/ProcessState.cpp @@ -154,11 +154,7 @@ bool ProcessState::becomeContextManager(context_check_func checkFunc, void* user mBinderContextUserData = userData; int dummy = 0; -#if defined(HAVE_ANDROID_OS) status_t result = ioctl(mDriverFD, BINDER_SET_CONTEXT_MGR, &dummy); -#else - status_t result = INVALID_OPERATION; -#endif if (result == 0) { mManagesContexts = true; } else if (result == -1) { @@ -304,12 +300,7 @@ static int open_driver() if (fd >= 0) { fcntl(fd, F_SETFD, FD_CLOEXEC); int vers; -#if defined(HAVE_ANDROID_OS) status_t result = ioctl(fd, BINDER_VERSION, &vers); -#else - status_t result = -1; - errno = EPERM; -#endif if (result == -1) { LOGE("Binder ioctl to obtain version failed: %s", strerror(errno)); close(fd); @@ -320,14 +311,11 @@ static int open_driver() close(fd); fd = -1; } -#if defined(HAVE_ANDROID_OS) size_t maxThreads = 15; result = ioctl(fd, BINDER_SET_MAX_THREADS, &maxThreads); if (result == -1) { LOGE("Binder ioctl to set max threads failed: %s", strerror(errno)); } -#endif - } else { LOGW("Opening '/dev/binder' failed: %s\n", strerror(errno)); } diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk index 4070eba736..ed319f5e93 100644 --- a/libs/gui/Android.mk +++ b/libs/gui/Android.mk @@ -32,10 +32,6 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE:= libgui -ifeq ($(TARGET_SIMULATOR),true) - LOCAL_LDLIBS += -lpthread -endif - include $(BUILD_SHARED_LIBRARY) ifeq (,$(ONE_SHOT_MAKEFILE)) diff --git a/libs/gui/tests/Android.mk b/libs/gui/tests/Android.mk index 8d3a9b5eba..0308af3abf 100644 --- a/libs/gui/tests/Android.mk +++ b/libs/gui/tests/Android.mk @@ -2,8 +2,6 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -ifneq ($(TARGET_SIMULATOR),true) - LOCAL_MODULE := SurfaceTexture_test LOCAL_MODULE_TAGS := tests @@ -36,8 +34,6 @@ LOCAL_C_INCLUDES := \ include $(BUILD_EXECUTABLE) -endif - # Include subdirectory makefiles # ============================================================ diff --git a/libs/surfaceflinger_client/Android.mk b/libs/surfaceflinger_client/Android.mk index 267e3edf44..5fca1ce5b3 100644 --- a/libs/surfaceflinger_client/Android.mk +++ b/libs/surfaceflinger_client/Android.mk @@ -7,8 +7,4 @@ LOCAL_SHARED_LIBRARIES := LOCAL_MODULE:= libsurfaceflinger_client -ifeq ($(TARGET_SIMULATOR),true) - LOCAL_LDLIBS += -lpthread -endif - include $(BUILD_SHARED_LIBRARY) diff --git a/libs/ui/Android.mk b/libs/ui/Android.mk index 427bbba896..fbabfc420c 100644 --- a/libs/ui/Android.mk +++ b/libs/ui/Android.mk @@ -68,10 +68,6 @@ LOCAL_C_INCLUDES := \ LOCAL_MODULE:= libui -ifeq ($(TARGET_SIMULATOR),true) - LOCAL_LDLIBS += -lpthread -endif - include $(BUILD_SHARED_LIBRARY) diff --git a/libs/ui/InputTransport.cpp b/libs/ui/InputTransport.cpp index c46d6f4724..1e602e982d 100644 --- a/libs/ui/InputTransport.cpp +++ b/libs/ui/InputTransport.cpp @@ -83,7 +83,9 @@ status_t InputChannel::openInputChannelPair(const String8& name, sp<InputChannel>& outServerChannel, sp<InputChannel>& outClientChannel) { status_t result; - int serverAshmemFd = ashmem_create_region(name.string(), DEFAULT_MESSAGE_BUFFER_SIZE); + String8 ashmemName("InputChannel "); + ashmemName.append(name); + int serverAshmemFd = ashmem_create_region(ashmemName.string(), DEFAULT_MESSAGE_BUFFER_SIZE); if (serverAshmemFd < 0) { result = -errno; LOGE("channel '%s' ~ Could not create shared memory region. errno=%d", diff --git a/libs/ui/tests/Android.mk b/libs/ui/tests/Android.mk index e23197185c..693a32aa02 100644 --- a/libs/ui/tests/Android.mk +++ b/libs/ui/tests/Android.mk @@ -2,8 +2,6 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -ifneq ($(TARGET_SIMULATOR),true) - # Build the unit tests. test_src_files := \ InputChannel_test.cpp \ @@ -48,5 +46,3 @@ $(foreach file,$(test_src_files), \ # Build the manual test programs. include $(call all-subdir-makefiles) - -endif
\ No newline at end of file diff --git a/libs/utils/Android.mk b/libs/utils/Android.mk index 774e8c9745..f6333576a1 100644 --- a/libs/utils/Android.mk +++ b/libs/utils/Android.mk @@ -103,17 +103,14 @@ LOCAL_SHARED_LIBRARIES := \ liblog \ libcutils -ifneq ($(TARGET_SIMULATOR),true) ifeq ($(TARGET_OS)-$(TARGET_ARCH),linux-x86) # This is needed on x86 to bring in dl_iterate_phdr for CallStack.cpp LOCAL_SHARED_LIBRARIES += libdl endif # linux-x86 -endif # sim LOCAL_MODULE:= libutils include $(BUILD_SHARED_LIBRARY) -ifneq ($(TARGET_SIMULATOR),true) ifeq ($(TARGET_OS),linux) include $(CLEAR_VARS) LOCAL_C_INCLUDES += external/zlib external/icu4c/common @@ -122,7 +119,6 @@ LOCAL_MODULE := libutils LOCAL_SRC_FILES := $(commonSources) BackupData.cpp BackupHelpers.cpp include $(BUILD_STATIC_LIBRARY) endif -endif # Include subdirectory makefiles diff --git a/libs/utils/BackupHelpers.cpp b/libs/utils/BackupHelpers.cpp index 87549fe977..7ef30f9990 100644 --- a/libs/utils/BackupHelpers.cpp +++ b/libs/utils/BackupHelpers.cpp @@ -481,6 +481,14 @@ static int write_pax_header_entry(char* buf, const char* key, const char* value) return sprintf(buf, "%d %s=%s\n", len, key, value); } +// Wire format to the backup manager service is chunked: each chunk is prefixed by +// a 4-byte count of its size. A chunk size of zero (four zero bytes) indicates EOD. +void send_tarfile_chunk(BackupDataWriter* writer, const char* buffer, size_t size) { + uint32_t chunk_size_no = htonl(size); + writer->WriteEntityData(&chunk_size_no, 4); + if (size != 0) writer->WriteEntityData(buffer, size); +} + int write_tarfile(const String8& packageName, const String8& domain, const String8& rootpath, const String8& filepath, BackupDataWriter* writer) { @@ -660,16 +668,16 @@ int write_tarfile(const String8& packageName, const String8& domain, // Checksum and write the pax block header calc_tar_checksum(paxHeader); - writer->WriteEntityData(paxHeader, 512); + send_tarfile_chunk(writer, paxHeader, 512); // Now write the pax data itself int paxblocks = (paxLen + 511) / 512; - writer->WriteEntityData(paxData, 512 * paxblocks); + send_tarfile_chunk(writer, paxData, 512 * paxblocks); } // Checksum and write the 512-byte ustar file header block to the output calc_tar_checksum(buf); - writer->WriteEntityData(buf, 512); + send_tarfile_chunk(writer, buf, 512); // Now write the file data itself, for real files. We honor tar's convention that // only full 512-byte blocks are sent to write(). @@ -699,7 +707,7 @@ int write_tarfile(const String8& packageName, const String8& domain, memset(buf + nRead, 0, remainder); nRead += remainder; } - writer->WriteEntityData(buf, nRead); + send_tarfile_chunk(writer, buf, nRead); toWrite -= nRead; } } diff --git a/libs/utils/tests/Android.mk b/libs/utils/tests/Android.mk index 87ad98eaad..8726a536c4 100644 --- a/libs/utils/tests/Android.mk +++ b/libs/utils/tests/Android.mk @@ -2,8 +2,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -ifneq ($(TARGET_SIMULATOR),true) - # Build the unit tests. test_src_files := \ BlobCache_test.cpp \ @@ -43,5 +41,3 @@ $(foreach file,$(test_src_files), \ $(eval LOCAL_MODULE_TAGS := $(module_tags)) \ $(eval include $(BUILD_EXECUTABLE)) \ ) - -endif diff --git a/opengl/libagl/Android.mk b/opengl/libagl/Android.mk index b5c018f462..15e58f2f6a 100644 --- a/opengl/libagl/Android.mk +++ b/opengl/libagl/Android.mk @@ -38,15 +38,13 @@ ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif -ifneq ($(TARGET_SIMULATOR),true) - # we need to access the private Bionic header <bionic_tls.h> - # on ARM platforms, we need to mirror the ARCH_ARM_HAVE_TLS_REGISTER - # behavior from the bionic Android.mk file - ifeq ($(TARGET_ARCH)-$(ARCH_ARM_HAVE_TLS_REGISTER),arm-true) - LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER - endif - LOCAL_C_INCLUDES += bionic/libc/private +# we need to access the private Bionic header <bionic_tls.h> +# on ARM platforms, we need to mirror the ARCH_ARM_HAVE_TLS_REGISTER +# behavior from the bionic Android.mk file +ifeq ($(TARGET_ARCH)-$(ARCH_ARM_HAVE_TLS_REGISTER),arm-true) + LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif +LOCAL_C_INCLUDES += bionic/libc/private LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl LOCAL_MODULE:= libGLES_android diff --git a/opengl/libagl2/Android.mk b/opengl/libagl2/Android.mk index 564932f5cb..b442a2d4a5 100644 --- a/opengl/libagl2/Android.mk +++ b/opengl/libagl2/Android.mk @@ -39,15 +39,13 @@ ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif -ifneq ($(TARGET_SIMULATOR),true) - # we need to access the private Bionic header <bionic_tls.h> - # on ARM platforms, we need to mirror the ARCH_ARM_HAVE_TLS_REGISTER - # behavior from the bionic Android.mk file - ifeq ($(TARGET_ARCH)-$(ARCH_ARM_HAVE_TLS_REGISTER),arm-true) - LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER - endif - LOCAL_C_INCLUDES += bionic/libc/private +# we need to access the private Bionic header <bionic_tls.h> +# on ARM platforms, we need to mirror the ARCH_ARM_HAVE_TLS_REGISTER +# behavior from the bionic Android.mk file +ifeq ($(TARGET_ARCH)-$(ARCH_ARM_HAVE_TLS_REGISTER),arm-true) + LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif +LOCAL_C_INCLUDES += bionic/libc/private LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl #replace libagl for now diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk index ff45edcc95..3e66a133ab 100644 --- a/opengl/libs/Android.mk +++ b/opengl/libs/Android.mk @@ -21,18 +21,14 @@ LOCAL_SHARED_LIBRARIES += libcutils libutils libGLESv2_dbg LOCAL_LDLIBS := -lpthread -ldl LOCAL_MODULE:= libEGL LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL -# needed on sim build because of weird logging issues -ifeq ($(TARGET_SIMULATOR),true) -else - LOCAL_SHARED_LIBRARIES += libdl - # Bionic's private TLS header relies on the ARCH_ARM_HAVE_TLS_REGISTER to - # select the appropriate TLS codepath - ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) - LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER - endif - # we need to access the private Bionic header <bionic_tls.h> - LOCAL_C_INCLUDES += bionic/libc/private +LOCAL_SHARED_LIBRARIES += libdl +# Bionic's private TLS header relies on the ARCH_ARM_HAVE_TLS_REGISTER to +# select the appropriate TLS codepath +ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) + LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif +# we need to access the private Bionic header <bionic_tls.h> +LOCAL_C_INCLUDES += bionic/libc/private LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\" LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES @@ -81,16 +77,12 @@ LOCAL_SHARED_LIBRARIES += libcutils libEGL LOCAL_LDLIBS := -lpthread -ldl LOCAL_MODULE:= libGLESv1_CM -# needed on sim build because of weird logging issues -ifeq ($(TARGET_SIMULATOR),true) -else - LOCAL_SHARED_LIBRARIES += libdl - # we need to access the private Bionic header <bionic_tls.h> - ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) - LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER - endif - LOCAL_C_INCLUDES += bionic/libc/private +LOCAL_SHARED_LIBRARIES += libdl +# we need to access the private Bionic header <bionic_tls.h> +ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) + LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif +LOCAL_C_INCLUDES += bionic/libc/private LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv1\" LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES @@ -117,16 +109,12 @@ LOCAL_SHARED_LIBRARIES += libcutils libEGL LOCAL_LDLIBS := -lpthread -ldl LOCAL_MODULE:= libGLESv2 -# needed on sim build because of weird logging issues -ifeq ($(TARGET_SIMULATOR),true) -else - LOCAL_SHARED_LIBRARIES += libdl - # we need to access the private Bionic header <bionic_tls.h> - ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) - LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER - endif - LOCAL_C_INCLUDES += bionic/libc/private +LOCAL_SHARED_LIBRARIES += libdl +# we need to access the private Bionic header <bionic_tls.h> +ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) + LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif +LOCAL_C_INCLUDES += bionic/libc/private LOCAL_CFLAGS += -DLOG_TAG=\"libGLESv2\" LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES diff --git a/opengl/libs/GLES2_dbg/Android.mk b/opengl/libs/GLES2_dbg/Android.mk index 9f6e68c4da..c2b1142bc3 100644 --- a/opengl/libs/GLES2_dbg/Android.mk +++ b/opengl/libs/GLES2_dbg/Android.mk @@ -31,15 +31,13 @@ ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif -ifneq ($(TARGET_SIMULATOR),true) - # we need to access the private Bionic header <bionic_tls.h> - # on ARM platforms, we need to mirror the ARCH_ARM_HAVE_TLS_REGISTER - # behavior from the bionic Android.mk file - ifeq ($(TARGET_ARCH)-$(ARCH_ARM_HAVE_TLS_REGISTER),arm-true) - LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER - endif - LOCAL_C_INCLUDES += bionic/libc/private +# we need to access the private Bionic header <bionic_tls.h> +# on ARM platforms, we need to mirror the ARCH_ARM_HAVE_TLS_REGISTER +# behavior from the bionic Android.mk file +ifeq ($(TARGET_ARCH)-$(ARCH_ARM_HAVE_TLS_REGISTER),arm-true) + LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif +LOCAL_C_INCLUDES += bionic/libc/private LOCAL_MODULE:= libGLESv2_dbg LOCAL_MODULE_TAGS := optional diff --git a/opengl/libs/GLES2_dbg/test/Android.mk b/opengl/libs/GLES2_dbg/test/Android.mk index 14a84b447f..8708d439df 100644 --- a/opengl/libs/GLES2_dbg/test/Android.mk +++ b/opengl/libs/GLES2_dbg/test/Android.mk @@ -27,9 +27,7 @@ LOCAL_MODULE:= libGLESv2_dbg_test ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif -ifneq ($(TARGET_SIMULATOR),true) - LOCAL_C_INCLUDES += bionic/libc/private -endif +LOCAL_C_INCLUDES += bionic/libc/private LOCAL_CFLAGS += -DLOG_TAG=\"libEGL\" LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES diff --git a/opengl/tests/EGLTest/Android.mk b/opengl/tests/EGLTest/Android.mk index ab5f4bdeca..92d7eb12ac 100644 --- a/opengl/tests/EGLTest/Android.mk +++ b/opengl/tests/EGLTest/Android.mk @@ -2,8 +2,6 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -ifneq ($(TARGET_SIMULATOR),true) - LOCAL_MODULE := EGL_test LOCAL_MODULE_TAGS := tests @@ -29,8 +27,6 @@ LOCAL_C_INCLUDES := \ include $(BUILD_EXECUTABLE) -endif - # Include subdirectory makefiles # ============================================================ diff --git a/opengl/tests/gl2_jni/Android.mk b/opengl/tests/gl2_jni/Android.mk index e8b6c57f47..5d90ff68e0 100644 --- a/opengl/tests/gl2_jni/Android.mk +++ b/opengl/tests/gl2_jni/Android.mk @@ -2,8 +2,6 @@ # OpenGL ES JNI sample # This makefile builds both an activity and a shared library. ######################################################################### -ifneq ($(TARGET_SIMULATOR),true) # not 64 bit clean - TOP_LOCAL_PATH:= $(call my-dir) # Build activity @@ -47,5 +45,3 @@ LOCAL_MODULE := libgl2jni include $(BUILD_SHARED_LIBRARY) - -endif # TARGET_SIMULATOR diff --git a/opengl/tests/gl_jni/Android.mk b/opengl/tests/gl_jni/Android.mk index 4acd91f4a9..3d20e7281c 100644 --- a/opengl/tests/gl_jni/Android.mk +++ b/opengl/tests/gl_jni/Android.mk @@ -2,8 +2,6 @@ # OpenGL ES JNI sample # This makefile builds both an activity and a shared library. ######################################################################### -ifneq ($(TARGET_SIMULATOR),true) # not 64 bit clean - TOP_LOCAL_PATH:= $(call my-dir) # Build activity @@ -49,5 +47,3 @@ LOCAL_ARM_MODE := arm include $(BUILD_SHARED_LIBRARY) - -endif # TARGET_SIMULATOR diff --git a/opengl/tests/gl_perfapp/Android.mk b/opengl/tests/gl_perfapp/Android.mk index 4b79569dfa..65e50e9b0c 100644 --- a/opengl/tests/gl_perfapp/Android.mk +++ b/opengl/tests/gl_perfapp/Android.mk @@ -2,8 +2,6 @@ # OpenGL ES Perf App # This makefile builds both an activity and a shared library. ######################################################################### -ifneq ($(TARGET_SIMULATOR),true) # not 64 bit clean - TOP_LOCAL_PATH:= $(call my-dir) # Build activity @@ -50,5 +48,3 @@ LOCAL_MODULE := libglperf include $(BUILD_SHARED_LIBRARY) - -endif # TARGET_SIMULATOR diff --git a/opengl/tests/gldual/Android.mk b/opengl/tests/gldual/Android.mk index f1a998a01b..b4b378ec46 100644 --- a/opengl/tests/gldual/Android.mk +++ b/opengl/tests/gldual/Android.mk @@ -2,8 +2,6 @@ # OpenGL ES JNI sample # This makefile builds both an activity and a shared library. ######################################################################### -ifneq ($(TARGET_SIMULATOR),true) # not 64 bit clean - TOP_LOCAL_PATH:= $(call my-dir) # Build activity @@ -47,5 +45,3 @@ LOCAL_MODULE := libgldualjni include $(BUILD_SHARED_LIBRARY) - -endif # TARGET_SIMULATOR diff --git a/opengl/tests/testPauseResume/Android.mk b/opengl/tests/testPauseResume/Android.mk index 450473a19d..cf8bdc35f0 100644 --- a/opengl/tests/testPauseResume/Android.mk +++ b/opengl/tests/testPauseResume/Android.mk @@ -2,8 +2,6 @@ # OpenGL ES JNI sample # This makefile builds both an activity and a shared library. ######################################################################### -ifneq ($(TARGET_SIMULATOR),true) # not 64 bit clean - TOP_LOCAL_PATH:= $(call my-dir) # Build activity @@ -18,5 +16,3 @@ LOCAL_SRC_FILES := $(call all-subdir-java-files) LOCAL_PACKAGE_NAME := TestEGL include $(BUILD_PACKAGE) - -endif # TARGET_SIMULATOR diff --git a/opengl/tests/testViewport/Android.mk b/opengl/tests/testViewport/Android.mk index ab3780961a..9980e7dbc7 100644 --- a/opengl/tests/testViewport/Android.mk +++ b/opengl/tests/testViewport/Android.mk @@ -2,8 +2,6 @@ # OpenGL ES JNI sample # This makefile builds both an activity and a shared library. ######################################################################### -ifneq ($(TARGET_SIMULATOR),true) # not 64 bit clean - TOP_LOCAL_PATH:= $(call my-dir) # Build activity @@ -22,5 +20,3 @@ LOCAL_PACKAGE_NAME := TestViewport LOCAL_SDK_VERSION := 8 include $(BUILD_PACKAGE) - -endif # TARGET_SIMULATOR diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk index c618263717..f67c82efcd 100644 --- a/services/surfaceflinger/Android.mk +++ b/services/surfaceflinger/Android.mk @@ -26,13 +26,6 @@ ifeq ($(TARGET_BOARD_PLATFORM), s5pc110) endif -# need "-lrt" on Linux simulator to pick up clock_gettime -ifeq ($(TARGET_SIMULATOR),true) - ifeq ($(HOST_OS),linux) - LOCAL_LDLIBS += -lrt -lpthread - endif -endif - LOCAL_SHARED_LIBRARIES := \ libcutils \ libhardware \ diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 35e29a6315..f3b6c4dd23 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -188,22 +188,37 @@ void Layer::setGeometry(hwc_layer_t* hwcl) return; } + /* + * Transformations are applied in this order: + * 1) buffer orientation/flip/mirror + * 2) state transformation (window manager) + * 3) layer orientation (screen orientation) + * (NOTE: the matrices are multiplied in reverse order) + */ + + const Transform bufferOrientation(mCurrentTransform); + const Transform& stateTransform(s.transform); + const Transform layerOrientation(mOrientation); + + const Transform tr(layerOrientation * stateTransform * bufferOrientation); + + // this gives us only the "orientation" component of the transform + const uint32_t finalTransform = tr.getOrientation(); + // we can only handle simple transformation - if (mOrientation & Transform::ROT_INVALID) { + if (finalTransform & Transform::ROT_INVALID) { hwcl->flags = HWC_SKIP_LAYER; return; } - // FIXME: shouldn't we take the state's transform into account here? - - Transform tr(Transform(mOrientation) * Transform(mCurrentTransform)); - hwcl->transform = tr.getOrientation(); + hwcl->transform = finalTransform; if (!isOpaque()) { hwcl->blending = mPremultipliedAlpha ? HWC_BLENDING_PREMULT : HWC_BLENDING_COVERAGE; } + // scaling is already applied in mTransformedBounds hwcl->displayFrame.left = mTransformedBounds.left; hwcl->displayFrame.top = mTransformedBounds.top; hwcl->displayFrame.right = mTransformedBounds.right; diff --git a/services/surfaceflinger/Transform.cpp b/services/surfaceflinger/Transform.cpp index 0467a14604..4cedcbf86c 100644 --- a/services/surfaceflinger/Transform.cpp +++ b/services/surfaceflinger/Transform.cpp @@ -308,6 +308,7 @@ uint32_t Transform::type() const scale = true; } } else { + // there is a skew component and/or a non 90 degrees rotation flags = ROT_INVALID; } |