summaryrefslogtreecommitdiffstats
path: root/o3d/gpu_plugin/gpu_processor.h
diff options
context:
space:
mode:
authorgman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-22 22:57:44 +0000
committergman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-22 22:57:44 +0000
commit2c1639589b5932b565c9d420cb79b56a4212a706 (patch)
treed74cd853d4753f9c19e5d50ad58d156a33417806 /o3d/gpu_plugin/gpu_processor.h
parent2e29d9243d84374d861a86252a2923cba9e49941 (diff)
downloadchromium_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/gpu_plugin/gpu_processor.h')
-rw-r--r--o3d/gpu_plugin/gpu_processor.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/o3d/gpu_plugin/gpu_processor.h b/o3d/gpu_plugin/gpu_processor.h
index 05865ce..31dc055 100644
--- a/o3d/gpu_plugin/gpu_processor.h
+++ b/o3d/gpu_plugin/gpu_processor.h
@@ -14,8 +14,12 @@
#include "o3d/gpu_plugin/command_buffer.h"
#include "o3d/gpu_plugin/np_utils/np_object_pointer.h"
-#if defined(OS_WIN)
+#if defined(CB_SERVICE_D3D9)
#include "o3d/command_buffer/service/win/d3d9/gapi_d3d9.h"
+#elif defined(CB_SERVICE_GL)
+#include "o3d/command_buffer/service/cross/gl/gapi_gl.h"
+#else
+#error command buffer service not defined
#endif
namespace o3d {
@@ -26,20 +30,26 @@ namespace gpu_plugin {
class GPUProcessor : public ::base::RefCounted<GPUProcessor>,
public command_buffer::CommandBufferEngine {
public:
+#if defined(CB_SERVICE_D3D9)
+ typedef command_buffer::GAPID3D9 GPUGAPIInterface;
+#elif defined(CB_SERVICE_GL)
+ typedef command_buffer::GAPIGL GPUGAPIInterface;
+#else
+#error command buffer service not defined
+#endif
+
GPUProcessor(NPP npp,
CommandBuffer* command_buffer);
-#if defined(OS_WIN)
// This constructor is for unit tests.
GPUProcessor(NPP npp,
CommandBuffer* command_buffer,
- command_buffer::GAPID3D9* gapi,
+ GPUGAPIInterface* gapi,
command_buffer::GAPIDecoder* decoder,
command_buffer::CommandParser* parser,
int commands_per_update);
virtual bool Initialize(HWND hwnd);
-#endif // OS_WIN
virtual ~GPUProcessor();
@@ -77,11 +87,9 @@ class GPUProcessor : public ::base::RefCounted<GPUProcessor>,
scoped_ptr< ::base::SharedMemory> mapped_ring_buffer_;
int commands_per_update_;
-#if defined(OS_WIN)
- scoped_ptr<command_buffer::GAPID3D9> gapi_;
+ scoped_ptr<GPUGAPIInterface> gapi_;
scoped_ptr<command_buffer::GAPIDecoder> decoder_;
scoped_ptr<command_buffer::CommandParser> parser_;
-#endif
};
} // namespace gpu_plugin