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

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

Issue 23244002: gpu: Add Serialize function to ContextCreationAttribParser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix serialize of swap behavior and rename constants Created 7 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | 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 c4b84a2c9df0a763ac853afab08ecbf63c2824d2..54ff6459e7eb847ab0cfdad92d71ed06baa8a671 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -12,6 +12,7 @@
#include "gpu/command_buffer/client/gles2_lib.h"
#include "gpu/command_buffer/client/transfer_buffer.h"
#include "gpu/command_buffer/common/constants.h"
+#include "gpu/command_buffer/common/gles2_cmd_utils.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"
@@ -100,14 +101,6 @@ void GLManager::Initialize(const GLManager::Options& options) {
real_gl_context = options.virtual_manager->context();
}
- // From <EGL/egl.h>.
- const int32 EGL_ALPHA_SIZE = 0x3021;
- const int32 EGL_BLUE_SIZE = 0x3022;
- const int32 EGL_GREEN_SIZE = 0x3023;
- const int32 EGL_RED_SIZE = 0x3024;
- const int32 EGL_DEPTH_SIZE = 0x3025;
- const int32 EGL_NONE = 0x3038;
-
mailbox_manager_ =
mailbox_manager ? mailbox_manager : new gles2::MailboxManager;
share_group_ =
@@ -116,17 +109,13 @@ void GLManager::Initialize(const GLManager::Options& options) {
gfx::GpuPreference gpu_preference(gfx::PreferDiscreteGpu);
const char* allowed_extensions = "*";
std::vector<int32> attribs;
- attribs.push_back(EGL_RED_SIZE);
- attribs.push_back(8);
- attribs.push_back(EGL_GREEN_SIZE);
- attribs.push_back(8);
- attribs.push_back(EGL_BLUE_SIZE);
- attribs.push_back(8);
- attribs.push_back(EGL_ALPHA_SIZE);
- attribs.push_back(8);
- attribs.push_back(EGL_DEPTH_SIZE);
- attribs.push_back(16);
- attribs.push_back(EGL_NONE);
+ gles2::ContextCreationAttribHelper attrib_helper;
+ attrib_helper.red_size_ = 8;
+ attrib_helper.green_size_ = 8;
+ attrib_helper.blue_size_ = 8;
+ attrib_helper.alpha_size_ = 8;
+ attrib_helper.depth_size_ = 16;
+ attrib_helper.Serialize(&attribs);
if (!context_group) {
context_group = new gles2::ContextGroup(mailbox_manager_.get(),
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698