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

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

Issue 16605006: Clean up Pepper ImageData resource class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add NOTREACHED if creating PlatformImageData in NaCl. Created 7 years, 6 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
« no previous file with comments | « ppapi/shared_impl/ppb_image_data_shared.h ('k') | ppapi/thunk/resource_creation_api.h » ('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_image_data.idl modified Thu Apr 25 14:42:27 2013. 5 // From ppb_image_data.idl modified Thu Apr 25 14:42:27 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"
(...skipping 22 matching lines...) Expand all
33 33
34 PP_Resource Create(PP_Instance instance, 34 PP_Resource Create(PP_Instance instance,
35 PP_ImageDataFormat format, 35 PP_ImageDataFormat format,
36 const struct PP_Size* size, 36 const struct PP_Size* size,
37 PP_Bool init_to_zero) { 37 PP_Bool init_to_zero) {
38 VLOG(4) << "PPB_ImageData::Create()"; 38 VLOG(4) << "PPB_ImageData::Create()";
39 EnterResourceCreation enter(instance); 39 EnterResourceCreation enter(instance);
40 if (enter.failed()) 40 if (enter.failed())
41 return 0; 41 return 0;
42 return enter.functions()->CreateImageData(instance, 42 return enter.functions()->CreateImageData(instance,
43 #if !defined(OS_NACL)
44 PPB_ImageData_Shared::PLATFORM,
45 #else
46 PPB_ImageData_Shared::SIMPLE,
47 #endif
43 format, 48 format,
44 size, 49 size,
45 init_to_zero); 50 init_to_zero);
46 } 51 }
47 52
48 PP_Bool IsImageData(PP_Resource image_data) { 53 PP_Bool IsImageData(PP_Resource image_data) {
49 VLOG(4) << "PPB_ImageData::IsImageData()"; 54 VLOG(4) << "PPB_ImageData::IsImageData()";
50 EnterResource<PPB_ImageData_API> enter(image_data, false); 55 EnterResource<PPB_ImageData_API> enter(image_data, false);
51 return PP_FromBool(enter.succeeded()); 56 return PP_FromBool(enter.succeeded());
52 } 57 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 }; 93 };
89 94
90 } // namespace 95 } // namespace
91 96
92 const PPB_ImageData_1_0* GetPPB_ImageData_1_0_Thunk() { 97 const PPB_ImageData_1_0* GetPPB_ImageData_1_0_Thunk() {
93 return &g_ppb_imagedata_thunk_1_0; 98 return &g_ppb_imagedata_thunk_1_0;
94 } 99 }
95 100
96 } // namespace thunk 101 } // namespace thunk
97 } // namespace ppapi 102 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/ppb_image_data_shared.h ('k') | ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698