Commit Graph

114 Commits

Author SHA1 Message Date
Stefan Schmidt 6b27d7add2 eet: Switch from obsolete LZ4_uncompress function to LZ4_decompress_fast
The function is declared as obsolete and in some newer headers it is no
longer defined. The new function is the same besides the name change.
2014-12-10 14:52:58 +01:00
Carsten Haitzler 8669ab8a98 eet - add new api to verify eet file against stored cert
this api makes it far more obvious as to how to verify an eet file via
the eet identify mechanisms that use x509 certificates to sign files.
this is consistent with the api used to generate the key for sigining
thus you can use the same certificate file to compare against for
identify.

@feature
2014-11-28 17:56:27 +09:00
Cedric BAIL fb8087b0a7 eet: shutup stupid compiler warning. 2014-10-22 22:30:29 +02:00
Jean-Philippe Andre a3caed8012 Eet: Fix eet jpeg image load
Commit 101dee79b0 introduced critical errors, as standard
error callbacks now fail.

Apparently, these error callbacks depend on the installed version
of libjpeg (8 vs. 9).

I couldn't start E without this commit.
2014-10-21 15:59:50 +09:00
Vincent Torri 101dee79b0 eet: enhance error messages with libjpeg
@fix
2014-10-20 18:40:20 +02:00
Chidambar Zinnoury b473a56733 eet: add some more documentation. 2014-10-20 18:32:28 +02:00
Philippe Caseiro c03569e6a7 eet: update callback API documentation
Adding some documentation on callbacks typedefs for :
- Eet_Node_Walk
2014-10-20 18:20:58 +02:00
Philippe Caseiro 5bb7034774 eet: update callback API documentation.
Adding some documentation on callbacks typedefs for :
- Eet_Descriptor
- Eet_Dump
2014-10-20 18:19:42 +02:00
Jérémy Zurcher 2e5a5d6656 eet: call LOCK_CACHE before altering Eet_File
even if not necessary in this particular case,
do as in eet_mmap() and eet_open(),
lock the cache before altering Eet_File struct.

fix CID 1039366 1039367 1039368 1039369
2014-09-08 22:37:09 +02:00
Stefan Schmidt a65c531429 eet_dictionary: Remove now unused variable
Since 123bdc4342 found is now longer used here.
Remove it.
2014-08-27 16:40:16 +02:00
Carsten Haitzler d40de658a2 eet - fix unused pointer
fix CID 1039489
2014-08-27 16:58:37 +09:00
Carsten Haitzler b0adec349f eet - handle fcntl error
fix CID 1039691
2014-08-27 16:35:48 +09:00
Carsten Haitzler 123bdc4342 eet dictionary - remove impossible code
CID 1039464 knows full well our comments there are right - so remove
pointless code
2014-08-27 12:12:40 +09:00
Carsten Haitzler 190b404be2 eet - remove useless if at free 2014-08-27 12:11:11 +09:00
Carsten Haitzler d5e11fe840 eet - remove unused return val from decode
fixes CID 1039490
2014-08-25 13:03:50 +09:00
Stefan Schmidt 3fe554e0b6 build: Allow to use external liblz4 instead of embedded copy
While we are likely will keep the embedded copy for a while to avoid a really
new dependency we allow now to use the external liblz4. You need at least
revision r120 and a package that ships the pc file for it.

Personally I would like to get rid of it rather sooner than later due to the
security implications and a bunch of code we ship but have no idea about.
Reality is that it will need some time until this new lib is actually
packaged and shipped with releases for a a majority of people.

This patch was co-worked with Doug Newgard <scimmia22@outlook.com>
2014-08-22 16:27:28 +02:00
Carsten Haitzler 2bd42962e3 eet init - fix structurally dead code
CID 1039542
2014-08-14 20:17:16 +09:00
Cedric BAIL e5d841354d eet: fix possible ABI break. 2014-08-11 16:17:05 +02:00
Jean-Philippe Andre 68a8063f9a Eet: Add support for ETC1+Alpha
The TGV file format and GL engine now support ETC1 encoding
with alpha using an extra texture.
This commit adds similar support to the Eet encoder/decoder.

@feature
2014-07-11 16:40:34 +09:00
Jean-Philippe Andre 4efcd46cbf Eet: Add INF message about how slow ETC2 encoding is 2014-06-13 17:58:13 +09:00
Jean-Philippe Andre c21968bcd7 Eet: Add support for ETC2 encoding and decoding
Since we now have full support for ETC2, add the colorspaces
to Eet.

@feature
2014-06-13 17:14:56 +09:00
Jean-Philippe Andre 28ce791dfa Evas TGV: Fix distortion of TGV images (ETC1)
Due to some invalid geometry considerations, there was a
1 pixel distortion in images, varying with the lz4 compressed
macro-block size.

Anyhow, I couldn't wrap my head around Cedric's code. So I rewrote
the whole thing instead, fixed it and improved the block size
selection (based on the image size, to optimize lz4 compression).
2014-04-25 12:08:56 +09:00
Jean-Philippe Andre 7ff410b9f6 Edje: Fix ETC1 encoding with EET and Edje
There were a few critical issues:
- Invalid pointer arithmetics on the input data (char vs. int)
- Invalid logic in the pixel duplication code

All of these due to bad copy and paste :(

Also, use LZ4HC instead of LZ4 when compression is enabled.
ETC1 encoding is so damn slow you won't see the difference between
LZ4 and LZ4HC compression times.
2014-04-18 15:43:07 +09:00
Jean-Philippe Andre f7150570b0 Eet: Use medium quality for ETC1 by default
And remove  dithering.
This is the same as  07700a799c
2014-04-18 15:39:41 +09:00
Jean-Philippe Andre 60d144d963 ETC1 encoding: fix typo in TGV and EET savers
If quality is >30 && <=70 then choose medium params, not low.
Spotted by Snacker, thanks.
2014-04-08 15:58:58 +09:00
Cedric BAIL 83af91c8b8 eet: add negociation colorspace support to Eet. 2014-04-01 22:00:54 +09:00
Cedric BAIL b1e5760811 eet: add internal encoding to ETC1 as an alternate solution to Jpeg. 2014-04-01 22:00:15 +09:00
Felipe Magno de Almeida ab3eb4b2d3 eet-cxx: add implementation for eet C++.
Usage example:

  struct type
  {
    int foo;
    float bar;
  };

  type t0;

  auto descriptor = make_descriptor("type", &type::ofo, &type::bar);

  eet_data_write(file, descriptor.native_handle(), "type", &t0, false);

  std::unique_ptr<type> p = read_by_ptr(file, "type", descriptor);
  type t = read(file, "type", descriptor);

@feature

Reviewers: cedric, smohanty

Reviewed By: cedric

CC: savio, cedric

Differential Revision: https://phab.enlightenment.org/D659

Signed-off-by: Cedric BAIL <cedric.bail@free.fr>
2014-04-01 22:00:13 +09:00
Gustavo Sverzut Barbieri f2a1f14abd eet: fix tokenizer's escape logic.
Tokenizer's approach of looking back is horrible and breaks the
following simple case (bug I had that lead to this patch):

          "string\\"

As the parser would get the end quote and check the previous character
if it was a backslash and it was, but it was not escaping the quote,
but being escaped by the previous backslash.

The best approach is to first check for escape and then go to
quote. Escape is simple and only the following byte, so we enter
escape, process the byte and then are back to regular mode (be it
quote or unquote).

Added testcase so we avoid breaking it again.

@bugfix cherry-pick
2014-03-13 22:08:44 -03:00
Carsten Haitzler b11ccd9787 eet - dump - if group type is not a handled type, assume unknown
fixes CID 1039307
2014-02-13 20:08:59 +09:00
Albin Tonnerre 62efaed9dc comments: typo fix - s/dictionnary/dictionary
Reviewers: cedric

Reviewed By: cedric

CC: cedric

Differential Revision: https://phab.enlightenment.org/D533

Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
2014-02-10 10:40:12 +09:00
Carsten Haitzler 414b447f54 Revert "eet: do not load data when the file is open in read/write mode."
This reverts commit f8b0322704.

this breaks efreets icon cache. i have been noticing this since
yesterday across all my machines once i update just efl. i tracked it
down to this commit.
2014-01-21 09:18:52 +09:00
Gustavo Sverzut Barbieri 0d1d51f64e eet_data: guarantee double-word alignment for temporary stack buffer.
The code was giving enough memory to store doubles and longs, but they
could be unaligned as "unsigned char" allows 1-byte alignment, while
double may require 8 bytes.

By specifying the array as "long long" we force certain alignment in a
platform independent way. As this array is small enough and
short-lived, the number of items were not changed, this results in
more bytes on the stack but it shouldn't matter.
2014-01-20 21:44:42 -02:00
Cedric BAIL f8b0322704 eet: do not load data when the file is open in read/write mode.
I do think that it was a left over from previous file format. Removing
this memcpy should make Enlightenment startup faster and should reduce
by 500KB the memory it use.
2014-01-20 13:04:07 +09:00
Cedric BAIL 00d4f5cf1c eet: reduce memory usage of Eet internal structure by removing useless structure. 2014-01-20 13:04:06 +09:00
Daniel Juyung Seo 76d8532b54 efl: Unified eina critical manro to CRI.
Being annoyed by different types of eina critical macros - CRI, CRIT,
 CRITICAL -, I concluded to unify them to one. Discussed on IRC and
 finally, CRI was chosen to meet the consistency with other macros -
 ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
2013-12-26 12:27:13 +09:00
Carsten Haitzler f0ba71314e eet data encode - dont free data if its not separately allocated
in one case data is not separately allocated but is part of the
Eet_Variant_Unknow struct where it is allocated as extra space on the
end of the data blob. in this case don't free it, otherwise do (pass
in true) as before. this should fix CID 1039728
2013-12-11 20:44:51 +09:00
Vorobiov Vitalii c3bee34c3c eet: Stopped SPANKing the naughty programmer while deleting dictionary.
Function edje_edit_save_all cause lots of SPANK SPANK, because
eet_dictionary_free is trying to delete string that is actually not a stringshare.

Reviewers: cedric, seoz, raster

Reviewed By: cedric

CC: reutskiy.v.v, cedric

Differential Revision: https://phab.enlightenment.org/D322

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-11-07 17:58:47 +09:00
Carsten Haitzler b07c0a76ce alpha1 release autofoo/build tree work to pass distcheck and actually work 2013-11-04 18:33:35 +09:00
Christophe Sadoine 6853dbcf23 eet: Adding EET_DATA_DESCRIPTOR_ADD_MAPPING_BASIC to add a basic type to a union.
I added EET_DATA_DESCRIPTOR_ADD_MAPPING_BASIC because I need basic types in unions, and EET_DATA_DESCRIPTOR_ADD_MAPPING is only for structs.
I also modified the example with a float and a string.

Reviewers: cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D313

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-11-04 15:35:41 +09:00
Cedric Bail 440471e599 eet: shutup a warning and use the right pointer source even if they are the same. 2013-11-04 12:46:48 +09:00
Cedric Bail 07c306a272 eet: let's use const Eina_File here to. 2013-11-04 11:28:56 +09:00
Cedric Bail 1a3c9d68d0 eet: help the kernel to actually load the eet file in memory more efficiently.
When you open a theme, it is very likely that most of the data in it will be needed
at some point, that's why it is a good idea to tell it in advance to the kernel so
it could load them if it has some spare ressource.

We can't just blindly turn EINA_FILE_WILLNEED on any file or a wrong eet file would
be loaded in memory when we don't need it. So we shall keep the sequential load until
we are sure that the file is correct and then explicitely tell the kernel that the
rest of the data should be loaded in ram.
2013-10-28 18:32:40 +09:00
Cedric Bail c718a41728 eet: log size of subtype added to an Eet_Data_Descriptor.
This is really useful to track down a leak of a memory piece allocated by an
eet_data function. If you know the size of the leaked structure (valgrind
give you the total allocated size and the number of structure in it, so you
need to divide before having the right number), you just need to do :
EINA_LOG_LEVELS=eet:3 my_app 2>&1 | grep the_size

And there will be very few line matching reducing what you should be looking at.
2013-10-11 14:43:35 +09:00
Cedric Bail b9d8a7af3a eet: use Eina_Spinlock instead of Eina_Lock for Eet_Dictionary. 2013-10-11 11:08:17 +09:00
Christophe Sadoine 87b17f1ce9 eet: added EET_DATA_DESCRIPTOR_ADD_SUB_NESTED(). 2013-09-24 15:10:44 +09:00
Stefan Schmidt d067c28e74 eet: Add comment about missing break in switch statement 2013-08-09 10:17:49 +01:00
Chris Michael cc0bbacb89 open() can fail for various reasons, so check for valid 'fd' return
before calling fdopen.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 11:34:34 +01:00
Carsten Haitzler d12b6e6fa1 fix clang bad free complaint 2013-07-16 18:20:07 +09:00
Carsten Haitzler aaf5a55319 fir clang nonnull complaint 2013-07-16 16:55:03 +09:00