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

Side by Side Diff: core/cross/pack.h

Issue 150058: expose bitmap in js. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 5 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/class_manager.cc ('k') | core/cross/pack.cc » ('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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 Texture* CreateTextureFromFile(const String& uri, 208 Texture* CreateTextureFromFile(const String& uri,
209 const String& filename, 209 const String& filename,
210 Bitmap::ImageFileType file_type, 210 Bitmap::ImageFileType file_type,
211 bool generate_mipmaps); 211 bool generate_mipmaps);
212 212
213 // Creates a new Texture object given a "raw-data" object which must contain 213 // Creates a new Texture object given a "raw-data" object which must contain
214 // binary data in a known image file format (such as JPG or PNG) 214 // binary data in a known image file format (such as JPG or PNG)
215 Texture* CreateTextureFromRawData(RawData* raw_data, 215 Texture* CreateTextureFromRawData(RawData* raw_data,
216 bool generate_mips); 216 bool generate_mips);
217 217
218 // Creates a new Bitmap object of the specified size and format and
219 // reserves the necessary resources for it.
220 // Paramters:
221 // width: The width of the bitmap in pixel.
222 // height: The height of the bitmap in pixel.
223 // format: The format of the bitmap.
224 // Returns:
225 // A pointer to the bitmap obejct.
226
227 Bitmap* CreateBitmap(int width, int height, Texture::Format format);
228
229 // Creates a new Bitmap object from RawData.
230 // Parameters:
231 // raw_data: contains the bitmap data in one of the know formats.
232 // file_type: the format of the bitmap data. If UNKNOW, the file
233 // type would determined from the extension.
234 // Returns:
235 // A pointer to the bitmap object.
236 Bitmap* CreateBitmapFromRawData(RawData* raw_data);
237
218 // Creates a new Texture2D object of the specified size and format and 238 // Creates a new Texture2D object of the specified size and format and
219 // reserves the necessary resources for it. 239 // reserves the necessary resources for it.
220 // Parameters: 240 // Parameters:
221 // width: The width of the texture area in texels 241 // width: The width of the texture area in texels
222 // height: The height of the texture area in texels 242 // height: The height of the texture area in texels
223 // format: The memory format of each texel 243 // format: The memory format of each texel
224 // levels: The number of mipmap levels. Use zero to create the compelete 244 // levels: The number of mipmap levels. Use zero to create the compelete
225 // mipmap chain. 245 // mipmap chain.
226 // enable_render_surfaces: If true, the texture object will expose 246 // enable_render_surfaces: If true, the texture object will expose
227 // RenderSurface objects through 247 // RenderSurface objects through
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 class IdObjectComparator { 417 class IdObjectComparator {
398 public: 418 public:
399 // Performs a less than operation on the contents of the left and right 419 // Performs a less than operation on the contents of the left and right
400 // smart pointers. 420 // smart pointers.
401 bool operator()(const ObjectBase::Ref& lhs, const ObjectBase::Ref& rhs) 421 bool operator()(const ObjectBase::Ref& lhs, const ObjectBase::Ref& rhs)
402 const { 422 const {
403 return lhs->id() < rhs->id(); 423 return lhs->id() < rhs->id();
404 } 424 }
405 }; 425 };
406 426
407 // Helper method
408 Texture* CreateTextureFromBitmap(Bitmap *bitmap, const String& uri);
409
410 IClassManager* class_manager_; 427 IClassManager* class_manager_;
411 ObjectManager* object_manager_; 428 ObjectManager* object_manager_;
412 Renderer* renderer_; 429 Renderer* renderer_;
413 430
431 // helper function
432 Texture* CreateTextureFromBitmap(Bitmap *bitmap, const String& uri);
433
414 // The set of objects owned by the pack. This container contains all of the 434 // The set of objects owned by the pack. This container contains all of the
415 // references that force the lifespan of the contained objects to match 435 // references that force the lifespan of the contained objects to match
416 // or exceed that of the pack. 436 // or exceed that of the pack.
417 ObjectSet owned_objects_; 437 ObjectSet owned_objects_;
418 438
419 Transform::Ref root_; 439 Transform::Ref root_;
420 440
421 O3D_DECL_CLASS(Pack, NamedObject); 441 O3D_DECL_CLASS(Pack, NamedObject);
422 DISALLOW_COPY_AND_ASSIGN(Pack); 442 DISALLOW_COPY_AND_ASSIGN(Pack);
423 }; 443 };
424 444
425 // Array container for Pack pointers. 445 // Array container for Pack pointers.
426 typedef std::vector<Pack*> PackArray; 446 typedef std::vector<Pack*> PackArray;
427 447
428 } // namespace o3d 448 } // namespace o3d
429 449
430 #endif // O3D_CORE_CROSS_PACK_H_ 450 #endif // O3D_CORE_CROSS_PACK_H_
OLDNEW
« no previous file with comments | « core/cross/class_manager.cc ('k') | core/cross/pack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698