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()); |