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

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

Issue 238923007: PPAPI: Format ppapi/thunk using clang-format. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 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 | 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 // From ppb_image_data.idl modified Tue Aug 20 08:13:36 2013. 5 // From ppb_image_data.idl modified Tue May 7 14:43:00 2013.
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/ppb_image_data.h" 10 #include "ppapi/c/ppb_image_data.h"
11 #include "ppapi/shared_impl/ppb_image_data_shared.h" 11 #include "ppapi/shared_impl/ppb_image_data_shared.h"
12 #include "ppapi/shared_impl/tracked_callback.h" 12 #include "ppapi/shared_impl/tracked_callback.h"
13 #include "ppapi/thunk/enter.h" 13 #include "ppapi/thunk/enter.h"
14 #include "ppapi/thunk/ppapi_thunk_export.h" 14 #include "ppapi/thunk/ppapi_thunk_export.h"
15 #include "ppapi/thunk/ppb_image_data_api.h" 15 #include "ppapi/thunk/ppb_image_data_api.h"
(...skipping 14 matching lines...) Expand all
30 } 30 }
31 31
32 PP_Resource Create(PP_Instance instance, 32 PP_Resource Create(PP_Instance instance,
33 PP_ImageDataFormat format, 33 PP_ImageDataFormat format,
34 const struct PP_Size* size, 34 const struct PP_Size* size,
35 PP_Bool init_to_zero) { 35 PP_Bool init_to_zero) {
36 VLOG(4) << "PPB_ImageData::Create()"; 36 VLOG(4) << "PPB_ImageData::Create()";
37 EnterResourceCreation enter(instance); 37 EnterResourceCreation enter(instance);
38 if (enter.failed()) 38 if (enter.failed())
39 return 0; 39 return 0;
40 return enter.functions()->CreateImageData(instance, 40 return enter.functions()->CreateImageData(
41 format, 41 instance, format, size, init_to_zero);
42 size,
43 init_to_zero);
44 } 42 }
45 43
46 PP_Bool IsImageData(PP_Resource image_data) { 44 PP_Bool IsImageData(PP_Resource image_data) {
47 VLOG(4) << "PPB_ImageData::IsImageData()"; 45 VLOG(4) << "PPB_ImageData::IsImageData()";
48 EnterResource<PPB_ImageData_API> enter(image_data, false); 46 EnterResource<PPB_ImageData_API> enter(image_data, false);
49 return PP_FromBool(enter.succeeded()); 47 return PP_FromBool(enter.succeeded());
50 } 48 }
51 49
52 PP_Bool Describe(PP_Resource image_data, struct PP_ImageDataDesc* desc) { 50 PP_Bool Describe(PP_Resource image_data, struct PP_ImageDataDesc* desc) {
53 VLOG(4) << "PPB_ImageData::Describe()"; 51 VLOG(4) << "PPB_ImageData::Describe()";
(...skipping 14 matching lines...) Expand all
68 } 66 }
69 67
70 void Unmap(PP_Resource image_data) { 68 void Unmap(PP_Resource image_data) {
71 VLOG(4) << "PPB_ImageData::Unmap()"; 69 VLOG(4) << "PPB_ImageData::Unmap()";
72 EnterResource<PPB_ImageData_API> enter(image_data, true); 70 EnterResource<PPB_ImageData_API> enter(image_data, true);
73 if (enter.failed()) 71 if (enter.failed())
74 return; 72 return;
75 enter.object()->Unmap(); 73 enter.object()->Unmap();
76 } 74 }
77 75
78 const PPB_ImageData_1_0 g_ppb_imagedata_thunk_1_0 = { 76 const PPB_ImageData_1_0 g_ppb_imagedata_thunk_1_0 = { //
79 &GetNativeImageDataFormat, 77 &GetNativeImageDataFormat, //
80 &IsImageDataFormatSupported, 78 &IsImageDataFormatSupported, //
81 &Create, 79 &Create, //
82 &IsImageData, 80 &IsImageData, //
83 &Describe, 81 &Describe, //
84 &Map, 82 &Map, //
85 &Unmap 83 &Unmap //
86 }; 84 };
87 85
88 } // namespace 86 } // namespace
89 87
90 PPAPI_THUNK_EXPORT const PPB_ImageData_1_0* GetPPB_ImageData_1_0_Thunk() { 88 PPAPI_THUNK_EXPORT const PPB_ImageData_1_0* GetPPB_ImageData_1_0_Thunk() {
91 return &g_ppb_imagedata_thunk_1_0; 89 return &g_ppb_imagedata_thunk_1_0;
92 } 90 }
93 91
94 } // namespace thunk 92 } // namespace thunk
95 } // namespace ppapi 93 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698