Chromium Code Reviews| Index: content/renderer/pepper/ppb_graphics_3d_impl.cc |
| diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc |
| index c999fad4f0bc5da324bd0bdbbd7fe93edd4d3808..a4ac9aa06672e6e3fe075b87f1e7e3210f4f88f4 100644 |
| --- a/content/renderer/pepper/ppb_graphics_3d_impl.cc |
| +++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc |
| @@ -21,6 +21,7 @@ |
| #include "content/renderer/render_thread_impl.h" |
| #include "content/renderer/render_view_impl.h" |
| #include "gpu/command_buffer/client/gles2_interface.h" |
| +#include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| #include "ppapi/c/ppp_graphics_3d.h" |
| #include "ppapi/thunk/enter.h" |
| #include "third_party/WebKit/public/platform/WebString.h" |
| @@ -44,6 +45,9 @@ namespace { |
| const int32_t kCommandBufferSize = 1024 * 1024; |
| const int32_t kTransferBufferSize = 1024 * 1024; |
| +// Chromium specific attributes. |
| +const int32_t kContextType = 0x10003; |
|
no sievers
2016/03/16 00:46:58
Can you just move it from gles2_cmd_utils.cc to .h
ericrk
2016/03/16 16:53:20
Done.
|
| + |
| } // namespace |
| PPB_Graphics3D_Impl::PPB_Graphics3D_Impl(PP_Instance instance) |
| @@ -259,6 +263,10 @@ bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context, |
| for (const int32_t* attr = attrib_list; attr[0] != PP_GRAPHICS3DATTRIB_NONE; |
| attr += 2) { |
| switch (attr[0]) { |
| + case kContextType: |
| + // kContextType is chromium internal, no caller should set this. |
| + DCHECK(false); |
| + break; |
| case PP_GRAPHICS3DATTRIB_WIDTH: |
| surface_size.set_width(attr[1]); |
| break; |
| @@ -280,9 +288,12 @@ bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context, |
| break; |
| } |
| } |
| - attribs.push_back(PP_GRAPHICS3DATTRIB_NONE); |
| } |
| + attribs.push_back(kContextType); |
| + attribs.push_back(gpu::gles2::CONTEXT_TYPE_OPENGLES2_PEPPER); |
| + attribs.push_back(PP_GRAPHICS3DATTRIB_NONE); |
| + |
| CommandBufferProxyImpl* share_buffer = NULL; |
| if (share_context) { |
| PPB_Graphics3D_Impl* share_graphics = |