[Webkit-unassigned] [Bug 16095] Move GraphicsContextPrivate to its own header file.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 16 09:54:18 PST 2008


------- Comment #5 from maruel at gmail.com  2008-01-16 09:54 PDT -------
I wasn't clear enough, my bad. I'll try to explain better this time.

There is 2 goals:
- Add access to the current GraphicsContextState stack to
GraphicsContextPlatformPrivate, by having GraphicsContextPlatformPrivate
inherits from GraphicsContextPrivate.
- While at it, remove a memory allocation, clean things up.

There was a confusion about subclassing. I never meant to subclass
GraphicsContext but to add the possibility to subclass GraphicsContextPrivate.
This subclassing is not about adding anything virtual but really adding all the
GraphicsContext private stuff in one place instead of 2 differents objects
(GraphicsContextPrivate and GraphicsContextPlatformPrivate). Hence,
GraphicsContextPlatformPrivate could really just be subclass of
GraphicsContextPrivate. This is not an obligation with this patch though.

This also removes the need of m_data. Since the GraphicsContext constructor
could instantiate a subclass of GraphicsContextPrivate and set its pointer in
m_common, the need of a second memory allocation (m_data) disapear.

Frankly, I'd rather not modify the way the ports currently use m_data _in this
patch_ and instead leave the m_data variable there. At worst it's a
sizeof(void*) bytes lost.

This indeeds deprecate m_data but I didn't want to play in every port to modify
their use of m_data. This patch is the first step. I can't build all the
supported platforms so I'm not fond of modifying platforms I can't test. (!)
All of Cairo, GC, Qt, Wx and Win uses m_data. Luckily they all use a fairly
simple GraphicsContextPlatformPrivate class which would be easy to convert to a
GraphicsContextPrivate subclass.

Do you prefer me to add documentation to m_data about its deprecation in this

I hope it clears things up.

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

More information about the webkit-unassigned mailing list