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

Side by Side Diff: ppapi/examples/2d/graphics_2d_example.c

Issue 10832359: Small bug in PPAPI graphics_2_example (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
« no previous file with comments | « no previous file | no next file » | 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 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include "ppapi/c/pp_completion_callback.h" 8 #include "ppapi/c/pp_completion_callback.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/pp_instance.h" 10 #include "ppapi/c/pp_instance.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 g_core_interface->ReleaseResource(graphics); 97 g_core_interface->ReleaseResource(graphics);
98 g_core_interface->ReleaseResource(image); 98 g_core_interface->ReleaseResource(image);
99 } 99 }
100 100
101 /** Returns the info for the given instance, or NULL if it's not found. */ 101 /** Returns the info for the given instance, or NULL if it's not found. */
102 struct InstanceInfo* FindInstance(PP_Instance instance) { 102 struct InstanceInfo* FindInstance(PP_Instance instance) {
103 struct InstanceInfo* cur = all_instances; 103 struct InstanceInfo* cur = all_instances;
104 while (cur) { 104 while (cur) {
105 if (cur->pp_instance == instance) 105 if (cur->pp_instance == instance)
106 return cur; 106 return cur;
107 cur = cur->next;
107 } 108 }
108 return NULL; 109 return NULL;
109 } 110 }
110 111
111 PP_Bool Instance_DidCreate(PP_Instance instance, 112 PP_Bool Instance_DidCreate(PP_Instance instance,
112 uint32_t argc, 113 uint32_t argc,
113 const char* argn[], 114 const char* argn[],
114 const char* argv[]) { 115 const char* argv[]) {
115 struct InstanceInfo* info = 116 struct InstanceInfo* info =
116 (struct InstanceInfo*)malloc(sizeof(struct InstanceInfo)); 117 (struct InstanceInfo*)malloc(sizeof(struct InstanceInfo));
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 201 }
201 202
202 PP_EXPORT void PPP_ShutdownModule() { 203 PP_EXPORT void PPP_ShutdownModule() {
203 } 204 }
204 205
205 PP_EXPORT const void* PPP_GetInterface(const char* interface_name) { 206 PP_EXPORT const void* PPP_GetInterface(const char* interface_name) {
206 if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0) 207 if (strcmp(interface_name, PPP_INSTANCE_INTERFACE) == 0)
207 return &instance_interface; 208 return &instance_interface;
208 return NULL; 209 return NULL;
209 } 210 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698