summaryrefslogtreecommitdiffstats
path: root/o3d/core
diff options
context:
space:
mode:
authorgman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 16:34:39 +0000
committergman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 16:34:39 +0000
commitb672d5fcce4beff54ff029ffd57b396c365d0bd2 (patch)
tree432c97ca43278ffe67ab4b264eda98b9cae54bb9 /o3d/core
parent470f250d93f7d22774f5b2d4b258354e131a2e01 (diff)
downloadchromium_src-b672d5fcce4beff54ff029ffd57b396c365d0bd2.zip
chromium_src-b672d5fcce4beff54ff029ffd57b396c365d0bd2.tar.gz
chromium_src-b672d5fcce4beff54ff029ffd57b396c365d0bd2.tar.bz2
Fixes for POT only systems
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23312 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/core')
-rw-r--r--o3d/core/cross/gl/texture_gl.cc6
-rw-r--r--o3d/core/win/d3d9/texture_d3d9.cc6
2 files changed, 8 insertions, 4 deletions
diff --git a/o3d/core/cross/gl/texture_gl.cc b/o3d/core/cross/gl/texture_gl.cc
index 31bb464..65a832f 100644
--- a/o3d/core/cross/gl/texture_gl.cc
+++ b/o3d/core/cross/gl/texture_gl.cc
@@ -333,7 +333,8 @@ Texture2DGL* Texture2DGL::Create(ServiceLocator* service_locator,
// If the hardware does not support npot textures, allocate a 0-initialized
// mip-chain here for use during Texture2DGL::Lock.
if (resize_to_pot) {
- texture->backing_bitmap_->AllocateData();
+ texture->backing_bitmap_->Allocate(format, width, height, levels,
+ Bitmap::IMAGE);
texture->has_levels_ = (1 << levels) - 1;
}
CHECK_GL_ERROR();
@@ -667,7 +668,8 @@ TextureCUBEGL* TextureCUBEGL::Create(ServiceLocator* service_locator,
// mip-chain here for use during TextureCUBEGL::Lock.
if (resize_to_pot) {
for (int face = 0; face < static_cast<int>(NUMBER_OF_FACES); ++face) {
- texture->backing_bitmaps_[face]->AllocateData();
+ texture->backing_bitmaps_[face]->Allocate(
+ format, edge_length, edge_length, levels, Bitmap::IMAGE);
texture->has_levels_[face] = (1 << levels) - 1;
}
}
diff --git a/o3d/core/win/d3d9/texture_d3d9.cc b/o3d/core/win/d3d9/texture_d3d9.cc
index 13c3d3b..3707c42 100644
--- a/o3d/core/win/d3d9/texture_d3d9.cc
+++ b/o3d/core/win/d3d9/texture_d3d9.cc
@@ -391,7 +391,8 @@ Texture2DD3D9* Texture2DD3D9::Create(ServiceLocator* service_locator,
resize_to_pot,
enable_render_surfaces);
if (resize_to_pot) {
- texture->backing_bitmap_->AllocateData();
+ texture->backing_bitmap_->Allocate(format, width, height, levels,
+ Bitmap::IMAGE);
}
return texture;
@@ -714,7 +715,8 @@ TextureCUBED3D9* TextureCUBED3D9::Create(ServiceLocator* service_locator,
enable_render_surfaces);
if (resize_to_pot) {
for (int ii = 0; ii < static_cast<int>(NUMBER_OF_FACES); ++ii) {
- texture->backing_bitmaps_[ii]->AllocateData();
+ texture->backing_bitmaps_[ii]->Allocate(
+ format, edge_length, edge_length, levels, Bitmap::IMAGE);
}
}