diff options
author | maf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-19 18:46:26 +0000 |
---|---|---|
committer | maf@google.com <maf@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-19 18:46:26 +0000 |
commit | 76b3af422d58822e17523064aca0a3de116a3457 (patch) | |
tree | 312e948e14acfd7bbf63dfd3a6677b8625df80d2 /o3d | |
parent | 9a5bf36ab389af98120f9922bd191509321366da (diff) | |
download | chromium_src-76b3af422d58822e17523064aca0a3de116a3457.zip chromium_src-76b3af422d58822e17523064aca0a3de116a3457.tar.gz chromium_src-76b3af422d58822e17523064aca0a3de116a3457.tar.bz2 |
Changes needed to make "all" build complete, including fixing the generated converter tool.
Review URL: http://codereview.chromium.org/173045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23721 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/converter/converter.gyp | 14 | ||||
-rwxr-xr-x | o3d/converter/mac/converter_install_name.sh | 7 | ||||
-rw-r--r-- | o3d/core/cross/bitmap.cc | 4 | ||||
-rw-r--r-- | o3d/core/cross/image_utils_test.cc | 34 | ||||
-rw-r--r-- | o3d/core/cross/texture.cc | 10 | ||||
-rw-r--r-- | o3d/installer/mac/installer.gyp | 1 | ||||
-rw-r--r-- | o3d/plugin/idl/idl.gyp | 3 |
7 files changed, 47 insertions, 26 deletions
diff --git a/o3d/converter/converter.gyp b/o3d/converter/converter.gyp index a96372c..0e15f54 100644 --- a/o3d/converter/converter.gyp +++ b/o3d/converter/converter.gyp @@ -58,6 +58,18 @@ 'conditions' : [ ['OS == "mac"', { + 'postbuilds': [ + { + 'variables': { + # Define install_name in a variable ending in _path + # so that gyp understands it's a path and performs proper + # relativization during dict merging. + 'install_name_path': 'mac/converter_install_name.sh', + }, + 'postbuild_name': 'Fix Framework Paths', + 'action': ['<(install_name_path)'], + }, + ], 'sources': [ 'mac/converter_main.mm', ], @@ -66,7 +78,7 @@ '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', - '../../../<(cgdir)/Cg.framework', + '../../<(cgdir)/Cg.framework', ], }, }, diff --git a/o3d/converter/mac/converter_install_name.sh b/o3d/converter/mac/converter_install_name.sh new file mode 100755 index 0000000..f20f43d --- /dev/null +++ b/o3d/converter/mac/converter_install_name.sh @@ -0,0 +1,7 @@ +#!/bin/sh + + +/usr/bin/install_name_tool -change \ + @executable_path/../Library/Frameworks/Cg.framework/Cg \ + @executable_path/Cg.framework/Cg \ + "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" diff --git a/o3d/core/cross/bitmap.cc b/o3d/core/cross/bitmap.cc index f2c96a0..1672a4e 100644 --- a/o3d/core/cross/bitmap.cc +++ b/o3d/core/cross/bitmap.cc @@ -344,11 +344,11 @@ void Bitmap::DrawImage(const Bitmap& src_img, DCHECK(src_img.image_data()); DCHECK(image_data()); - if (dst_level < 0 || dst_level >= num_mipmaps()) { + if (dst_level < 0 || dst_level >= static_cast<int>(num_mipmaps())) { O3D_ERROR(service_locator()) << "Destination Mip out of range"; } - if (src_level < 0 || src_level >= src_img.num_mipmaps()) { + if (src_level < 0 || src_level >= static_cast<int>(src_img.num_mipmaps())) { O3D_ERROR(service_locator()) << "Source Mip out of range"; } diff --git a/o3d/core/cross/image_utils_test.cc b/o3d/core/cross/image_utils_test.cc index a2a237c..2944302 100644 --- a/o3d/core/cross/image_utils_test.cc +++ b/o3d/core/cross/image_utils_test.cc @@ -53,14 +53,14 @@ class ImageTest : public testing::Test { }; TEST_F(ImageTest, GetNumComponentsForFormat) { - EXPECT_EQ(4, image::GetNumComponentsForFormat(Texture::XRGB8)); - EXPECT_EQ(4, image::GetNumComponentsForFormat(Texture::ARGB8)); - EXPECT_EQ(4, image::GetNumComponentsForFormat(Texture::ABGR16F)); - EXPECT_EQ(4, image::GetNumComponentsForFormat(Texture::ABGR32F)); - EXPECT_EQ(1, image::GetNumComponentsForFormat(Texture::R32F)); - EXPECT_EQ(0, image::GetNumComponentsForFormat(Texture::DXT1)); - EXPECT_EQ(0, image::GetNumComponentsForFormat(Texture::DXT3)); - EXPECT_EQ(0, image::GetNumComponentsForFormat(Texture::DXT5)); + EXPECT_EQ(4u, image::GetNumComponentsForFormat(Texture::XRGB8)); + EXPECT_EQ(4u, image::GetNumComponentsForFormat(Texture::ARGB8)); + EXPECT_EQ(4u, image::GetNumComponentsForFormat(Texture::ABGR16F)); + EXPECT_EQ(4u, image::GetNumComponentsForFormat(Texture::ABGR32F)); + EXPECT_EQ(1u, image::GetNumComponentsForFormat(Texture::R32F)); + EXPECT_EQ(0u, image::GetNumComponentsForFormat(Texture::DXT1)); + EXPECT_EQ(0u, image::GetNumComponentsForFormat(Texture::DXT3)); + EXPECT_EQ(0u, image::GetNumComponentsForFormat(Texture::DXT5)); } TEST_F(ImageTest, IsPOT) { @@ -69,14 +69,14 @@ TEST_F(ImageTest, IsPOT) { EXPECT_FALSE(image::IsPOT(2, 3)); } -TEST_F(ImageTest, CheckImageDimensions) {
- EXPECT_TRUE(image::CheckImageDimensions(1u, 1u));
- EXPECT_TRUE(image::CheckImageDimensions(image::kMaxImageDimension,
- image::kMaxImageDimension));
- EXPECT_FALSE(image::CheckImageDimensions(0u, image::kMaxImageDimension + 1));
- EXPECT_FALSE(image::CheckImageDimensions(image::kMaxImageDimension + 1, 0u));
-}
-
+TEST_F(ImageTest, CheckImageDimensions) { + EXPECT_TRUE(image::CheckImageDimensions(1u, 1u)); + EXPECT_TRUE(image::CheckImageDimensions(image::kMaxImageDimension, + image::kMaxImageDimension)); + EXPECT_FALSE(image::CheckImageDimensions(0u, image::kMaxImageDimension + 1)); + EXPECT_FALSE(image::CheckImageDimensions(image::kMaxImageDimension + 1, 0u)); +} + TEST_F(ImageTest, ComputeMipMapCount) { EXPECT_EQ(image::ComputeMipMapCount(1, 1), 1u); EXPECT_EQ(image::ComputeMipMapCount(2, 2), 2u); @@ -563,4 +563,4 @@ TEST_F(ImageTest, AdjustForSetRect) { } // namespace -
+ diff --git a/o3d/core/cross/texture.cc b/o3d/core/cross/texture.cc index 560eb6c..4ef14fc 100644 --- a/o3d/core/cross/texture.cc +++ b/o3d/core/cross/texture.cc @@ -102,7 +102,7 @@ void Texture2D::DrawImage(const Bitmap& src_img, O3D_ERROR(service_locator()) << "Mip out of range"; } - if (src_mip < 0 || src_mip >= src_img.num_mipmaps()) { + if (src_mip < 0 || src_mip >= static_cast<int>(src_img.num_mipmaps())) { O3D_ERROR(service_locator()) << "Source Mip out of range"; } @@ -213,7 +213,11 @@ void Texture2D::DrawImage(const Canvas& src_img, } unsigned int mip_width = image::ComputeMipDimension(dst_mip, width()); + DCHECK(mip_width > 0); + unsigned int mip_height = image::ComputeMipDimension(dst_mip, height()); + DCHECK(mip_height > 0); + unsigned int components = image::GetNumComponentsForFormat(format()); DCHECK(components > 0); @@ -387,7 +391,7 @@ void TextureCUBE::DrawImage(const Bitmap& src_img, int src_mip, O3D_ERROR(service_locator()) << "Destination Mip out of range"; } - if (src_mip < 0 || src_mip >= src_img.num_mipmaps()) { + if (src_mip < 0 || src_mip >= static_cast<int>(src_img.num_mipmaps())) { O3D_ERROR(service_locator()) << "Source Mip out of range"; } @@ -501,6 +505,8 @@ void TextureCUBE::DrawImage(const Canvas& src_img, } unsigned int mip_length = image::ComputeMipDimension(dest_mip, edge_length()); + DCHECK(mip_length > 0u); + unsigned int components = image::GetNumComponentsForFormat(format()); DCHECK(components > 0); diff --git a/o3d/installer/mac/installer.gyp b/o3d/installer/mac/installer.gyp index ca67bd5..d0d2c99 100644 --- a/o3d/installer/mac/installer.gyp +++ b/o3d/installer/mac/installer.gyp @@ -25,7 +25,6 @@ 'dependencies': [ '../../converter/converter.gyp:o3dConverter', '../../breakpad/breakpad.gyp:reporter', - '../../google_update/google_update.gyp:getextras', '../../documentation/documentation.gyp:*', '../../plugin/plugin.gyp:npo3dautoplugin', '../../samples/samples.gyp:samples', diff --git a/o3d/plugin/idl/idl.gyp b/o3d/plugin/idl/idl.gyp index 5a7b22c..4194115 100644 --- a/o3d/plugin/idl/idl.gyp +++ b/o3d/plugin/idl/idl.gyp @@ -87,9 +87,6 @@ 'outputs': [ '<(idl_out_dir)/<(RULE_INPUT_ROOT)_glue.cc', '<(idl_out_dir)/<(RULE_INPUT_ROOT)_glue.h', - '<(idl_out_dir)/hash', - '<(idl_out_dir)/parsetab.py', - '<(idl_out_dir)/parsetab.pyc', ], 'action': [ 'python', |