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

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

Issue 11275120: Virtual GL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.h ('k') | gpu/command_buffer/tests/gl_virtual_contexts_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fc2ab617d2ed68202aec4f35c497e988677edd70..e96050e93525abf5ef5266b29492f4eb04905e15 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -14,6 +14,7 @@
#include "gpu/command_buffer/common/constants.h"
#include "gpu/command_buffer/service/command_buffer_service.h"
#include "gpu/command_buffer/service/context_group.h"
+#include "gpu/command_buffer/service/gl_context_virtual.h"
#include "gpu/command_buffer/service/gpu_scheduler.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -30,7 +31,7 @@ GLManager::~GLManager() {
}
void GLManager::Initialize(const gfx::Size& size) {
- Setup(size, NULL, NULL, NULL, NULL);
+ Setup(size, NULL, NULL, NULL, NULL, NULL);
}
void GLManager::InitializeShared(
@@ -41,7 +42,8 @@ void GLManager::InitializeShared(
gl_manager->mailbox_manager(),
gl_manager->share_group(),
gl_manager->decoder_->GetContextGroup(),
- gl_manager->gles2_implementation()->share_group());
+ gl_manager->gles2_implementation()->share_group(),
+ NULL);
}
void GLManager::InitializeSharedMailbox(
@@ -52,15 +54,29 @@ void GLManager::InitializeSharedMailbox(
gl_manager->mailbox_manager(),
gl_manager->share_group(),
NULL,
+ NULL,
NULL);
}
+void GLManager::InitializeVirtual(
+ const gfx::Size& size, GLManager* real_gl_manager) {
+ DCHECK(real_gl_manager);
+ Setup(
+ size,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ real_gl_manager->context());
+}
+
void GLManager::Setup(
const gfx::Size& size,
gles2::MailboxManager* mailbox_manager,
gfx::GLShareGroup* share_group,
gles2::ContextGroup* context_group,
- gles2::ShareGroup* client_share_group) {
+ gles2::ShareGroup* client_share_group,
+ gfx::GLContext* real_gl_context) {
const int32 kCommandBufferSize = 1024 * 1024;
const size_t kStartTransferBufferSize = 4 * 1024 * 1024;
const size_t kMinTransferBufferSize = 1 * 256 * 1024;
@@ -119,9 +135,16 @@ void GLManager::Setup(
surface_ = gfx::GLSurface::CreateOffscreenGLSurface(false, size);
ASSERT_TRUE(surface_.get() != NULL) << "could not create offscreen surface";
- context_ = gfx::GLContext::CreateGLContext(share_group_.get(),
- surface_.get(),
- gpu_preference);
+ if (real_gl_context) {
+ context_ = scoped_refptr<gfx::GLContext>(new gpu::GLContextVirtual(
+ share_group_.get(), real_gl_context, decoder_.get()));
+ ASSERT_TRUE(context_->Initialize(
+ surface_.get(), gfx::PreferIntegratedGpu));
+ } else {
+ context_ = gfx::GLContext::CreateGLContext(share_group_.get(),
+ surface_.get(),
+ gpu_preference);
+ }
ASSERT_TRUE(context_.get() != NULL) << "could not create GL context";
ASSERT_TRUE(context_->MakeCurrent(surface_.get()));
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.h ('k') | gpu/command_buffer/tests/gl_virtual_contexts_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698