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

Unified Diff: core/cross/texture.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/cross/renderer_test.cc ('k') | core/cross/texture.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/cross/texture.h
===================================================================
--- core/cross/texture.h (revision 20557)
+++ core/cross/texture.h (working copy)
@@ -41,6 +41,7 @@
namespace o3d {
class Pack;
+class Bitmap;
// An abstract class for 2D textures that defines the interface for getting
// the dimensions of the texture and number of mipmap levels.
@@ -96,6 +97,24 @@
// Reference to the RenderSurface object.
virtual RenderSurface::Ref GetRenderSurface(int mip_level, Pack* pack) = 0;
+ // Copy pixels from source bitmap to certain mip level.
+ // Scales if the width and height of source and dest do not match.
+ // Parameters:
+ // source_img: source bitmap which would be drawn.
+ // source_x: x-coordinate of the starting pixel in the source image.
+ // source_y: y-coordinate of the starting pixel in the source image.
+ // source_width: width of the source image to draw.
+ // source_height: Height of the source image to draw.
+ // dest_x: x-coordinate of the starting pixel in the dest image.
+ // dest_y: y-coordinate of the starting pixel in the dest image.
+ // dest_width: width of the dest image.
+ // dest_height: height of the dest image.
+ // dest_mip: on which mip level the sourceImg would be drawn.
+ void DrawImage(Bitmap* source_img, int source_x, int source_y,
+ int source_width, int source_height,
+ int dest_x, int dest_y,
+ int dest_width, int dest_height, int dest_mip);
+
protected:
// Returns true if the mip-map level has been locked.
bool IsLocked(unsigned int level) {
@@ -208,6 +227,25 @@
int level,
Pack* pack) = 0;
+ // Copy pixels from source bitmap to certain mip level.
+ // Scales if the width and height of source and dest do not match.
+ // Parameters:
+ // source_img: source bitmap which would be drawn.
+ // source_x: x-coordinate of the starting pixel in the source image.
+ // source_y: y-coordinate of the starting pixel in the source image.
+ // source_width: width of the source image to draw.
+ // source_height: Height of the source image to draw.
+ // dest_x: x-coordinate of the starting pixel in the dest image.
+ // dest_y: y-coordinate of the starting pixel in the dest image.
+ // dest_width: width of the dest image.
+ // dest_height: height of the dest image.
+ // face: on which face the sourceImg would be drawn.
+ // dest_mip: on which mip level the sourceImg would be drawn.
+ void DrawImage(Bitmap* source_img, int source_x, int source_y,
+ int source_width, int source_height,
+ int dest_x, int dest_y, int dest_width,
+ int dest_height, CubeFace face, int dest_mip);
+
protected:
// Returns true if the mip-map level has been locked.
bool IsLocked(unsigned int level, CubeFace face) {
« no previous file with comments | « core/cross/renderer_test.cc ('k') | core/cross/texture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698