Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: gpu/command_buffer/tests/gl_manager.cc

Issue 235563002: gpu: Separate GpuControlService from GpuControl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove MailboxManager Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/tests/gl_manager.cc
diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc
index 2471451a0e2d55ca12af9d6ca87fc2399b0aff56..eeb330790ef3151df48d0065263680e65720b46f 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/gles2_lib.h"
+#include "gpu/command_buffer/client/gpu_memory_buffer_factory.h"
#include "gpu/command_buffer/client/transfer_buffer.h"
#include "gpu/command_buffer/common/constants.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
@@ -44,7 +45,7 @@ GLManager::Options::Options()
image_manager(NULL) {}
GLManager::GLManager()
- : context_lost_allowed_(false) {
+ : context_lost_allowed_(false), gpu_memory_buffer_factory_(NULL) {
SetupBaseContext();
}
@@ -171,12 +172,10 @@ void GLManager::Initialize(const GLManager::Options& options) {
::gpu::gles2::DisallowedFeatures(),
attribs)) << "could not initialize decoder";
- gpu_control_.reset(
+ gpu_control_service_.reset(
new GpuControlService(decoder_->GetContextGroup()->image_manager(),
- options.gpu_memory_buffer_factory,
- decoder_->GetContextGroup()->mailbox_manager(),
- decoder_->GetQueryManager(),
- decoder_->GetCapabilities()));
+ decoder_->GetQueryManager()));
+ gpu_memory_buffer_factory_ = options.gpu_memory_buffer_factory;
command_buffer_->SetPutOffsetChangeCallback(
base::Bind(&GLManager::PumpCommands, base::Unretained(this)));
@@ -197,7 +196,7 @@ void GLManager::Initialize(const GLManager::Options& options) {
transfer_buffer_.get(),
options.bind_generates_resource,
options.lose_context_when_out_of_memory,
- gpu_control_.get()));
+ this));
ASSERT_TRUE(gles2_implementation_->Initialize(
kStartTransferBufferSize,
@@ -269,4 +268,65 @@ bool GLManager::GetBufferChanged(int32 transfer_buffer_id) {
return gpu_scheduler_->SetGetBuffer(transfer_buffer_id);
}
+Capabilities GLManager::GetCapabilities() {
+ return decoder_->GetCapabilities();
+}
+
+gfx::GpuMemoryBuffer* GLManager::CreateGpuMemoryBuffer(
+ size_t width,
+ size_t height,
+ unsigned internalformat,
+ int32* id) {
+ *id = -1;
+ scoped_ptr<gfx::GpuMemoryBuffer> buffer(
+ gpu_memory_buffer_factory_->CreateGpuMemoryBuffer(
+ width, height, internalformat));
+ if (!buffer.get())
+ return NULL;
+
+ static int32 next_id = 1;
+ *id = next_id++;
+ gpu_control_service_->RegisterGpuMemoryBuffer(
+ *id, buffer->GetHandle(), width, height, internalformat);
+ gfx::GpuMemoryBuffer* raw_buffer = buffer.get();
+ memory_buffers_.add(*id, buffer.Pass());
+ return raw_buffer;
+}
+
+void GLManager::DestroyGpuMemoryBuffer(int32 id) {
+ memory_buffers_.erase(id);
+ gpu_control_service_->UnregisterGpuMemoryBuffer(id);
+}
+
+uint32 GLManager::InsertSyncPoint() {
+ NOTIMPLEMENTED();
+ return 0u;
+}
+
+void GLManager::SignalSyncPoint(uint32 sync_point,
+ const base::Closure& callback) {
+ NOTIMPLEMENTED();
+}
+
+void GLManager::SignalQuery(uint32 query, const base::Closure& callback) {
+ NOTIMPLEMENTED();
+}
+
+void GLManager::SetSurfaceVisible(bool visible) {
+ NOTIMPLEMENTED();
+}
+
+void GLManager::SendManagedMemoryStats(const ManagedMemoryStats& stats) {
+ NOTIMPLEMENTED();
+}
+
+void GLManager::Echo(const base::Closure& callback) {
+ NOTIMPLEMENTED();
+}
+
+uint32 GLManager::CreateStreamTexture(uint32 texture_id) {
+ NOTIMPLEMENTED();
+ return 0;
+}
+
} // namespace gpu

Powered by Google App Engine
This is Rietveld 408576698