Friday, September 28, 2012

Re: [android-developers] Re: Hardware acceleration and drawPath problem

You are running into a well known hardware acceleration limitation.
Paths are currently transformed into OpenGL texture at the size you
define them. This means that if your Path contains only coordinates
between 0 and 1, the texture will be 1x1. This is why your addPath()
solution works.

This is something we *really* *really* *really* want to improve but
it's pretty complicated. We're working on it though :)

On Fri, Sep 28, 2012 at 7:33 PM, thibault <thibault@gmvhdl.com> wrote:
> I've made some progress on this, but I think there are two bugs in the
> hardware acceleration:
> 1) When Canvas.drawPath is called with a path created via the
> Path.transform(Matrix matrix, Path dest) method, nothing is drawn. A work
> around is using an alternative method Path.addPath(Path path, Matrix
> transform) which works correctly.
> 2) Some paths are just not displayed depending on the position. Moving them
> by 1.0 in the x or y direction sometimes make them appear. Unfortunately,
> this is not a suitable workaround because the layout is dynamic and will
> change. I haven't picked up a pattern yet on why certain positions and not
> others. It is no where near the edge of the clipping rectangle.
>
> On Friday, September 28, 2012 8:14:06 PM UTC, thibault wrote:
>>
>> I have a Drawable whose draw method make calls to Canvas.drawText and
>> Canvas.drawPath. When hardware acceleration is enabled, I only see the text
>> displayed, none of the paths are displayed. Everything is correctly
>> displayed when hardware acceleration is disabled. Does anyone have ideas
>> about this?
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



--
Romain Guy
Android framework engineer
romainguy@android.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment