7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_graphics_2d.h"
21 template <>
const char* interface_name<PPB_Graphics2D_1_0>() {
22 return PPB_GRAPHICS_2D_INTERFACE_1_0;
25 template <>
const char* interface_name<PPB_Graphics2D_1_1>() {
26 return PPB_GRAPHICS_2D_INTERFACE_1_1;
41 bool is_always_opaque)
43 if (has_interface<PPB_Graphics2D_1_1>()) {
47 PP_FromBool(is_always_opaque)));
48 }
else if (has_interface<PPB_Graphics2D_1_0>()) {
52 PP_FromBool(is_always_opaque)));
72 const Point& top_left) {
73 if (has_interface<PPB_Graphics2D_1_1>()) {
78 }
else if (has_interface<PPB_Graphics2D_1_0>()) {
87 const Point& top_left,
88 const Rect& src_rect) {
89 if (has_interface<PPB_Graphics2D_1_1>()) {
94 }
else if (has_interface<PPB_Graphics2D_1_0>()) {
103 if (has_interface<PPB_Graphics2D_1_1>()) {
107 }
else if (has_interface<PPB_Graphics2D_1_0>()) {
115 if (has_interface<PPB_Graphics2D_1_1>()) {
118 }
else if (has_interface<PPB_Graphics2D_1_0>()) {
131 if (has_interface<PPB_Graphics2D_1_1>()) {
132 return get_interface<PPB_Graphics2D_1_1>()->
Flush(
134 }
else if (has_interface<PPB_Graphics2D_1_0>()) {
135 return get_interface<PPB_Graphics2D_1_0>()->
Flush(
138 return cc.
MayForce(PP_ERROR_NOINTERFACE);
143 if (!has_interface<PPB_Graphics2D_1_1>())
150 if (!has_interface<PPB_Graphics2D_1_1>())
void PassRefFromConstructor(PP_Resource resource)
const Size & size() const
const PP_Point & pp_point() const
const PP_Size & pp_size() const
A 2 dimensional point with 0,0 being the upper-left starting coordinate.
int32_t MayForce(int32_t result) const
const PP_CompletionCallback & pp_completion_callback() const
A size of an object based on width and height.
void ReplaceContents(ImageData *image)
PP_Resource pp_resource() const
bool SetScale(float scale)
void PaintImageData(const ImageData &image, const Point &top_left)
int32_t Flush(const CompletionCallback &cc)
PP_Instance pp_instance() const
A reference counted module resource.
void Scroll(const Rect &clip, const Point &amount)
const PP_Rect & pp_rect() const
Resource & operator=(const Resource &other)
Graphics2D & operator=(const Graphics2D &other)