Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: remove jpeg sources from our repo and use turbojpeg instead #316

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- name: Build VM & Launcher
run: |
docker run -v ${PWD}:/sources -t totalcross/${{ matrix.project }}:v1.0.0 bash -c "cmake /sources/TotalCrossVM -DCMAKE_BUILD_TYPE=Release -G Ninja && ninja"
docker run -v ${PWD}:/sources -t totalcross/${{ matrix.project }}:v1.0.3 bash -c "cmake /sources/TotalCrossVM -DCMAKE_BUILD_TYPE=Release -G Ninja && ninja"

build-sdk-and-android:
name: Build `${{ matrix.project.name }}`
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Build VM & Launcher
run: |
mkdir -p build
docker run -v ${PWD}/build:/build -v ${PWD}:/sources -t totalcross/${{ matrix.project }}:v1.0.0 bash -c "cmake /sources/TotalCrossVM -DCMAKE_BUILD_TYPE=Release -G Ninja && ninja"
docker run -v ${PWD}/build:/build -v ${PWD}:/sources -t totalcross/${{ matrix.project }}:v1.0.3 bash -c "cmake /sources/TotalCrossVM -DCMAKE_BUILD_TYPE=Release -G Ninja && ninja"

- name: Upload artifacts
uses: actions/upload-artifact@v2
Expand Down
51 changes: 3 additions & 48 deletions TotalCrossVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,54 +201,9 @@ set(SOURCES
${TC_SRCDIR}/png/pngset.c
${TC_SRCDIR}/png/pngtrans.c

${TC_SRCDIR}/jpeg/jcapimin.c
${TC_SRCDIR}/jpeg/jcapistd.c
${TC_SRCDIR}/jpeg/jccoefct.c
${TC_SRCDIR}/jpeg/jccolor.c
${TC_SRCDIR}/jpeg/jcdctmgr.c
${TC_SRCDIR}/jpeg/jchuff.c
${TC_SRCDIR}/jpeg/jcinit.c
${TC_SRCDIR}/jpeg/jcmainct.c
${TC_SRCDIR}/jpeg/jcmarker.c
${TC_SRCDIR}/jpeg/jcmaster.c
${TC_SRCDIR}/jpeg/jcomapi.c
${TC_SRCDIR}/jpeg/jcparam.c
${TC_SRCDIR}/jpeg/jcphuff.c
${TC_SRCDIR}/jpeg/jcprepct.c
${TC_SRCDIR}/jpeg/jcsample.c
${TC_SRCDIR}/jpeg/jdapimin.c
${TC_SRCDIR}/jpeg/jdapistd.c
${TC_SRCDIR}/jpeg/jdatadst.c
${TC_SRCDIR}/jpeg/jdatasrc.c
${TC_SRCDIR}/jpeg/jdcoefct.c
${TC_SRCDIR}/jpeg/jdcolor.c
${TC_SRCDIR}/jpeg/jddctmgr.c
${TC_SRCDIR}/jpeg/jdhuff.c
${TC_SRCDIR}/jpeg/jdinput.c
${TC_SRCDIR}/jpeg/jdmainct.c
${TC_SRCDIR}/jpeg/jdmarker.c
${TC_SRCDIR}/jpeg/jdmaster.c
${TC_SRCDIR}/jpeg/jdphuff.c
${TC_SRCDIR}/jpeg/jdpostct.c
${TC_SRCDIR}/jpeg/jdsample.c
${TC_SRCDIR}/jpeg/jerror.c
${TC_SRCDIR}/jpeg/jfdctfst.c
${TC_SRCDIR}/jpeg/jmemmgr.c
${TC_SRCDIR}/jpeg/jmemnobs.c
${TC_SRCDIR}/jpeg/jdatadst_tc.c
${TC_SRCDIR}/jpeg/jdatasrc_tc.c
${TC_SRCDIR}/jpeg/JpegLoader.c
${TC_SRCDIR}/jpeg/jquant1.c
${TC_SRCDIR}/jpeg/jquant2.c
${TC_SRCDIR}/jpeg/jutils.c
${TC_SRCDIR}/jpeg/jcarith.c
${TC_SRCDIR}/jpeg/jdarith.c
${TC_SRCDIR}/jpeg/jdmerge.c
${TC_SRCDIR}/jpeg/jidctflt.c
${TC_SRCDIR}/jpeg/jidctfst.c
${TC_SRCDIR}/jpeg/jidctint.c
${TC_SRCDIR}/jpeg/jfdctflt.c
${TC_SRCDIR}/jpeg/jfdctint.c
${TC_SRCDIR}/jpeg/jaricom.c
${TC_SRCDIR}/jpeg/rdbmp.c

${TC_SRCDIR}/event/Event.c
${TC_SRCDIR}/event/specialkeys.c
Expand Down Expand Up @@ -554,7 +509,7 @@ if(DEFINED SDL2_LIBRARY)
target_link_libraries(tcvm ${SDL2_LIBRARY})
endif(DEFINED SDL2_LIBRARY)

target_link_libraries(tcvm SQLite3)
target_link_libraries(tcvm SQLite3 turbojpeg)

if(DEFINED ANDROID_ABI)
add_library(libskia SHARED IMPORTED)
Expand Down
1 change: 1 addition & 0 deletions TotalCrossVM/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'

repositories {
mavenCentral()
jcenter()
maven {
url "http://maven.totalcross.com/artifactory/build"
Expand Down
1 change: 1 addition & 0 deletions TotalCrossVM/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ buildscript {
ext.kotlin_version = '1.3.10'
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
Expand Down
1 change: 1 addition & 0 deletions TotalCrossVM/android/tcvm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apply plugin: 'com.android.library'

repositories {
google()
mavenCentral()
jcenter()
maven {
url "http://maven.totalcross.com/artifactory/build"
Expand Down
24 changes: 7 additions & 17 deletions TotalCrossVM/src/jpeg/JpegLoader.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
//
// SPDX-License-Identifier: LGPL-2.1-only

/*
* This software is based in part on the work of the Independent JPEG Group.
*/

#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
#include "jpeglib_tc.h"

#if defined _WINDOWS || defined WINCE
#ifndef fmin
Expand Down Expand Up @@ -113,9 +109,7 @@ void jpegLoad(Context currentContext, TCObject imageObj, TCObject inputStreamObj
file.first4 = first4;

/* initialize default error handling. */
errbase.first_addon_message = JMSG_FIRSTADDONCODE;
errbase.last_addon_message = JMSG_LASTADDONCODE;
errbase.heap = heap;
// errbase.heap = heap;

IF_HEAP_ERROR(heap)
{
Expand All @@ -138,7 +132,7 @@ void jpegLoad(Context currentContext, TCObject imageObj, TCObject inputStreamObj
file.params[0].asObj = file.inputStreamObj;
file.params[1].asObj = file.bufObj;
}
jpeg_stdio_src(&cinfo, &file); /* Specify data source for decompression */
jpeg_tiF_src(&cinfo, &file); /* Specify data source for decompression */
jpeg_read_header(&cinfo, TRUE); /* Read file header, set default decompression parameters */
/* override with specified decompression parameters */
cinfo.dither_mode = JDITHER_NONE; // 8580 -> 5360
Expand Down Expand Up @@ -260,16 +254,14 @@ bool rgb565_2jpeg(Context currentContext, TCObject srcStreamObj, TCObject dstStr
bufAux = (uint8*) heapAlloc(heap, scanLineOut);

/* initialize default error handling. */
errbase.first_addon_message = JMSG_FIRSTADDONCODE;
errbase.last_addon_message = JMSG_LASTADDONCODE;
errbase.heap = heap;
// errbase.heap = heap;

// initialize error handler and compressor.
cinfo.err = jpeg_std_error(&errbase);
jpeg_create_compress(&cinfo);

// set the compressor output to dstFile
jpeg_stdio_dest(&cinfo, &dstFile);
jpeg_tiF_dest(&cinfo, &dstFile);

cinfo.image_width = width; /* image width and height, in pixels */
cinfo.image_height = height;
Expand Down Expand Up @@ -373,16 +365,14 @@ bool image2jpeg(Context currentContext, TCObject srcImageObj, TCObject dstStream
bufAux = (uint8*) heapAlloc(heap, scanLineOut);

/* initialize default error handling. */
errbase.first_addon_message = JMSG_FIRSTADDONCODE;
errbase.last_addon_message = JMSG_LASTADDONCODE;
errbase.heap = heap;
// errbase.heap = heap;

// initialize error handler and compressor.
cinfo.err = jpeg_std_error(&errbase);
jpeg_create_compress(&cinfo);

// set the compressor output to dstFile
jpeg_stdio_dest(&cinfo, &dstFile);
jpeg_tiF_dest(&cinfo, &dstFile);

cinfo.image_width = width; /* image width and height, in pixels */
cinfo.image_height = height;
Expand Down
134 changes: 0 additions & 134 deletions TotalCrossVM/src/jpeg/cderror.h

This file was deleted.

Loading