[Webkit-unassigned] [Bug 41159] Come up with a more efficient way to represent Path segments

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jun 26 06:26:20 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=41159





--- Comment #8 from Nikolas Zimmermann <zimmermann at kde.org>  2010-06-26 06:26:20 PST ---
(In reply to comment #7)
> I'm fine with the ByteStreamWriter. But I think the ByteStreamReader goes into the wrong direction. ByteStreamWriter can be extended by new commands, dependent of the different needs and use cases. But ByteStreamReader should be as general as possible. That means, a caller should know himself, how the bytestream is builded. And ByteStreamReader should just have general methods to ask for bool, int and float and stores the current position in the stream. A caller can ask for the values one after the other without taking care of the current StreamPosition. If parsing fails, ByteStreamReader returns false.

I don't think it makes sense to generalize them. Think of ByteStreamReader/Writer as PathByteStreamReader/Writer classes. See SVGPathParser abstract interface in SVGParserUtilities.cpp - something like that is meant to be passed to PathByteStreamReader, so it will just forward the call to it. The user which derives from SVGPathParser (needs a rename) can decide what do to with the data (eg. build d attribute string, build SVGPathSeg datastructure etc..)

It would be very dangerous, to have just a generic reader classs, and a specific writer class - we should assure that they are always in sync.

I have no idea why you think that the encapsulation doesn't make much sense? After all the whole byte stream should be an implementation detail. SVGPathEllement should just store the "ByteStream" object, and use convenience methods to build a d attribute string and/or a SVGPathSeg data structure from it.

I can go more into details later, need to leave now, for the next 2 days.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list