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

Unified Diff: content/renderer/pepper/ppb_graphics_3d_impl.cc

Issue 1781093002: Add CONTEXT_TYPE_OPENGLES2_PEPPER (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move kContextType to header Created 4 years, 9 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 | « content/renderer/BUILD.gn ('k') | gpu/command_buffer/common/gles2_cmd_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8dec9ae2e5b8308e48759ae46b16549ddcf35436 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"
@@ -259,6 +260,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 gpu::gles2::kContextType:
+ // kContextType is chromium internal, no caller should set this.
+ DCHECK(false);
piman 2016/03/16 23:55:04 The attrib list comes from an untrusted side (e.g.
+ break;
case PP_GRAPHICS3DATTRIB_WIDTH:
surface_size.set_width(attr[1]);
break;
@@ -280,9 +285,12 @@ bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context,
break;
}
}
- attribs.push_back(PP_GRAPHICS3DATTRIB_NONE);
}
+ attribs.push_back(gpu::gles2::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 =
« no previous file with comments | « content/renderer/BUILD.gn ('k') | gpu/command_buffer/common/gles2_cmd_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698