Cedric wrote:
>>> Well, the semantics of the image-size-set function has always
>>> been that if there is no data or file for the image, it will create
>>> data of the requested size, and if there is data (possibly from a
>>> file), it will create new data of the requested size and copy as much
>>> as possible of the current data to the new one and then set that new
>>> one as the current data.
>>> So, for the test program there, after the inital rendering
>>> (of a blue area), when the resize is called the image would have
>>> new data (not the provided pixels) one pixel less in width, so the
>>> subsequent ecore induced rendering would still show the same result
>>> (even though there's no further call to 'set data' as the callback
>>> won't get triggered since 'dirty pixels' isn't called again, and
>>> it's been unset after the first rendering).
>>>
>>> This would seem to show some new problem with the 'image-resize'
>>> function when external data has been set before on the image.. and
>>> indeed if I get rid of the pixels callback and simply set the data
>>> (after the initial image size setting), then the problem is still
>>> there even without the first call to evas render.. ie. the second
>>> call to image-size-set seems to be the culprit.
>>>
>> Took a quick look at the software_generic engine, and in the file
>> evas_engine.c, we see the following implementations of say:
>>
>> static void *
>> eng_image_size_set(void *data, void *image, int w, int h)
>> {
>> RGBA_Image *im;
>>
>> im = image;
>> return evas_cache_image_size_set(image, w, h);
>> }
>>
>> static void *
>> eng_image_dirty_region(void *data, void *image, int x, int y, int w, int h)
>> {
>> RGBA_Image* im = image;
>>
>> if (!image) return NULL;
>> im = (RGBA_Image *) evas_cache_image_dirty(&im->cache_entry, x, y, w, h);
>> return im;
>> }
>>
>> We may contrast these with the signatures of the called 'cache'
>> functions, in the evas_cache_image.c file:
>>
>> EAPI Image_Entry *
>> evas_cache_image_size_set(Image_Entry *im, int w, int h);
>>
>> EAPI Image_Entry *EAPI Image_Entry *
>> evas_cache_image_dirty(Image_Entry *im, int x, int y, int w, int h)
>>
>>
>> So, it may be that something's not quite correctly called here.
>> It's also possible that the actual implementation of the function
>> "evas_cache_image_size_set" isn't doing 'the right thing', but haven't
>> had a chance to look... Cedric?
>>
>
> No this is correct. But eng_image_dirty_region is not called in the
> second case. If I force the dirty_pixel to 1, it call
> eng_image_dirty_region and every thing goes ok. So perhaps in case we
> have func.get_pixels set, we should on resize set dirty_pixel to 1. I
> think this should sove the issue, but I am not sure it's really the
> correct fix.
>
Something's not correct with the image-size-set function,
it should be taking the externally set pixel data, and copying
it to newly created data and setting that as the image data.
Forget about the pixels-get function in that example, just
comment it out and instead add a call to the image-data-set func
instead... I've included a simplified version of their 'error-demo'
below which does this. It should work correctly but it doesn't.
:(
/********************************************************************/
#include <Ecore_Evas.h>
#include <Ecore.h>
#include <stdlib.h>
#include <stdio.h>
#define WIDTH 400
#define HEIGHT 400
Ecore_Evas *ee;
Evas *evas;
#define BUFWIDTH 10
#define BUFHEIGHT 10
static int pixels[BUFWIDTH*BUFHEIGHT]; // our buffer for the image
static void draw_to_buffer(){
int i;
// Just make the area blue
for(i=0; i<BUFWIDTH*BUFHEIGHT; i++){
pixels[i] = 0xFF0000FF;
}
}
int main(){
Evas_Object* image_obj;
ecore_init();
ecore_evas_init();
ee = ecore_evas_software_x11_new(0, 0, 0, 0, WIDTH, HEIGHT);
ecore_evas_title_set(ee, "Ecore_Evas Template");
ecore_evas_show(ee);
evas = ecore_evas_get(ee);
draw_to_buffer();
image_obj = evas_object_image_add(evas);
evas_object_resize(image_obj, 100, 100);
evas_object_move(image_obj, 20, 20);
evas_object_image_fill_set(image_obj, 0, 0, 100, 100);
// The first call to evas_object_image_size_set() - no problems
evas_object_image_size_set(image_obj, BUFWIDTH, BUFHEIGHT);
evas_object_image_data_set(image_obj, pixels);
evas_object_show(image_obj);
evas_object_image_size_set(image_obj, BUFWIDTH-1, BUFHEIGHT);
ecore_main_loop_begin();
return 0;
}
/********************************************************************/
____________________________________________________________
Click here for great computer networking solutions!
http://thirdpartyoffers.juno.com/TGL2141/fc/Ioyw6i3oHgMYZMuqjBHmoQMDXxRCkTW2bKJMYk3YuHyA3lAE5qmeB5/
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel