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

Side by Side Diff: ppapi/thunk/ppb_graphics_2d_thunk.cc

Issue 10823378: Cache image data objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/c/dev/ppb_graphics_2d_dev.h" 5 #include "ppapi/c/dev/ppb_graphics_2d_dev.h"
6 #include "ppapi/c/pp_completion_callback.h" 6 #include "ppapi/c/pp_completion_callback.h"
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_graphics_2d.h" 8 #include "ppapi/c/ppb_graphics_2d.h"
9 #include "ppapi/shared_impl/tracked_callback.h" 9 #include "ppapi/shared_impl/tracked_callback.h"
10 #include "ppapi/thunk/enter.h" 10 #include "ppapi/thunk/enter.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 EnterGraphics2D enter(graphics_2d, true); 69 EnterGraphics2D enter(graphics_2d, true);
70 if (enter.failed()) 70 if (enter.failed())
71 return; 71 return;
72 enter.object()->ReplaceContents(image_data); 72 enter.object()->ReplaceContents(image_data);
73 } 73 }
74 74
75 int32_t Flush(PP_Resource graphics_2d, PP_CompletionCallback callback) { 75 int32_t Flush(PP_Resource graphics_2d, PP_CompletionCallback callback) {
76 EnterGraphics2D enter(graphics_2d, callback, true); 76 EnterGraphics2D enter(graphics_2d, callback, true);
77 if (enter.failed()) 77 if (enter.failed())
78 return enter.retval(); 78 return enter.retval();
79 return enter.SetResult(enter.object()->Flush(enter.callback())); 79 return enter.SetResult(enter.object()->Flush(enter.callback(), NULL));
80 } 80 }
81 81
82 PP_Bool SetScale(PP_Resource graphics_2d, float scale) { 82 PP_Bool SetScale(PP_Resource graphics_2d, float scale) {
83 EnterGraphics2D enter(graphics_2d, true); 83 EnterGraphics2D enter(graphics_2d, true);
84 if (enter.failed()) 84 if (enter.failed())
85 return PP_FALSE; 85 return PP_FALSE;
86 return PP_FromBool(enter.object()->SetScale(scale)); 86 return PP_FromBool(enter.object()->SetScale(scale));
87 } 87 }
88 88
89 float GetScale(PP_Resource graphics_2d) { 89 float GetScale(PP_Resource graphics_2d) {
(...skipping 23 matching lines...) Expand all
113 const PPB_Graphics2D_1_0* GetPPB_Graphics2D_1_0_Thunk() { 113 const PPB_Graphics2D_1_0* GetPPB_Graphics2D_1_0_Thunk() {
114 return &g_ppb_graphics_2d_thunk; 114 return &g_ppb_graphics_2d_thunk;
115 } 115 }
116 116
117 const PPB_Graphics2D_Dev_0_1* GetPPB_Graphics2D_Dev_0_1_Thunk() { 117 const PPB_Graphics2D_Dev_0_1* GetPPB_Graphics2D_Dev_0_1_Thunk() {
118 return &g_ppb_graphics_2d_dev_thunk; 118 return &g_ppb_graphics_2d_dev_thunk;
119 } 119 }
120 120
121 } // namespace thunk 121 } // namespace thunk
122 } // namespace ppapi 122 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698