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

Unified Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc

Issue 455783002: GPU context creation code duplication cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix even more build dependencies Created 6 years, 4 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: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
index 3bf0eebd8cb67bc4d34107d85d7155548a7b9dac..21ba2a6c198f70c38f5bbdda4b6f099dd7f1173e 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -185,24 +185,13 @@ bool WebGraphicsContext3DCommandBufferImpl::InitializeCommandBuffer(
share_group_command_buffer = share_context->command_buffer_.get();
}
+ ::gpu::gles2::ContextCreationAttribHelper attribs_for_gles2;
+ ConvertAttributes(attributes_, &attribs_for_gles2);
+ attribs_for_gles2.lose_context_when_out_of_memory =
+ lose_context_when_out_of_memory_;
+ DCHECK(attribs_for_gles2.buffer_preserved);
std::vector<int32> attribs;
- attribs.push_back(ALPHA_SIZE);
- attribs.push_back(attributes_.alpha ? 8 : 0);
- attribs.push_back(DEPTH_SIZE);
- attribs.push_back(attributes_.depth ? 24 : 0);
- attribs.push_back(STENCIL_SIZE);
- attribs.push_back(attributes_.stencil ? 8 : 0);
- attribs.push_back(SAMPLES);
- attribs.push_back(attributes_.antialias ? 4 : 0);
- attribs.push_back(SAMPLE_BUFFERS);
- attribs.push_back(attributes_.antialias ? 1 : 0);
- attribs.push_back(FAIL_IF_MAJOR_PERF_CAVEAT);
- attribs.push_back(attributes_.failIfMajorPerformanceCaveat ? 1 : 0);
- attribs.push_back(LOSE_CONTEXT_WHEN_OUT_OF_MEMORY);
- attribs.push_back(lose_context_when_out_of_memory_ ? 1 : 0);
- attribs.push_back(BIND_GENERATES_RESOURCES);
- attribs.push_back(0);
- attribs.push_back(NONE);
+ attribs_for_gles2.Serialize(&attribs);
// Create a proxy to a command buffer in the GPU process.
if (onscreen) {
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698