aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2015-06-11 10:13:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-11 10:13:03 -0700
commit78d79cc5759d5ec6fb48b28b0cc22d396eb69fb5 (patch)
treef2c565bc02af0343ac0adb3548f29cf0153f9dc8
parent8d0d2b8577bcfe329197286afbd3a01fd5d799c0 (diff)
Eliminate the check for ANDROID_LARGE_MEMORY in jpeg decoders
-rw-r--r--platform_tools/android/gyp_gen/makefile_writer.py12
-rw-r--r--platform_tools/android/tests/expectations/Android.mk8
-rw-r--r--src/codec/SkJpegDecoderMgr.cpp18
-rw-r--r--src/images/SkImageDecoder_libjpeg.cpp17
4 files changed, 0 insertions, 55 deletions
diff --git a/platform_tools/android/gyp_gen/makefile_writer.py b/platform_tools/android/gyp_gen/makefile_writer.py
index a199a831f4..93af4d2b1f 100644
--- a/platform_tools/android/gyp_gen/makefile_writer.py
+++ b/platform_tools/android/gyp_gen/makefile_writer.py
@@ -196,18 +196,6 @@ def write_android_mk(target_dir, common, deviations_from_common):
f.write('LOCAL_ARM_MODE := thumb\n')
- # need a flag to tell the C side when we're on devices with large memory
- # budgets (i.e. larger than the low-end devices that initially shipped)
- # On arm, only define the flag if it has VFP. For all other architectures,
- # always define the flag.
- f.write('ifeq ($(TARGET_ARCH),arm)\n')
- f.write('\tifeq ($(ARCH_ARM_HAVE_VFP),true)\n')
- f.write('\t\tLOCAL_CFLAGS += -DANDROID_LARGE_MEMORY_DEVICE\n')
- f.write('\tendif\n')
- f.write('else\n')
- f.write('\tLOCAL_CFLAGS += -DANDROID_LARGE_MEMORY_DEVICE\n')
- f.write('endif\n\n')
-
f.write('# used for testing\n')
f.write('#LOCAL_CFLAGS += -g -O0\n\n')
diff --git a/platform_tools/android/tests/expectations/Android.mk b/platform_tools/android/tests/expectations/Android.mk
index 371979e8b4..c7ac190422 100644
--- a/platform_tools/android/tests/expectations/Android.mk
+++ b/platform_tools/android/tests/expectations/Android.mk
@@ -42,14 +42,6 @@ ifneq ($(strip $(TARGET_FDO_CFLAGS)),)
endif
LOCAL_ARM_MODE := thumb
-ifeq ($(TARGET_ARCH),arm)
- ifeq ($(ARCH_ARM_HAVE_VFP),true)
- LOCAL_CFLAGS += -DANDROID_LARGE_MEMORY_DEVICE
- endif
-else
- LOCAL_CFLAGS += -DANDROID_LARGE_MEMORY_DEVICE
-endif
-
# used for testing
#LOCAL_CFLAGS += -g -O0
diff --git a/src/codec/SkJpegDecoderMgr.cpp b/src/codec/SkJpegDecoderMgr.cpp
index c1f044c64f..e60f466337 100644
--- a/src/codec/SkJpegDecoderMgr.cpp
+++ b/src/codec/SkJpegDecoderMgr.cpp
@@ -27,23 +27,6 @@ static void output_message(j_common_ptr info) {
print_message(info, "output_message");
}
-/*
- * Choose the size of the memory buffer on Android
- */
-static void overwrite_mem_buffer_size(jpeg_decompress_struct* dinfo) {
-#ifdef SK_BUILD_FOR_ANDROID
-
-// Use 30 MB for devices with a large amount of system memory and 5MB otherwise
-// TODO: (msarett) This matches SkImageDecoder. Why were these values chosen?
-#ifdef ANDROID_LARGE_MEMORY_DEVICE
- dinfo->mem->max_memory_to_use = 30 * 1024 * 1024;
-#else
- dinfo->mem->max_memory_to_use = 5 * 1024 * 1024;
-#endif
-
-#endif // SK_BUILD_FOR_ANDROID
-}
-
bool JpegDecoderMgr::returnFalse(const char caller[]) {
print_message((j_common_ptr) &fDInfo, caller);
return false;
@@ -89,7 +72,6 @@ void JpegDecoderMgr::init() {
jpeg_create_decompress(&fDInfo);
fInit = true;
fDInfo.src = &fSrcMgr;
- overwrite_mem_buffer_size(&fDInfo);
fDInfo.err->emit_message = &emit_message;
fDInfo.err->output_message = &output_message;
}
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp
index c42f214df1..8e92dd874e 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -57,22 +57,6 @@ SK_CONF_DECLARE(bool, c_suppressJPEGImageDecoderErrors,
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
-static void overwrite_mem_buffer_size(jpeg_decompress_struct* cinfo) {
-#ifdef SK_BUILD_FOR_ANDROID
- /* Check if the device indicates that it has a large amount of system memory
- * if so, increase the memory allocation to 30MB instead of the default 5MB.
- */
-#ifdef ANDROID_LARGE_MEMORY_DEVICE
- cinfo->mem->max_memory_to_use = 30 * 1024 * 1024;
-#else
- cinfo->mem->max_memory_to_use = 5 * 1024 * 1024;
-#endif
-#endif // SK_BUILD_FOR_ANDROID
-}
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-
static void do_nothing_emit_message(jpeg_common_struct*, int) {
/* do nothing */
}
@@ -84,7 +68,6 @@ static void initialize_info(jpeg_decompress_struct* cinfo, skjpeg_source_mgr* sr
SkASSERT(cinfo != NULL);
SkASSERT(src_mgr != NULL);
jpeg_create_decompress(cinfo);
- overwrite_mem_buffer_size(cinfo);
cinfo->src = src_mgr;
/* To suppress warnings with a SK_DEBUG binary, set the
* environment variable "skia_images_jpeg_suppressDecoderWarnings"