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

Unified Diff: ppapi/cpp/compositor_layer.cc

Issue 475123003: [PPAPI] Add target param for CompositorLayer::SetTexture(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: versioning Created 6 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
« no previous file with comments | « ppapi/cpp/compositor_layer.h ('k') | ppapi/examples/compositor/compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/compositor_layer.cc
diff --git a/ppapi/cpp/compositor_layer.cc b/ppapi/cpp/compositor_layer.cc
index cbe823a3ac017b269feae6b0d2de08368f007658..a72b37ec247384e9aa5bbca6e361f1715cd499cc 100644
--- a/ppapi/cpp/compositor_layer.cc
+++ b/ppapi/cpp/compositor_layer.cc
@@ -17,6 +17,10 @@ template <> const char* interface_name<PPB_CompositorLayer_0_1>() {
return PPB_COMPOSITORLAYER_INTERFACE_0_1;
}
+template <> const char* interface_name<PPB_CompositorLayer_0_2>() {
+ return PPB_COMPOSITORLAYER_INTERFACE_0_2;
+}
+
} // namespace
CompositorLayer::CompositorLayer() {
@@ -51,10 +55,18 @@ int32_t CompositorLayer::SetColor(float red,
}
int32_t CompositorLayer::SetTexture(const Graphics3D& context,
+ uint32_t target,
uint32_t texture,
const Size& size,
const CompletionCallback& cc) {
+ if (has_interface<PPB_CompositorLayer_0_2>()) {
+ return get_interface<PPB_CompositorLayer_0_2>()->SetTexture(
+ pp_resource(), context.pp_resource(), target, texture, &size.pp_size(),
+ cc.pp_completion_callback());
+ }
if (has_interface<PPB_CompositorLayer_0_1>()) {
+ if (target != 0x0DE1) // 0x0DE1 GL_TEXTURE_2D
+ return cc.MayForce(PP_ERROR_BADARGUMENT);
bbudge 2014/08/15 17:10:11 I think PP_ERROR_NOTSUPPORTED is more appropriate
Peng 2014/08/15 17:58:44 Done.
return get_interface<PPB_CompositorLayer_0_1>()->SetTexture(
pp_resource(), context.pp_resource(), texture, &size.pp_size(),
cc.pp_completion_callback());
« no previous file with comments | « ppapi/cpp/compositor_layer.h ('k') | ppapi/examples/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698