Pepper_47_C++_interfaces
compositor_layer_samsung.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Samsung Electronics, Visual Display Division.
3  * All Rights Reserved.
4  *
5  * @author Michal Jurkiewicz <m.jurkiewicz@samsung.com>
6  */
7 
9 
10 #include "ppapi/c/pp_errors.h"
11 #include "ppapi/cpp/module_impl.h"
12 
13 namespace pp {
14 
15 namespace {
16 
17 template <>
18 const char* interface_name<PPB_CompositorLayer_Samsung_0_1>() {
19  return PPB_COMPOSITORLAYER_SAMSUNG_INTERFACE_0_1;
20 }
21 
22 } // namespace
23 
25 
27  const CompositorLayerSamsung& other)
28  : CompositorLayer(other) {}
29 
31  : CompositorLayer(other) {}
32 
34  : CompositorLayer(resource) {
36 }
37 
39  : CompositorLayer(PASS_REF, resource) {}
40 
42 
44  if (has_interface<PPB_CompositorLayer_Samsung_0_1>()) {
45  return get_interface<PPB_CompositorLayer_Samsung_0_1>()->SetBackgroundPlane(
46  pp_resource(), &size.pp_size());
47  }
48  return PP_ERROR_NOINTERFACE;
49 }
50 
52  const Resource& resource) {
53  if (has_interface<PPB_CompositorLayer_Samsung_0_1>()) {
54  return PP_ToBool(get_interface<PPB_CompositorLayer_Samsung_0_1>()
56  }
57  return false;
58 }
59 
60 } // namespace pp
#define PP_DCHECK(a)
Definition: logging.h:16
const PP_Size & pp_size() const
Definition: size.h:64
static bool IsCompositorLayerSamsung(const Resource &resource)
A size of an object based on width and height.
Definition: size.h:18
PassRef
Definition: pass_ref.h:17
PP_Resource pp_resource() const
Definition: resource.h:47
int32_t SetBackgroundPlane(const Size &size)
A reference counted module resource.
Definition: resource.h:20