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

Unified Diff: components/html_viewer/web_graphics_context_3d_command_buffer_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 | « components/html_viewer/DEPS ('k') | components/mus/gles2/command_buffer_driver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/web_graphics_context_3d_command_buffer_impl.cc
diff --git a/components/html_viewer/web_graphics_context_3d_command_buffer_impl.cc b/components/html_viewer/web_graphics_context_3d_command_buffer_impl.cc
index 70ffcdf0e4762c4792bd80203acbf27ddf27f38c..eeddf3ab04ad3b3cdc9b2a8b915991fca529281c 100644
--- a/components/html_viewer/web_graphics_context_3d_command_buffer_impl.cc
+++ b/components/html_viewer/web_graphics_context_3d_command_buffer_impl.cc
@@ -5,6 +5,7 @@
#include "components/html_viewer/web_graphics_context_3d_command_buffer_impl.h"
#include "components/mus/public/interfaces/gpu.mojom.h"
+#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "mojo/application/public/cpp/application_impl.h"
#include "mojo/cc/context_provider_mojo.h"
#include "mojo/gles2/gles2_context.h"
@@ -29,9 +30,22 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl(
command_buffer_handle_ = cb.PassInterface().PassHandle();
CHECK(command_buffer_handle_.is_valid());
// TODO(penghuang): Support share context.
- // TODO(penghuang): Fill gl_info and pass attribuites to GPU.
+ // TODO(penghuang): Fill gl_info.
+ gpu::gles2::ContextCreationAttribHelper attrib_helper;
+ attrib_helper.alpha_size = attributes.alpha ? 8 : 0;
+ attrib_helper.depth_size = attributes.depth ? 24 : 0;
+ attrib_helper.stencil_size = attributes.stencil ? 8 : 0;
+ attrib_helper.samples = attributes.antialias ? 4 : 0;
+ attrib_helper.sample_buffers = attributes.antialias ? 1 : 0;
+ attrib_helper.fail_if_major_perf_caveat =
+ attributes.failIfMajorPerformanceCaveat;
+ attrib_helper.bind_generates_resource = false;
+ attrib_helper.webgl_version = attributes.webGLVersion;
+ std::vector<int32_t> attrib_vector;
+ attrib_helper.Serialize(&attrib_vector);
gles2_context_ = MojoGLES2CreateContext(
command_buffer_handle_.release().value(),
+ attrib_vector.data(),
&ContextLostThunk,
this,
mojo::Environment::GetDefaultAsyncWaiter());
« no previous file with comments | « components/html_viewer/DEPS ('k') | components/mus/gles2/command_buffer_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698