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

Unified Diff: ppapi/proxy/ppb_video_decoder_proxy.cc

Issue 7765011: Allow both Context3D and Graphics3D with the video decoder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
Index: ppapi/proxy/ppb_video_decoder_proxy.cc
diff --git a/ppapi/proxy/ppb_video_decoder_proxy.cc b/ppapi/proxy/ppb_video_decoder_proxy.cc
index 196d402e7f7a860e179a9e3966146cc8e2f15047..1cf1a9cbe93b859f7767b1dc30c4ac4028eda107 100644
--- a/ppapi/proxy/ppb_video_decoder_proxy.cc
+++ b/ppapi/proxy/ppb_video_decoder_proxy.cc
@@ -11,6 +11,7 @@
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/ppb_buffer_proxy.h"
#include "ppapi/proxy/ppb_context_3d_proxy.h"
+#include "ppapi/proxy/ppb_graphics_3d_proxy.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/resource_creation_api.h"
#include "ppapi/thunk/thunk.h"
@@ -18,6 +19,7 @@
using ppapi::thunk::EnterResourceNoLock;
using ppapi::thunk::PPB_Buffer_API;
using ppapi::thunk::PPB_Context3D_API;
+using ppapi::thunk::PPB_Graphics3D_API;
using ppapi::thunk::PPB_VideoDecoder_API;
namespace ppapi {
@@ -218,12 +220,22 @@ PP_Resource PPB_VideoDecoder_Proxy::CreateProxyResource(
if (!VideoDecoderImpl::CopyConfigsToVector(config, &copied))
return 0;
- EnterResourceNoLock<PPB_Context3D_API> enter_context(context3d_id, true);
- if (enter_context.failed())
- return 0;
- Context3D* ppb_context =
- static_cast<Context3D*>(enter_context.object());
- HostResource host_context = ppb_context->host_resource();
+ HostResource host_context;
+ gpu::gles2::GLES2Implementation* gles2_impl = NULL;
+
+ EnterResourceNoLock<PPB_Context3D_API> enter_context(context3d_id, false);
+ if (enter_context.succeeded()) {
+ Context3D* context = static_cast<Context3D*>(enter_context.object());
+ host_context = context->host_resource();
+ gles2_impl = context->gles2_impl();
+ } else {
+ EnterResourceNoLock<PPB_Graphics3D_API> enter_context(context3d_id, true);
vrk (LEFT CHROMIUM) 2011/08/29 16:56:41 nit: "context3d_id" is a bit of a misleading name
piman 2011/08/29 19:58:57 I renamed to graphics_context. I really want to na
+ if (enter_context.failed())
+ return 0;
+ Graphics3D* context = static_cast<Graphics3D*>(enter_context.object());
+ host_context = context->host_resource();
+ gles2_impl = context->gles2_impl();
+ }
HostResource result;
dispatcher->Send(new PpapiHostMsg_PPBVideoDecoder_Create(
@@ -234,8 +246,7 @@ PP_Resource PPB_VideoDecoder_Proxy::CreateProxyResource(
// Need a scoped_refptr to keep the object alive during the Init call.
scoped_refptr<VideoDecoder> decoder(new VideoDecoder(result));
- if (!decoder->Init(context3d_id, enter_context.object(), config))
- return 0;
+ decoder->InitCommon(context3d_id, gles2_impl);
return decoder->GetReference();
}

Powered by Google App Engine
This is Rietveld 408576698