hrev43694 adds 2 changesets to branch 'master' old head: a42877a6e46dfef684c1c8f2a560275972de0cd8 new head: 47452375a77faf7903bca949d4120b5bda44c944 ---------------------------------------------------------------------------- a80293e: opengl: Pointer, newline cleanup, no functional change * Clean up pointer positions * Clean up function line returns 4745237: opengl: Clear up a few header issues, no functional change * Philippe voiced that he was the original author in the ML, adding Philippe to the headers to ensure credit is given. * Adding Precision Insight copyright back *just incase* It's unclear if Precision Insight code was used given Philippe's comments in the ML, lets be safe and add it back. As we have Brian's permission for these changes I feel comfortable with it. [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ] ---------------------------------------------------------------------------- 6 files changed, 99 insertions(+), 83 deletions(-) src/kits/opengl/GLDispatcher.cpp | 10 ++-- src/kits/opengl/GLDispatcher.h | 44 ++++++++++------ src/kits/opengl/GLRenderer.cpp | 20 ++++---- src/kits/opengl/GLRendererRoster.cpp | 18 ++++--- src/kits/opengl/GLRendererRoster.h | 11 +++-- src/kits/opengl/GLView.cpp | 79 +++++++++++++++--------------- ############################################################################ Commit: a80293e0cf3fd1bbaa4a8658d763fc69de7f6199 URL: http://cgit.haiku-os.org/haiku/commit/?id=a80293e Author: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> Date: Thu Jan 26 15:47:08 2012 UTC opengl: Pointer, newline cleanup, no functional change * Clean up pointer positions * Clean up function line returns ---------------------------------------------------------------------------- diff --git a/src/kits/opengl/GLDispatcher.cpp b/src/kits/opengl/GLDispatcher.cpp index a222b7f..f26d431 100644 --- a/src/kits/opengl/GLDispatcher.cpp +++ b/src/kits/opengl/GLDispatcher.cpp @@ -29,12 +29,12 @@ extern "C" { #define NAME(func) gl##func #define DISPATCH(func, args, msg) \ - const struct _glapi_table *dispatch; \ + const struct _glapi_table* dispatch; \ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ (dispatch->func) args #define RETURN_DISPATCH(func, args, msg) \ - const struct _glapi_table *dispatch; \ + const struct _glapi_table* dispatch; \ dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\ return (dispatch->func) args @@ -59,7 +59,7 @@ BGLDispatcher::~BGLDispatcher() status_t -BGLDispatcher::CheckTable(const struct _glapi_table *table) +BGLDispatcher::CheckTable(const struct _glapi_table* table) { _glapi_check_table(table ? table : _glapi_get_dispatch()); return B_OK; @@ -67,7 +67,7 @@ BGLDispatcher::CheckTable(const struct _glapi_table *table) status_t -BGLDispatcher::SetTable(struct _glapi_table *table) +BGLDispatcher::SetTable(struct _glapi_table* table) { _glapi_set_dispatch(table); return B_OK; diff --git a/src/kits/opengl/GLDispatcher.h b/src/kits/opengl/GLDispatcher.h index bb8a4c0..7ac70c4 100644 --- a/src/kits/opengl/GLDispatcher.h +++ b/src/kits/opengl/GLDispatcher.h @@ -30,67 +30,75 @@ class BGLDispatcher BGLDispatcher(); ~BGLDispatcher(); - void SetCurrentContext(void * context); - void * CurrentContext(); + void SetCurrentContext(void* context); + void* CurrentContext(); - struct _glapi_table * Table(); + struct _glapi_table* Table(); status_t CheckTable( - const struct _glapi_table *dispatch = NULL); - status_t SetTable(struct _glapi_table *dispatch); + const struct _glapi_table* dispatch = NULL); + status_t SetTable(struct _glapi_table* dispatch); uint32 TableSize(); - const _glapi_proc operator[](const char *functionName); - const char * operator[](uint32 offset); + const _glapi_proc operator[](const char* functionName); + const char* operator[](uint32 offset); - const _glapi_proc AddressOf(const char *functionName); - uint32 OffsetOf(const char *functionName); + const _glapi_proc AddressOf(const char* functionName); + uint32 OffsetOf(const char* functionName); }; // Inlines methods -inline void BGLDispatcher::SetCurrentContext(void * context) +inline void +BGLDispatcher::SetCurrentContext(void* context) { _glapi_set_context(context); } -inline void * BGLDispatcher::CurrentContext() +inline void* +BGLDispatcher::CurrentContext() { return _glapi_get_context(); } -inline struct _glapi_table * BGLDispatcher::Table() +inline struct _glapi_table* +BGLDispatcher::Table() { return _glapi_get_dispatch(); } -inline uint32 BGLDispatcher::TableSize() +inline uint32 +BGLDispatcher::TableSize() { return _glapi_get_dispatch_table_size(); } -inline const _glapi_proc BGLDispatcher::operator[](const char *functionName) +inline const _glapi_proc +BGLDispatcher::operator[](const char* functionName) { return _glapi_get_proc_address(functionName); } -inline const char * BGLDispatcher::operator[](uint32 offset) +inline const char* +BGLDispatcher::operator[](uint32 offset) { return _glapi_get_proc_name((GLuint) offset); } -inline const _glapi_proc BGLDispatcher::AddressOf(const char *functionName) +inline const _glapi_proc +BGLDispatcher::AddressOf(const char* functionName) { return _glapi_get_proc_address(functionName); } -inline uint32 BGLDispatcher::OffsetOf(const char *functionName) +inline uint32 +BGLDispatcher::OffsetOf(const char* functionName) { return (uint32) _glapi_get_proc_offset(functionName); } diff --git a/src/kits/opengl/GLRenderer.cpp b/src/kits/opengl/GLRenderer.cpp index 39399b2..cc0c95a 100644 --- a/src/kits/opengl/GLRenderer.cpp +++ b/src/kits/opengl/GLRenderer.cpp @@ -9,8 +9,8 @@ #include "GLDispatcher.h" -BGLRenderer::BGLRenderer(BGLView *view, ulong glOptions, - BGLDispatcher *dispatcher) +BGLRenderer::BGLRenderer(BGLView* view, ulong glOptions, + BGLDispatcher* dispatcher) : fRefCount(1), fView(view), @@ -66,14 +66,14 @@ BGLRenderer::Draw(BRect updateRect) status_t -BGLRenderer::CopyPixelsOut(BPoint source, BBitmap *dest) +BGLRenderer::CopyPixelsOut(BPoint source, BBitmap* dest) { return B_ERROR; } status_t -BGLRenderer::CopyPixelsIn(BBitmap *source, BPoint dest) +BGLRenderer::CopyPixelsIn(BBitmap* source, BPoint dest) { return B_ERROR; } @@ -86,7 +86,7 @@ BGLRenderer::FrameResized(float width, float height) void -BGLRenderer::DirectConnected(direct_buffer_info *info) +BGLRenderer::DirectConnected(direct_buffer_info* info) { } @@ -97,8 +97,8 @@ BGLRenderer::EnableDirectMode(bool enabled) } -status_t BGLRenderer::_Reserved_Renderer_0(int32 n, void *p) { return B_ERROR; } -status_t BGLRenderer::_Reserved_Renderer_1(int32 n, void *p) { return B_ERROR; } -status_t BGLRenderer::_Reserved_Renderer_2(int32 n, void *p) { return B_ERROR; } -status_t BGLRenderer::_Reserved_Renderer_3(int32 n, void *p) { return B_ERROR; } -status_t BGLRenderer::_Reserved_Renderer_4(int32 n, void *p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_0(int32 n, void* p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_1(int32 n, void* p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_2(int32 n, void* p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_3(int32 n, void* p) { return B_ERROR; } +status_t BGLRenderer::_Reserved_Renderer_4(int32 n, void* p) { return B_ERROR; } diff --git a/src/kits/opengl/GLRendererRoster.cpp b/src/kits/opengl/GLRendererRoster.cpp index abd5ae7..2c3aab3 100644 --- a/src/kits/opengl/GLRendererRoster.cpp +++ b/src/kits/opengl/GLRendererRoster.cpp @@ -21,12 +21,13 @@ #include <string.h> -extern "C" status_t _kern_get_safemode_option(const char *parameter, - char *buffer, size_t *_bufferSize); +extern "C" status_t _kern_get_safemode_option(const char* parameter, + char* buffer, size_t* _bufferSize); -GLRendererRoster::GLRendererRoster(BGLView *view, ulong options) - : fNextID(0), +GLRendererRoster::GLRendererRoster(BGLView* view, ulong options) + : + fNextID(0), fView(view), fOptions(options), fSafeMode(false), @@ -78,7 +79,7 @@ GLRendererRoster::~GLRendererRoster() } -BGLRenderer * +BGLRenderer* GLRendererRoster::GetRenderer(int32 id) { RendererMap::const_iterator iterator = fRenderers.find(id); @@ -193,13 +194,13 @@ GLRendererRoster::CreateRenderer(const entry_ref& ref) if (image < B_OK) return image; - BGLRenderer *(*instantiate_renderer) - (BGLView *view, ulong options, BGLDispatcher *dispatcher); + BGLRenderer* (*instantiate_renderer) + (BGLView* view, ulong options, BGLDispatcher* dispatcher); status = get_image_symbol(image, "instantiate_gl_renderer", B_SYMBOL_TYPE_TEXT, (void**)&instantiate_renderer); if (status == B_OK) { - BGLRenderer *renderer + BGLRenderer* renderer = instantiate_renderer(fView, fOptions, new BGLDispatcher()); if (!renderer) { unload_add_on(image); diff --git a/src/kits/opengl/GLRendererRoster.h b/src/kits/opengl/GLRendererRoster.h index 33f23a6..7e54977 100644 --- a/src/kits/opengl/GLRendererRoster.h +++ b/src/kits/opengl/GLRendererRoster.h @@ -12,7 +12,7 @@ struct renderer_item { - BGLRenderer *renderer; + BGLRenderer* renderer; entry_ref ref; ino_t node; image_id image; @@ -23,10 +23,10 @@ typedef std::map<renderer_id, renderer_item> RendererMap; class GLRendererRoster { public: - GLRendererRoster(BGLView *view, ulong options); + GLRendererRoster(BGLView* view, ulong options); virtual ~GLRendererRoster(); - BGLRenderer *GetRenderer(int32 id = 0); + BGLRenderer* GetRenderer(int32 id = 0); private: void AddDefaultPaths(); @@ -37,7 +37,7 @@ class GLRendererRoster { RendererMap fRenderers; int32 fNextID; - BGLView *fView; + BGLView* fView; ulong fOptions; bool fSafeMode; const char* fABISubDirectory; diff --git a/src/kits/opengl/GLView.cpp b/src/kits/opengl/GLView.cpp index 7556764..730f7f0 100644 --- a/src/kits/opengl/GLView.cpp +++ b/src/kits/opengl/GLView.cpp @@ -25,7 +25,7 @@ struct glview_direct_info { - direct_buffer_info *direct_info; + direct_buffer_info* direct_info; bool direct_connected; bool enable_direct_mode; @@ -101,7 +101,7 @@ BGLView::SwapBuffers(bool vSync) } -BView * +BView* BGLView::EmbeddedView() { return NULL; @@ -124,7 +124,7 @@ BGLView::GetGLProcAddress(const char* procName) status_t -BGLView::CopyPixelsOut(BPoint source, BBitmap *dest) +BGLView::CopyPixelsOut(BPoint source, BBitmap* dest) { if (!fRenderer) return B_ERROR; @@ -137,7 +137,7 @@ BGLView::CopyPixelsOut(BPoint source, BBitmap *dest) status_t -BGLView::CopyPixelsIn(BBitmap *source, BPoint dest) +BGLView::CopyPixelsIn(BBitmap* source, BPoint dest) { if (!fRenderer) return B_ERROR; @@ -185,7 +185,7 @@ BGLView::AttachedToWindow() BView::AttachedToWindow(); fBounds = Bounds(); - for (BView *view = this; view != NULL; view = view->Parent()) + for (BView* view = this; view != NULL; view = view->Parent()) view->ConvertToParent(&fBounds); fRenderer = fRoster->GetRenderer(); @@ -255,7 +255,7 @@ void BGLView::FrameResized(float width, float height) { fBounds = Bounds(); - for (BView *v = this; v; v = v->Parent()) + for (BView* v = this; v; v = v->Parent()) v->ConvertToParent(&fBounds); if (fRenderer) { @@ -267,26 +267,26 @@ BGLView::FrameResized(float width, float height) UnlockGL(); } - BView::FrameResized(width, height); + BView::FrameResized(width, height); } status_t -BGLView::Perform(perform_code d, void *arg) +BGLView::Perform(perform_code d, void* arg) { - return BView::Perform(d, arg); + return BView::Perform(d, arg); } status_t -BGLView::Archive(BMessage *data, bool deep) const +BGLView::Archive(BMessage* data, bool deep) const { return BView::Archive(data, deep); } void -BGLView::MessageReceived(BMessage *msg) +BGLView::MessageReceived(BMessage* msg) { BView::MessageReceived(msg); } @@ -323,23 +323,23 @@ BGLView::Hide() } -BHandler * -BGLView::ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier, - int32 form, const char *property) +BHandler* +BGLView::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, + int32 form, const char* property) { return BView::ResolveSpecifier(msg, index, specifier, form, property); } status_t -BGLView::GetSupportedSuites(BMessage *data) +BGLView::GetSupportedSuites(BMessage* data) { return BView::GetSupportedSuites(data); } void -BGLView::DirectConnected(direct_buffer_info *info) +BGLView::DirectConnected(direct_buffer_info* info) { if (fClipInfo == NULL) { fClipInfo = new (std::nothrow) glview_direct_info(); @@ -347,7 +347,7 @@ BGLView::DirectConnected(direct_buffer_info *info) return; } - direct_buffer_info *localInfo = fClipInfo->direct_info; + direct_buffer_info* localInfo = fClipInfo->direct_info; switch (info->buffer_state & B_DIRECT_MODE_MASK) { case B_DIRECT_START: @@ -414,8 +414,8 @@ BGLView::_CallDirectConnected() if (!fClipInfo) return; - direct_buffer_info *localInfo = fClipInfo->direct_info; - direct_buffer_info *info = (direct_buffer_info *)malloc( + direct_buffer_info* localInfo = fClipInfo->direct_info; + direct_buffer_info* info = (direct_buffer_info*)malloc( DIRECT_BUFFER_INFO_AREA_SIZE); if (info == NULL) return; @@ -479,13 +479,11 @@ BGLView::BGLView(BRect rect, char* name, ulong resizingMode, ulong mode, #if 0 - - // TODO: implement BGLScreen class... BGLScreen::BGLScreen(char* name, ulong screenMode, ulong options, - status_t *error, bool debug) + status_t* error, bool debug) : BWindowScreen(name, screenMode, error, debug) { @@ -536,57 +534,58 @@ BGLScreen::ScreenConnected(bool enabled) void BGLScreen::FrameResized(float width, float height) { - return BWindowScreen::FrameResized(width, height); + return BWindowScreen::FrameResized(width, height); } status_t -BGLScreen::Perform(perform_code d, void *arg) +BGLScreen::Perform(perform_code d, void* arg) { - return BWindowScreen::Perform(d, arg); + return BWindowScreen::Perform(d, arg); } status_t -BGLScreen::Archive(BMessage *data, bool deep) const +BGLScreen::Archive(BMessage* data, bool deep) const { - return BWindowScreen::Archive(data, deep); + return BWindowScreen::Archive(data, deep); } void -BGLScreen::MessageReceived(BMessage *msg) +BGLScreen::MessageReceived(BMessage* msg) { - BWindowScreen::MessageReceived(msg); + BWindowScreen::MessageReceived(msg); } void BGLScreen::Show() { - BWindowScreen::Show(); + BWindowScreen::Show(); } void BGLScreen::Hide() { - BWindowScreen::Hide(); + BWindowScreen::Hide(); } -BHandler * -BGLScreen::ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier, - int32 form, const char *property) +BHandler* +BGLScreen::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier, + int32 form, const char* property) { - return BWindowScreen::ResolveSpecifier(msg, index, specifier, form, property); + return BWindowScreen::ResolveSpecifier(msg, index, specifier, + form, property); } status_t -BGLScreen::GetSupportedSuites(BMessage *data) +BGLScreen::GetSupportedSuites(BMessage* data) { - return BWindowScreen::GetSupportedSuites(data); + return BWindowScreen::GetSupportedSuites(data); } @@ -600,10 +599,10 @@ void BGLScreen::_ReservedGLScreen5() {} void BGLScreen::_ReservedGLScreen6() {} void BGLScreen::_ReservedGLScreen7() {} void BGLScreen::_ReservedGLScreen8() {} - #endif -const char * color_space_name(color_space space) + +const char* color_space_name(color_space space) { #define C2N(a) case a: return #a @@ -630,7 +629,7 @@ const char * color_space_name(color_space space) glview_direct_info::glview_direct_info() { // TODO: See direct_window_data() in app_server's ServerWindow.cpp - direct_info = (direct_buffer_info *)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE); + direct_info = (direct_buffer_info*)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE); direct_connected = false; enable_direct_mode = false; } ############################################################################ Revision: hrev43694 Commit: 47452375a77faf7903bca949d4120b5bda44c944 URL: http://cgit.haiku-os.org/haiku/commit/?id=4745237 Author: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> Date: Thu Jan 26 19:19:34 2012 UTC opengl: Clear up a few header issues, no functional change * Philippe voiced that he was the original author in the ML, adding Philippe to the headers to ensure credit is given. * Adding Precision Insight copyright back *just incase* It's unclear if Precision Insight code was used given Philippe's comments in the ML, lets be safe and add it back. As we have Brian's permission for these changes I feel comfortable with it. ---------------------------------------------------------------------------- diff --git a/src/kits/opengl/GLDispatcher.cpp b/src/kits/opengl/GLDispatcher.cpp index f26d431..87b3b19 100644 --- a/src/kits/opengl/GLDispatcher.cpp +++ b/src/kits/opengl/GLDispatcher.cpp @@ -1,9 +1,11 @@ /* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: * Brian Paul <brian.e.paul@xxxxxxxxx> + * Philippe Houdoin <philippe.houdoin@xxxxxxx> */ diff --git a/src/kits/opengl/GLDispatcher.h b/src/kits/opengl/GLDispatcher.h index 7ac70c4..95d3be8 100644 --- a/src/kits/opengl/GLDispatcher.h +++ b/src/kits/opengl/GLDispatcher.h @@ -1,9 +1,11 @@ /* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000-2012 Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: * Brian Paul <brian.e.paul@xxxxxxxxx> + * Philippe Houdoin <philippe.houdoin@xxxxxxx> */ #ifndef GLDISPATCHER_H #define GLDISPATCHER_H diff --git a/src/kits/opengl/GLRendererRoster.cpp b/src/kits/opengl/GLRendererRoster.cpp index 2c3aab3..d2d21c8 100644 --- a/src/kits/opengl/GLRendererRoster.cpp +++ b/src/kits/opengl/GLRendererRoster.cpp @@ -3,6 +3,7 @@ * Distributed under the terms of the MIT License. * * Authors: + * Philippe Houdoin <philippe.houdoin@xxxxxxx> */ diff --git a/src/kits/opengl/GLRendererRoster.h b/src/kits/opengl/GLRendererRoster.h index 7e54977..5c8da27 100644 --- a/src/kits/opengl/GLRendererRoster.h +++ b/src/kits/opengl/GLRendererRoster.h @@ -1,6 +1,9 @@ /* * Copyright 2006-2012, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. + * + * Authors: + * Philippe Houdoin <philippe.houdoin@xxxxxxx> */ #ifndef _GLRENDERER_ROSTER_H #define _GLRENDERER_ROSTER_H