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

Unified Diff: components/mus/gles2/command_buffer_driver.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/mus/gles2/command_buffer_driver.h ('k') | components/mus/gles2/command_buffer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/gles2/command_buffer_driver.cc
diff --git a/components/mus/gles2/command_buffer_driver.cc b/components/mus/gles2/command_buffer_driver.cc
index 350f5121f522cf6229227fd7a9e5538d880e6093..b7803bd499a57460a9cc8c75393f326473303269 100644
--- a/components/mus/gles2/command_buffer_driver.cc
+++ b/components/mus/gles2/command_buffer_driver.cc
@@ -46,10 +46,11 @@ CommandBufferDriver::~CommandBufferDriver() {
void CommandBufferDriver::Initialize(
mojo::CommandBufferSyncClientPtr sync_client,
mojo::CommandBufferLostContextObserverPtr loss_observer,
- mojo::ScopedSharedBufferHandle shared_state) {
+ mojo::ScopedSharedBufferHandle shared_state,
+ mojo::Array<int32_t> attribs) {
sync_client_ = sync_client.Pass();
loss_observer_ = loss_observer.Pass();
- bool success = DoInitialize(shared_state.Pass());
+ bool success = DoInitialize(shared_state.Pass(), attribs.Pass());
mojo::GpuCapabilitiesPtr capabilities =
success ? mojo::GpuCapabilities::From(decoder_->GetCapabilities())
: nullptr;
@@ -72,7 +73,12 @@ bool CommandBufferDriver::MakeCurrent() {
}
bool CommandBufferDriver::DoInitialize(
- mojo::ScopedSharedBufferHandle shared_state) {
+ mojo::ScopedSharedBufferHandle shared_state,
+ mojo::Array<int32_t> attribs) {
+ gpu::gles2::ContextCreationAttribHelper attrib_helper;
+ if (!attrib_helper.Parse(attribs.storage()))
+ return false;
+
surface_ = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1));
if (!surface_.get())
@@ -89,7 +95,7 @@ bool CommandBufferDriver::DoInitialize(
// TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but
// only needs to be per-thread.
- bool bind_generates_resource = false;
+ const bool bind_generates_resource = attrib_helper.bind_generates_resource;
scoped_refptr<gpu::gles2::ContextGroup> context_group =
new gpu::gles2::ContextGroup(
gpu_state_->mailbox_manager(), new GpuMemoryTracker,
@@ -113,9 +119,9 @@ bool CommandBufferDriver::DoInitialize(
gpu::gles2::DisallowedFeatures disallowed_features;
- // TODO(piman): attributes.
const bool offscreen = true;
std::vector<int32> attrib_vector;
+ attrib_helper.Serialize(&attrib_vector);
if (!decoder_->Initialize(surface_, context_, offscreen, gfx::Size(1, 1),
disallowed_features, attrib_vector))
return false;
« no previous file with comments | « components/mus/gles2/command_buffer_driver.h ('k') | components/mus/gles2/command_buffer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698