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

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

Issue 1881603002: Added SetLayerTransform to PPAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added Graphics2D 1.2 to histograms Created 4 years, 8 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
« no previous file with comments | « ppapi/thunk/ppb_graphics_2d_api.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // From ppb_graphics_2d.idl modified Wed Jan 27 17:10:16 2016. 5 // From ppb_graphics_2d.idl modified Fri Apr 15 15:37:20 2016.
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "ppapi/c/pp_completion_callback.h" 10 #include "ppapi/c/pp_completion_callback.h"
11 #include "ppapi/c/pp_errors.h" 11 #include "ppapi/c/pp_errors.h"
12 #include "ppapi/c/ppb_graphics_2d.h" 12 #include "ppapi/c/ppb_graphics_2d.h"
13 #include "ppapi/shared_impl/tracked_callback.h" 13 #include "ppapi/shared_impl/tracked_callback.h"
14 #include "ppapi/thunk/enter.h" 14 #include "ppapi/thunk/enter.h"
15 #include "ppapi/thunk/ppapi_thunk_export.h" 15 #include "ppapi/thunk/ppapi_thunk_export.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 float GetScale(PP_Resource resource) { 97 float GetScale(PP_Resource resource) {
98 VLOG(4) << "PPB_Graphics2D::GetScale()"; 98 VLOG(4) << "PPB_Graphics2D::GetScale()";
99 EnterResource<PPB_Graphics2D_API> enter(resource, true); 99 EnterResource<PPB_Graphics2D_API> enter(resource, true);
100 if (enter.failed()) 100 if (enter.failed())
101 return 0.0f; 101 return 0.0f;
102 return enter.object()->GetScale(); 102 return enter.object()->GetScale();
103 } 103 }
104 104
105 PP_Bool SetLayerTransform(PP_Resource resource,
106 float scale,
107 const struct PP_Point* origin,
108 const struct PP_Point* translate) {
109 VLOG(4) << "PPB_Graphics2D::SetLayerTransform()";
110 EnterResource<PPB_Graphics2D_API> enter(resource, true);
111 if (enter.failed())
112 return PP_FALSE;
113 return enter.object()->SetLayerTransform(scale, origin, translate);
114 }
115
105 const PPB_Graphics2D_1_0 g_ppb_graphics2d_thunk_1_0 = { 116 const PPB_Graphics2D_1_0 g_ppb_graphics2d_thunk_1_0 = {
106 &Create, &IsGraphics2D, &Describe, &PaintImageData, 117 &Create, &IsGraphics2D, &Describe, &PaintImageData,
107 &Scroll, &ReplaceContents, &Flush}; 118 &Scroll, &ReplaceContents, &Flush};
108 119
109 const PPB_Graphics2D_1_1 g_ppb_graphics2d_thunk_1_1 = { 120 const PPB_Graphics2D_1_1 g_ppb_graphics2d_thunk_1_1 = {
110 &Create, &IsGraphics2D, &Describe, &PaintImageData, &Scroll, 121 &Create, &IsGraphics2D, &Describe, &PaintImageData, &Scroll,
111 &ReplaceContents, &Flush, &SetScale, &GetScale}; 122 &ReplaceContents, &Flush, &SetScale, &GetScale};
112 123
124 const PPB_Graphics2D_1_2 g_ppb_graphics2d_thunk_1_2 = {
125 &Create, &IsGraphics2D, &Describe, &PaintImageData,
126 &Scroll, &ReplaceContents, &Flush, &SetScale,
127 &GetScale, &SetLayerTransform};
128
113 } // namespace 129 } // namespace
114 130
115 PPAPI_THUNK_EXPORT const PPB_Graphics2D_1_0* GetPPB_Graphics2D_1_0_Thunk() { 131 PPAPI_THUNK_EXPORT const PPB_Graphics2D_1_0* GetPPB_Graphics2D_1_0_Thunk() {
116 return &g_ppb_graphics2d_thunk_1_0; 132 return &g_ppb_graphics2d_thunk_1_0;
117 } 133 }
118 134
119 PPAPI_THUNK_EXPORT const PPB_Graphics2D_1_1* GetPPB_Graphics2D_1_1_Thunk() { 135 PPAPI_THUNK_EXPORT const PPB_Graphics2D_1_1* GetPPB_Graphics2D_1_1_Thunk() {
120 return &g_ppb_graphics2d_thunk_1_1; 136 return &g_ppb_graphics2d_thunk_1_1;
121 } 137 }
122 138
139 PPAPI_THUNK_EXPORT const PPB_Graphics2D_1_2* GetPPB_Graphics2D_1_2_Thunk() {
140 return &g_ppb_graphics2d_thunk_1_2;
141 }
142
123 } // namespace thunk 143 } // namespace thunk
124 } // namespace ppapi 144 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_graphics_2d_api.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698