diff options
author | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-22 22:57:44 +0000 |
---|---|---|
committer | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-22 22:57:44 +0000 |
commit | 2c1639589b5932b565c9d420cb79b56a4212a706 (patch) | |
tree | d74cd853d4753f9c19e5d50ad58d156a33417806 /o3d/command_buffer/service/cross | |
parent | 2e29d9243d84374d861a86252a2923cba9e49941 (diff) | |
download | chromium_src-2c1639589b5932b565c9d420cb79b56a4212a706.zip chromium_src-2c1639589b5932b565c9d420cb79b56a4212a706.tar.gz chromium_src-2c1639589b5932b565c9d420cb79b56a4212a706.tar.bz2 |
Fixes to get renderer=cb cb_service=gl to compile
again.
I was working on spliting some of the command buffer
code in preparation for GL command buffers so those
changes are in there as well. I didn't realize the
gl command buffers were broken.
I'm planning on sharing some of the command buffer
code and commands so I thought about making the
command buffers into 2 parts. The first N (256?)
commands are common commands. Noop, SetToken, Jump
Gosub. Those will be handled by common code.
After that come the O3D or GL command buffer
commands. I'm not sure that's a good idea but
there is a significant amount of code in managing
tokens and parsing etc and it seems like it would
be nice to share it until/if we delete the O3D
command buffers.
Note: You'll see that SetToken is hardcoded to 1.
I plan to fix that in the next CL when I split
the command into shared vs specific.
Review URL: http://codereview.chromium.org/307043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/command_buffer/service/cross')
-rw-r--r-- | o3d/command_buffer/service/cross/cmd_parser.cc | 4 | ||||
-rw-r--r-- | o3d/command_buffer/service/cross/cmd_parser.h | 2 | ||||
-rw-r--r-- | o3d/command_buffer/service/cross/cmd_parser_test.cc | 1 | ||||
-rw-r--r-- | o3d/command_buffer/service/cross/gapi_decoder.h | 1 | ||||
-rw-r--r-- | o3d/command_buffer/service/cross/gl/gapi_gl.h | 7 | ||||
-rw-r--r-- | o3d/command_buffer/service/cross/gl/gl_utils.h | 4 | ||||
-rw-r--r-- | o3d/command_buffer/service/cross/precompile.h | 12 |
7 files changed, 17 insertions, 14 deletions
diff --git a/o3d/command_buffer/service/cross/cmd_parser.cc b/o3d/command_buffer/service/cross/cmd_parser.cc index d17ab99..6f72aed 100644 --- a/o3d/command_buffer/service/cross/cmd_parser.cc +++ b/o3d/command_buffer/service/cross/cmd_parser.cc @@ -33,6 +33,8 @@ // This file contains the implementation of the command parser. #include "command_buffer/service/cross/cmd_parser.h" +// TODO(gman): remove this so we can use this code for different formats. +#include "command_buffer/common/cross/cmd_buffer_format.h" namespace o3d { namespace command_buffer { @@ -86,7 +88,7 @@ parse_error::ParseError CommandParser::ProcessCommand() { // get these errors. if (result != parse_error::kParseNoError) { DLOG(INFO) << "Error: " << result << " for Command " - << GetCommandName(static_cast<CommandId>(header.command)); + << cmd::GetCommandName(static_cast<CommandId>(header.command)); } get_ = (get + header.size) % entry_count_; return result; diff --git a/o3d/command_buffer/service/cross/cmd_parser.h b/o3d/command_buffer/service/cross/cmd_parser.h index 89b8269..ea003d2 100644 --- a/o3d/command_buffer/service/cross/cmd_parser.h +++ b/o3d/command_buffer/service/cross/cmd_parser.h @@ -37,7 +37,7 @@ #include "core/cross/types.h" #include "command_buffer/common/cross/constants.h" -#include "command_buffer/common/cross/cmd_buffer_format.h" +#include "command_buffer/common/cross/cmd_buffer_common.h" namespace o3d { namespace command_buffer { diff --git a/o3d/command_buffer/service/cross/cmd_parser_test.cc b/o3d/command_buffer/service/cross/cmd_parser_test.cc index d85eb67..02ee3948 100644 --- a/o3d/command_buffer/service/cross/cmd_parser_test.cc +++ b/o3d/command_buffer/service/cross/cmd_parser_test.cc @@ -35,6 +35,7 @@ #include "tests/common/win/testing_common.h" #include "command_buffer/service/cross/cmd_parser.h" #include "command_buffer/service/cross/mocks.h" +#include "base/scoped_ptr.h" namespace o3d { namespace command_buffer { diff --git a/o3d/command_buffer/service/cross/gapi_decoder.h b/o3d/command_buffer/service/cross/gapi_decoder.h index 08555eb..9c6cd32 100644 --- a/o3d/command_buffer/service/cross/gapi_decoder.h +++ b/o3d/command_buffer/service/cross/gapi_decoder.h @@ -37,6 +37,7 @@ #include "core/cross/types.h" #include "command_buffer/service/cross/cmd_parser.h" +#include "command_buffer/common/cross/cmd_buffer_format.h" namespace o3d { namespace command_buffer { diff --git a/o3d/command_buffer/service/cross/gl/gapi_gl.h b/o3d/command_buffer/service/cross/gl/gapi_gl.h index 324638b..3c07ba0 100644 --- a/o3d/command_buffer/service/cross/gl/gapi_gl.h +++ b/o3d/command_buffer/service/cross/gl/gapi_gl.h @@ -37,6 +37,9 @@ #define O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_GAPI_GL_H_ #include <build/build_config.h> +#include <GL/glew.h> +#include <Cg/cg.h> +#include <Cg/cgGL.h> #include "command_buffer/common/cross/gapi_interface.h" #include "command_buffer/service/cross/gl/gl_utils.h" #include "command_buffer/service/cross/gl/effect_gl.h" @@ -61,6 +64,10 @@ class GAPIGL : public GAPIInterface { void set_window_wrapper(XWindowWrapper *window) { window_ = window; } #elif defined(OS_WIN) void set_hwnd(HWND hwnd) { hwnd_ = hwnd; } + + HWND hwnd() const { + return hwnd_; + } #endif // Initializes the graphics context, bound to a window. diff --git a/o3d/command_buffer/service/cross/gl/gl_utils.h b/o3d/command_buffer/service/cross/gl/gl_utils.h index 36dfbf6..7500af6 100644 --- a/o3d/command_buffer/service/cross/gl/gl_utils.h +++ b/o3d/command_buffer/service/cross/gl/gl_utils.h @@ -36,6 +36,10 @@ #ifndef O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_GL_UTILS_H_ #define O3D_COMMAND_BUFFER_SERVICE_CROSS_GL_GL_UTILS_H_ +#include <GL/glew.h> +#if defined(OS_WIN) +#include <GL/wglew.h> +#endif #include <Cg/cg.h> #include <Cg/cgGL.h> #include <build/build_config.h> diff --git a/o3d/command_buffer/service/cross/precompile.h b/o3d/command_buffer/service/cross/precompile.h index 8a178e9..56de3de 100644 --- a/o3d/command_buffer/service/cross/precompile.h +++ b/o3d/command_buffer/service/cross/precompile.h @@ -42,18 +42,6 @@ #include <windows.h> #endif -#if defined(CB_SERVICE_D3D9) -#include <d3d9.h> -#include <d3dx9.h> -#endif // defined(CB_SERVICE_D3D9) - -#if defined(CB_SERVICE_GL) -#include <GL/glew.h> -#include <GL/wglew.h> -#include <Cg/cg.h> -#include <Cg/cgGL.h> -#endif // defined(CB_SERVICE_GL) - #include <assert.h> #include <algorithm> #include <map> |