Closed GoogleCodeExporter closed 9 years ago
Screenshot with ok load
Original comment by shumi.ar...@gmail.com
on 17 Dec 2013 at 10:37
Attachments:
Screenshot where part of first embeded image is badly loaded (it is similar
when something loading from cache)
Original comment by shumi.ar...@gmail.com
on 17 Dec 2013 at 10:38
Attachments:
Screenshot where all embeded images were loaded "trashed"
Original comment by shumi.ar...@gmail.com
on 17 Dec 2013 at 10:38
Attachments:
Hi. Thanks for the report.
How often does this happen? Are you able to reproduce it reliably?
Original comment by paul.leb...@gmail.com
on 17 Dec 2013 at 12:14
This happens almost any rendering time.
As I understand this effect happens first of all with big embeded images (from
10 KB - in attached svg size is approximately 60 KB), because with small images
it works fine.
I'll try to record small video at post it here.
Original comment by shumi.ar...@gmail.com
on 17 Dec 2013 at 12:54
When you say "embedded images", do you mean data-url/Base64 images? Does it
happen if the images are external to the SVG file?
Original comment by paul.leb...@gmail.com
on 17 Dec 2013 at 12:57
Saying "embedded images" I mean images with href like this:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJkAAAC3CAIAAACOmGurAAAAA3NCSVQIC
Ajb4U/gAAAgAElEQVR4 nIy92bcmx5..."
I didn't try to use external to SVG images, so I cann't say anything about this
case.
Original comment by shumi.ar...@gmail.com
on 17 Dec 2013 at 1:21
Paul, hello!
Do you have any ideas: how to solve the problem?
Original comment by shumi.ar...@gmail.com
on 23 Dec 2013 at 6:28
Paul, hello again!
All my investigations and analysis of situation with embedded images resulted
in:
problem is in this code line of SvgAndroidRenderer:
canvas.drawBitmap(image, 0, 0, state.fillPaint);
I decided to replace it with:
state.fillPaint.setColor(0xFFFFFF00); //yellow color
canvas.drawRectangle(obj.boundingBox.toRectF(), state.fillPaint);
And everything is good.
But drawBitmap doesnot work at all.
At the same time I tested this bug on HTC One S (OS version 4.1.1) - result is:
the same situation. Some items are drawn as expected, some are drawn as trash.
Original comment by shumi.ar...@gmail.com
on 23 Dec 2013 at 8:16
Ah yes. I remember now. This is the same issue that I noticed and fixed a
couple of months ago.
The fix will be in the next release (1.3) which should be released earlier
2014. Unfortunately I can't commit a fix to the repository right now, but if
you change line 1838 to:
canvas.drawBitmap(image, 0, 0, new Paint());
things should work a lot better.
Let me know if this does work. Thanks for the work you have done investigating
this issue.
Original comment by paul.leb...@gmail.com
on 23 Dec 2013 at 9:31
Paul, thanks a lot.
But unfortunately there is no result.
The same problems exist.
Now I'll try to use external to SVG images.
Original comment by shumi.ar...@gmail.com
on 23 Dec 2013 at 10:40
As I expected, the same results for images external to SVG. Some are drawn
correctly, some no.
Paul, during investingating found out that after drawing bitmap it is necessary
to mark bitmap as recycled, so I recommend you to add one more change:
canvas.drawBitmap(image, 0, 0, new Paint());
image.recycle(); //mark as recycled
And once more change that I saw in the origin library (svg-android): before
drawing bitmap the author prepares image to be drawn using following line:
image.prepareToDraw();
So the result code is:
image.prepareToDraw();
canvas.drawBitmap(image, 0, 0, new Paint());
image.recycle();
Original comment by shumi.ar...@gmail.com
on 23 Dec 2013 at 11:34
Marking as "recycled" need to inform GC about possibility to remove bitmap from
heap.
Original comment by shumi.ar...@gmail.com
on 23 Dec 2013 at 11:35
Paul, hello again!
I've create small class PhantomView.
It has list of string - paths to images at internalSD memory (like using
external to SVG images).
Override onDraw method and tried to see the result of drawing approximately 10
images.
Everithing is OK!
So the problem lies somewhere else.
Original comment by shumi.ar...@gmail.com
on 23 Dec 2013 at 1:06
Attachments:
Could you fix it please?
Original comment by dtambore...@gmail.com
on 11 May 2014 at 9:47
This fix will be available in 1.2.2. A beta release of 1.2.2 is now available
on the downloads page.
Marking Fixed.
Original comment by paul.leb...@gmail.com
on 16 Jun 2014 at 7:47
Original issue reported on code.google.com by
shumi.ar...@gmail.com
on 17 Dec 2013 at 10:07Attachments: