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

Unified Diff: ppapi/proxy/ppb_graphics_3d_proxy.cc

Issue 2129803002: Revert of pepper: parse context creation attrib list on the plugin side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gpu_pref_size_in_attrs
Patch Set: Created 4 years, 5 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 | « ppapi/proxy/ppb_graphics_3d_proxy.h ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_graphics_3d_proxy.cc
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.cc b/ppapi/proxy/ppb_graphics_3d_proxy.cc
index 81df45b71ed82b2e2ba0c7fcce52dcb7cd08a2cf..0c21e377733751873561ff42642fd1df3a818fba 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.cc
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.cc
@@ -172,42 +172,24 @@
share_gles2 = share_graphics->gles2_impl();
}
- gpu::gles2::ContextCreationAttribHelper attrib_helper;
std::vector<int32_t> attribs;
if (attrib_list) {
- for (const int32_t* attr = attrib_list; attr[0] != PP_GRAPHICS3DATTRIB_NONE;
+ for (const int32_t* attr = attrib_list;
+ attr[0] != PP_GRAPHICS3DATTRIB_NONE;
attr += 2) {
- switch (attr[0]) {
- case PP_GRAPHICS3DATTRIB_WIDTH:
- attrib_helper.offscreen_framebuffer_size.set_width(attr[1]);
- break;
- case PP_GRAPHICS3DATTRIB_HEIGHT:
- attrib_helper.offscreen_framebuffer_size.set_height(attr[1]);
- break;
- case PP_GRAPHICS3DATTRIB_GPU_PREFERENCE:
- attrib_helper.gpu_preference =
- (attr[1] == PP_GRAPHICS3DATTRIB_GPU_PREFERENCE_LOW_POWER)
- ? gl::PreferIntegratedGpu
- : gl::PreferDiscreteGpu;
- break;
- default:
- attribs.push_back(attr[0]);
- attribs.push_back(attr[1]);
- break;
- }
+ attribs.push_back(attr[0]);
+ attribs.push_back(attr[1]);
}
- attribs.push_back(PP_GRAPHICS3DATTRIB_NONE);
- }
- if (!attrib_helper.Parse(attribs))
- return 0;
+ }
+ attribs.push_back(PP_GRAPHICS3DATTRIB_NONE);
HostResource result;
gpu::Capabilities capabilities;
ppapi::proxy::SerializedHandle shared_state;
gpu::CommandBufferId command_buffer_id;
- dispatcher->Send(new PpapiHostMsg_PPBGraphics3D_Create(
- API_ID_PPB_GRAPHICS_3D, instance, share_host, attrib_helper, &result,
- &capabilities, &shared_state, &command_buffer_id));
+ dispatcher->Send(new PpapiHostMsg_PPBGraphics3D_Create(API_ID_PPB_GRAPHICS_3D,
+ instance, share_host, attribs, &result, &capabilities, &shared_state,
+ &command_buffer_id));
if (result.is_null())
return 0;
@@ -258,12 +240,16 @@
void PPB_Graphics3D_Proxy::OnMsgCreate(
PP_Instance instance,
HostResource share_context,
- const gpu::gles2::ContextCreationAttribHelper& attrib_helper,
+ const std::vector<int32_t>& attribs,
HostResource* result,
gpu::Capabilities* capabilities,
SerializedHandle* shared_state,
gpu::CommandBufferId* command_buffer_id) {
shared_state->set_null_shmem();
+ if (attribs.empty() ||
+ attribs.back() != PP_GRAPHICS3DATTRIB_NONE ||
+ !(attribs.size() & 1))
+ return; // Bad message.
thunk::EnterResourceCreation enter(instance);
@@ -272,9 +258,13 @@
base::SharedMemoryHandle handle = base::SharedMemory::NULLHandle();
result->SetHostResource(
- instance, enter.functions()->CreateGraphics3DRaw(
- instance, share_context.host_resource(), attrib_helper,
- capabilities, &handle, command_buffer_id));
+ instance,
+ enter.functions()->CreateGraphics3DRaw(instance,
+ share_context.host_resource(),
+ &attribs.front(),
+ capabilities,
+ &handle,
+ command_buffer_id));
if (!result->is_null()) {
shared_state->set_shmem(TransportSHMHandle(dispatcher(), handle),
sizeof(gpu::CommandBuffer::State));
« no previous file with comments | « ppapi/proxy/ppb_graphics_3d_proxy.h ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698