| Index: ppapi/thunk/ppb_graphics_2d_thunk.cc
|
| diff --git a/ppapi/thunk/ppb_graphics_2d_thunk.cc b/ppapi/thunk/ppb_graphics_2d_thunk.cc
|
| index e42d0021027b6e182fec9454f8c161733a0efcca..edb7ea97846b22d0080ac1c4811f3035d5d21373 100644
|
| --- a/ppapi/thunk/ppb_graphics_2d_thunk.cc
|
| +++ b/ppapi/thunk/ppb_graphics_2d_thunk.cc
|
| @@ -16,24 +16,26 @@ namespace thunk {
|
|
|
| namespace {
|
|
|
| +typedef EnterResource<PPB_Graphics2D_API> EnterGraphics2D;
|
| +
|
| PP_Resource Create(PP_Instance instance,
|
| const PP_Size* size,
|
| PP_Bool is_always_opaque) {
|
| - EnterFunction<ResourceCreationAPI> enter(instance, true);
|
| + EnterResourceCreation enter(instance);
|
| if (enter.failed())
|
| return 0;
|
| return enter.functions()->CreateGraphics2D(instance, *size, is_always_opaque);
|
| }
|
|
|
| PP_Bool IsGraphics2D(PP_Resource resource) {
|
| - EnterResource<PPB_Graphics2D_API> enter(resource, false);
|
| + EnterGraphics2D enter(resource, false);
|
| return enter.succeeded() ? PP_TRUE : PP_FALSE;
|
| }
|
|
|
| PP_Bool Describe(PP_Resource graphics_2d,
|
| PP_Size* size,
|
| PP_Bool* is_always_opaque) {
|
| - EnterResource<PPB_Graphics2D_API> enter(graphics_2d, true);
|
| + EnterGraphics2D enter(graphics_2d, true);
|
| if (enter.failed()) {
|
| size->width = 0;
|
| size->height = 0;
|
| @@ -47,7 +49,7 @@ void PaintImageData(PP_Resource graphics_2d,
|
| PP_Resource image_data,
|
| const PP_Point* top_left,
|
| const PP_Rect* src_rect) {
|
| - EnterResource<PPB_Graphics2D_API> enter(graphics_2d, true);
|
| + EnterGraphics2D enter(graphics_2d, true);
|
| if (enter.failed())
|
| return;
|
| enter.object()->PaintImageData(image_data, top_left, src_rect);
|
| @@ -56,14 +58,14 @@ void PaintImageData(PP_Resource graphics_2d,
|
| void Scroll(PP_Resource graphics_2d,
|
| const PP_Rect* clip_rect,
|
| const PP_Point* amount) {
|
| - EnterResource<PPB_Graphics2D_API> enter(graphics_2d, true);
|
| + EnterGraphics2D enter(graphics_2d, true);
|
| if (enter.failed())
|
| return;
|
| enter.object()->Scroll(clip_rect, amount);
|
| }
|
|
|
| void ReplaceContents(PP_Resource graphics_2d, PP_Resource image_data) {
|
| - EnterResource<PPB_Graphics2D_API> enter(graphics_2d, true);
|
| + EnterGraphics2D enter(graphics_2d, true);
|
| if (enter.failed())
|
| return;
|
| enter.object()->ReplaceContents(image_data);
|
| @@ -71,11 +73,10 @@ void ReplaceContents(PP_Resource graphics_2d, PP_Resource image_data) {
|
|
|
| int32_t Flush(PP_Resource graphics_2d,
|
| PP_CompletionCallback callback) {
|
| - EnterResource<PPB_Graphics2D_API> enter(graphics_2d, true);
|
| + EnterGraphics2D enter(graphics_2d, callback, true);
|
| if (enter.failed())
|
| - return MayForceCallback(callback, PP_ERROR_BADRESOURCE);
|
| - int32_t result = enter.object()->Flush(callback);
|
| - return MayForceCallback(callback, result);
|
| + return enter.retval();
|
| + return enter.SetResult(enter.object()->Flush(callback));
|
| }
|
|
|
| const PPB_Graphics2D g_ppb_graphics_2d_thunk = {
|
|
|