From b672d5fcce4beff54ff029ffd57b396c365d0bd2 Mon Sep 17 00:00:00 2001 From: "gman@google.com" Date: Thu, 13 Aug 2009 16:34:39 +0000 Subject: Fixes for POT only systems git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23312 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/core/cross/gl/texture_gl.cc | 6 ++++-- o3d/core/win/d3d9/texture_d3d9.cc | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'o3d/core') 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(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(NUMBER_OF_FACES); ++ii) { - texture->backing_bitmaps_[ii]->AllocateData(); + texture->backing_bitmaps_[ii]->Allocate( + format, edge_length, edge_length, levels, Bitmap::IMAGE); } } -- cgit v1.1