summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/command_buffer_service.cc
diff options
context:
space:
mode:
authorapatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-12 00:11:25 +0000
committerapatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-12 00:11:25 +0000
commita7a27ace0760f1ed19016822a45c6ec5300e861c (patch)
treeb7641f10c9fb3130c0ae8f50e7223db2ae722cda /gpu/command_buffer/service/command_buffer_service.cc
parent82017272e7272182443d7054911c4f890346353e (diff)
downloadchromium_src-a7a27ace0760f1ed19016822a45c6ec5300e861c.zip
chromium_src-a7a27ace0760f1ed19016822a45c6ec5300e861c.tar.gz
chromium_src-a7a27ace0760f1ed19016822a45c6ec5300e861c.tar.bz2
Added CommandBufferProxy, CommandBufferStub. Replaced NPAPI with IPC for synchronous messages. WebPluginDelegateImpl can instantiate a command buffer. Removed remaining dependencies on NPAPI.
TEST=none BUG=none Review URL: http://codereview.chromium.org/465040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34397 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/command_buffer_service.cc')
-rw-r--r--gpu/command_buffer/service/command_buffer_service.cc23
1 files changed, 13 insertions, 10 deletions
diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc
index 94d2148..e2dffec 100644
--- a/gpu/command_buffer/service/command_buffer_service.cc
+++ b/gpu/command_buffer/service/command_buffer_service.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,7 +8,7 @@
using ::base::SharedMemory;
-namespace command_buffer {
+namespace gpu {
CommandBufferService::CommandBufferService()
: size_(0),
@@ -24,18 +24,21 @@ CommandBufferService::CommandBufferService()
CommandBufferService::~CommandBufferService() {
}
-bool CommandBufferService::Initialize(::base::SharedMemory* ring_buffer) {
- DCHECK(ring_buffer);
-
+base::SharedMemory* CommandBufferService::Initialize(int32 size) {
// Fail if already initialized.
if (ring_buffer_.get())
return false;
- size_t size_in_bytes = ring_buffer->max_size();
- size_ = size_in_bytes / sizeof(int32);
- ring_buffer_.reset(ring_buffer);
+ size_ = size;
+
+ ring_buffer_.reset(new SharedMemory);
+ if (ring_buffer_->Create(std::wstring(), false, false, size_)) {
+ if (ring_buffer_->Map(size_))
+ return ring_buffer_.get();
+ }
- return true;
+ ring_buffer_.reset();
+ return NULL;
}
SharedMemory* CommandBufferService::GetRingBuffer() {
@@ -158,4 +161,4 @@ void CommandBufferService::RaiseErrorStatus() {
error_status_ = true;
}
-} // namespace command_buffer
+} // namespace gpu