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

Unified Diff: mojo/gles2/gles2_impl.cc

Issue 1346113003: Mandoline: WebGL: Pass context creation attributes to GPU. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 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
« no previous file with comments | « mojo/gles2/gles2_context.cc ('k') | third_party/mojo/src/mojo/public/c/gles2/gles2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/gles2/gles2_impl.cc
diff --git a/mojo/gles2/gles2_impl.cc b/mojo/gles2/gles2_impl.cc
index a645fe27ee2b79be34a81eef4e462453f909aa4f..1bb41e07837674a4ef4e0430f461b16a0f6aa2c2 100644
--- a/mojo/gles2/gles2_impl.cc
+++ b/mojo/gles2/gles2_impl.cc
@@ -14,6 +14,8 @@ using gles2::GLES2Context;
namespace {
+const int32_t kNone = 0x3038; // EGL_NONE
+
base::LazyInstance<base::ThreadLocalPointer<gpu::gles2::GLES2Interface> >::Leaky
g_gpu_interface;
@@ -26,13 +28,22 @@ void RunSignalSyncCallback(MojoGLES2SignalSyncPointCallback callback,
extern "C" {
MojoGLES2Context MojoGLES2CreateContext(MojoHandle handle,
+ const int32_t* attrib_list,
MojoGLES2ContextLost lost_callback,
void* closure,
const MojoAsyncWaiter* async_waiter) {
mojo::MessagePipeHandle mph(handle);
mojo::ScopedMessagePipeHandle scoped_handle(mph);
+ std::vector<int32_t> attribs;
+ if (attrib_list) {
+ for (int32_t const* p = attrib_list; *p != kNone;) {
+ attribs.push_back(*p++);
+ attribs.push_back(*p++);
+ }
+ }
+ attribs.push_back(kNone);
scoped_ptr<GLES2Context> client(new GLES2Context(
- async_waiter, scoped_handle.Pass(), lost_callback, closure));
+ attribs, async_waiter, scoped_handle.Pass(), lost_callback, closure));
if (!client->Initialize())
client.reset();
return client.release();
« no previous file with comments | « mojo/gles2/gles2_context.cc ('k') | third_party/mojo/src/mojo/public/c/gles2/gles2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698