[Mesa-dev] RFC: Whimsical renames and code motion

Brian Paul brianp at vmware.com
Tue Oct 12 10:30:40 PDT 2010


On 10/12/2010 10:43 AM, Kristian Høgsberg wrote:
> Hi,
>
> I wrote this patch series a while ago, but now that 7.9 is out I
> thought I'd float it on the list to see what people think.  The first
> couple of patches kill off glcore.h, which is no longer used for any
> external interfaces, and pull the struct into mtypes.h.  The next
> couple of patches massage it a bit to drop fields we don't use and
> rename it and it's many typedefs to just struct gl_config.  The patch
> series finishes with two patches to drop the GLframebuffer and
> GLcontext typedefs and just use struct gl_framebuffer and struct
> gl_context instead.  The last patch is 2MB, so I'll just point you to
> the branch in my repo:
>
>    http://cgit.freedesktop.org/~krh/mesa/log/?h=whimsical-renames
>
> and this output:
>
> [krh at hinata mesa]$ git log --oneline --shortstat origin/master..HEAD
> 8057432 Drop GLcontext typedef and use struct gl_context instead
>   789 files changed, 5696 insertions(+), 5699 deletions(-)
> 8dd8750 Drop GLframebuffer typedef and just use struct gl_framebuffer
>   54 files changed, 127 insertions(+), 128 deletions(-)
> e7158d3 Rename GLvisual and __GLcontextModes to struct gl_config
>   98 files changed, 176 insertions(+), 189 deletions(-)
> 4067d7a gl: Remove unused GLcontextModes fields
>   8 files changed, 7 insertions(+), 48 deletions(-)
> e63f0e4 Get rid of GL/internal/glcore.h
>   11 files changed, 314 insertions(+), 193 deletions(-)
>
> The last two renames are quite a mouthful, but I think they make a lot
> of sense and makes the mesa types more consistent; consistent with
> themselves (no other mesa structs have typedefs) and other code
> (gallium doesn't typedef structs and neither does most of the dri
> drivers (struct radeon_framebuffer, struct intel_context etc)).

I'm OK with these changes.

Some historical background.  GLcontext goes back to the very first 
version of Mesa.  The GLvisual and GLframebuffer types were added a 
bit later and were defined with typedefs to distinguish them as 
special types which percolate up to higher levels.  Contexts, visuals 
and framebuffers/surfaces are internal entities which also exist in 
APIs such as GLX and WGL.  But there's no concrete reasons for the 
typedefs.

-Brian


More information about the mesa-dev mailing list