OLD | NEW |
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) { |
90 EnterGraphics2D enter(graphics_2d, true); | 90 EnterGraphics2D enter(graphics_2d, true); |
91 if (enter.failed()) | 91 if (enter.failed()) |
92 return 0.0f; | 92 return 0.0f; |
93 return enter.object()->GetScale(); | 93 return enter.object()->GetScale(); |
94 } | 94 } |
95 | 95 |
96 const PPB_Graphics2D g_ppb_graphics_2d_thunk = { | 96 const PPB_Graphics2D_1_0 g_ppb_graphics_2d_1_0_thunk = { |
97 &Create, | 97 &Create, |
98 &IsGraphics2D, | 98 &IsGraphics2D, |
99 &Describe, | 99 &Describe, |
100 &PaintImageData, | 100 &PaintImageData, |
101 &Scroll, | 101 &Scroll, |
102 &ReplaceContents, | 102 &ReplaceContents, |
103 &Flush | 103 &Flush |
104 }; | 104 }; |
105 | 105 |
| 106 const PPB_Graphics2D_1_1 g_ppb_graphics_2d_1_1_thunk = { |
| 107 &Create, |
| 108 &IsGraphics2D, |
| 109 &Describe, |
| 110 &PaintImageData, |
| 111 &Scroll, |
| 112 &ReplaceContents, |
| 113 &Flush, |
| 114 &SetScale, |
| 115 &GetScale |
| 116 }; |
| 117 |
106 const PPB_Graphics2D_Dev g_ppb_graphics_2d_dev_thunk = { | 118 const PPB_Graphics2D_Dev g_ppb_graphics_2d_dev_thunk = { |
107 &SetScale, | 119 &SetScale, |
108 &GetScale | 120 &GetScale |
109 }; | 121 }; |
110 | 122 |
111 } // namespace | 123 } // namespace |
112 | 124 |
113 const PPB_Graphics2D_1_0* GetPPB_Graphics2D_1_0_Thunk() { | 125 const PPB_Graphics2D_1_0* GetPPB_Graphics2D_1_0_Thunk() { |
114 return &g_ppb_graphics_2d_thunk; | 126 return &g_ppb_graphics_2d_1_0_thunk; |
| 127 } |
| 128 |
| 129 const PPB_Graphics2D_1_1* GetPPB_Graphics2D_1_1_Thunk() { |
| 130 return &g_ppb_graphics_2d_1_1_thunk; |
115 } | 131 } |
116 | 132 |
117 const PPB_Graphics2D_Dev_0_1* GetPPB_Graphics2D_Dev_0_1_Thunk() { | 133 const PPB_Graphics2D_Dev_0_1* GetPPB_Graphics2D_Dev_0_1_Thunk() { |
118 return &g_ppb_graphics_2d_dev_thunk; | 134 return &g_ppb_graphics_2d_dev_thunk; |
119 } | 135 } |
120 | 136 |
121 } // namespace thunk | 137 } // namespace thunk |
122 } // namespace ppapi | 138 } // namespace ppapi |
OLD | NEW |