summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-01 15:33:51 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-01 15:33:51 +0000
commit0e50fc4dadb1575d3b7e1c05dd4b4b5d2085c3a9 (patch)
tree3b00d39360af3b75ec7e636e4fd99af1046cf78e /ppapi
parentb6dfb708fe0f7cc2f846a5d5db59a54473118282 (diff)
downloadchromium_src-0e50fc4dadb1575d3b7e1c05dd4b4b5d2085c3a9.zip
chromium_src-0e50fc4dadb1575d3b7e1c05dd4b4b5d2085c3a9.tar.gz
chromium_src-0e50fc4dadb1575d3b7e1c05dd4b4b5d2085c3a9.tar.bz2
Various fixes to Graphics3D proxy to make it work.
Review URL: http://codereview.chromium.org/7457027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94904 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/dispatcher.cc2
-rw-r--r--ppapi/proxy/ppb_graphics_3d_proxy.cc16
2 files changed, 12 insertions, 6 deletions
diff --git a/ppapi/proxy/dispatcher.cc b/ppapi/proxy/dispatcher.cc
index db01aa7..0edc24d 100644
--- a/ppapi/proxy/dispatcher.cc
+++ b/ppapi/proxy/dispatcher.cc
@@ -65,6 +65,7 @@
#include "ppapi/proxy/ppb_flash_tcp_socket_proxy.h"
#include "ppapi/proxy/ppb_font_proxy.h"
#include "ppapi/proxy/ppb_graphics_2d_proxy.h"
+#include "ppapi/proxy/ppb_graphics_3d_proxy.h"
#include "ppapi/proxy/ppb_image_data_proxy.h"
#include "ppapi/proxy/ppb_input_event_proxy.h"
#include "ppapi/proxy/ppb_instance_proxy.h"
@@ -137,6 +138,7 @@ InterfaceList::InterfaceList() {
AddPPB(PPB_Flash_TCPSocket_Proxy::GetInfo());
AddPPB(PPB_Font_Proxy::GetInfo());
AddPPB(PPB_Graphics2D_Proxy::GetInfo());
+ AddPPB(PPB_Graphics3D_Proxy::GetInfo());
AddPPB(PPB_ImageData_Proxy::GetInfo());
AddPPB(PPB_InputEvent_Proxy::GetInputEventInfo());
AddPPB(PPB_InputEvent_Proxy::GetKeyboardInputEventInfo());
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.cc b/ppapi/proxy/ppb_graphics_3d_proxy.cc
index 04f2088..480f06b 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.cc
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.cc
@@ -336,6 +336,8 @@ bool Graphics3D::Init() {
return false;
command_buffer_.reset(new CommandBuffer(host_resource(), dispatcher));
+ if (!command_buffer_->Initialize(kCommandBufferSize))
+ return false;
return CreateGLES2Impl(kCommandBufferSize, kTransferBufferSize);
}
@@ -395,7 +397,8 @@ int32 Graphics3D::DoSwapBuffers() {
PPB_Graphics3D_Proxy::PPB_Graphics3D_Proxy(Dispatcher* dispatcher,
const void* target_interface)
- : InterfaceProxy(dispatcher, target_interface) {
+ : InterfaceProxy(dispatcher, target_interface),
+ callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
}
PPB_Graphics3D_Proxy::~PPB_Graphics3D_Proxy() {
@@ -431,12 +434,13 @@ PP_Resource PPB_Graphics3D_Proxy::CreateProxyResource(
std::vector<int32_t> attribs;
if (attrib_list) {
for (const int32_t* attr = attrib_list;
- *attr != PP_GRAPHICS3DATTRIB_NONE;
- ++attr) {
- attribs.push_back(*attr);
+ attr[0] != PP_GRAPHICS3DATTRIB_NONE;
+ attr += 2) {
+ attribs.push_back(attr[0]);
+ attribs.push_back(attr[1]);
}
- attribs.push_back(PP_GRAPHICS3DATTRIB_NONE);
}
+ attribs.push_back(PP_GRAPHICS3DATTRIB_NONE);
HostResource result;
dispatcher->Send(new PpapiHostMsg_PPBGraphics3D_Create(
@@ -486,7 +490,7 @@ void PPB_Graphics3D_Proxy::OnMsgCreate(PP_Instance instance,
PP_Config3D_Dev config,
const std::vector<int32_t>& attribs,
HostResource* result) {
- if (attribs.empty() || attribs.back() != 0)
+ if (attribs.empty() || attribs.back() != PP_GRAPHICS3DATTRIB_NONE)
return; // Bad message.
EnterFunctionNoLock<ResourceCreationAPI> enter(instance, true);