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

Side by Side Diff: core/cross/class_manager.cc

Issue 2825074: Initial version rendering 2D path for O3D. This will eventually allow O3D app... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/o3d/
Patch Set: '' Created 10 years, 3 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 | « core/cross/cairo/texture_cairo.cc ('k') | core/cross/client.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 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #include "core/cross/sampler.h" 59 #include "core/cross/sampler.h"
60 #include "core/cross/shape.h" 60 #include "core/cross/shape.h"
61 #include "core/cross/skin.h" 61 #include "core/cross/skin.h"
62 #include "core/cross/standard_param.h" 62 #include "core/cross/standard_param.h"
63 #include "core/cross/state_set.h" 63 #include "core/cross/state_set.h"
64 #include "core/cross/stream.h" 64 #include "core/cross/stream.h"
65 #include "core/cross/stream_bank.h" 65 #include "core/cross/stream_bank.h"
66 #include "core/cross/transform.h" 66 #include "core/cross/transform.h"
67 #include "core/cross/tree_traversal.h" 67 #include "core/cross/tree_traversal.h"
68 #include "core/cross/viewport.h" 68 #include "core/cross/viewport.h"
69 #include "core/cross/cairo/image_2d.h"
69 70
70 namespace o3d { 71 namespace o3d {
71 72
72 ClassManager::ClassManager(ServiceLocator* service_locator) 73 ClassManager::ClassManager(ServiceLocator* service_locator)
73 : service_locator_(service_locator), 74 : service_locator_(service_locator),
74 service_(service_locator_, this) { 75 service_(service_locator_, this) {
75 // Params 76 // Params
76 AddTypedClass<ParamBoolean>(); 77 AddTypedClass<ParamBoolean>();
77 AddTypedClass<ParamBoundingBox>(); 78 AddTypedClass<ParamBoundingBox>();
78 AddTypedClass<ParamDrawContext>(); 79 AddTypedClass<ParamDrawContext>();
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 AddTypedClass<State>(); 172 AddTypedClass<State>();
172 AddTypedClass<StateSet>(); 173 AddTypedClass<StateSet>();
173 AddTypedClass<StreamBank>(); 174 AddTypedClass<StreamBank>();
174 AddTypedClass<Texture2D>(); 175 AddTypedClass<Texture2D>();
175 AddTypedClass<TextureCUBE>(); 176 AddTypedClass<TextureCUBE>();
176 AddTypedClass<TickCounter>(); 177 AddTypedClass<TickCounter>();
177 AddTypedClass<Transform>(); 178 AddTypedClass<Transform>();
178 AddTypedClass<TreeTraversal>(); 179 AddTypedClass<TreeTraversal>();
179 AddTypedClass<VertexBuffer>(); 180 AddTypedClass<VertexBuffer>();
180 AddTypedClass<Viewport>(); 181 AddTypedClass<Viewport>();
182
183 // Specific Objects for Cairo
184 #if defined(RENDERER_CAIRO)
185 AddTypedClass<Image2D>();
186 #endif
181 } 187 }
182 188
183 void ClassManager::AddClass(const ObjectBase::Class* object_class, 189 void ClassManager::AddClass(const ObjectBase::Class* object_class,
184 ObjectCreateFunc function) { 190 ObjectCreateFunc function) {
185 DLOG_ASSERT(object_class_info_name_map_.find(object_class->name()) == 191 DLOG_ASSERT(object_class_info_name_map_.find(object_class->name()) ==
186 object_class_info_name_map_.end()) 192 object_class_info_name_map_.end())
187 << "attempt to register duplicate class name"; 193 << "attempt to register duplicate class name";
188 object_class_info_name_map_.insert( 194 object_class_info_name_map_.insert(
189 std::make_pair(object_class->name(), 195 std::make_pair(object_class->name(),
190 ObjectClassInfo(object_class, function))); 196 ObjectClassInfo(object_class, function)));
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 std::vector<const ObjectBase::Class*> classes; 269 std::vector<const ObjectBase::Class*> classes;
264 for (ObjectClassInfoNameMap::const_iterator it = 270 for (ObjectClassInfoNameMap::const_iterator it =
265 object_class_info_name_map_.begin(); 271 object_class_info_name_map_.begin();
266 it != object_class_info_name_map_.end(); ++it) { 272 it != object_class_info_name_map_.end(); ++it) {
267 classes.push_back(it->second.class_type()); 273 classes.push_back(it->second.class_type());
268 } 274 }
269 return classes; 275 return classes;
270 } 276 }
271 277
272 } // namespace o3d 278 } // namespace o3d
OLDNEW
« no previous file with comments | « core/cross/cairo/texture_cairo.cc ('k') | core/cross/client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698