diff options
author | luchen@google.com <luchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-02 23:40:37 +0000 |
---|---|---|
committer | luchen@google.com <luchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-02 23:40:37 +0000 |
commit | dd8cdfe00b66320d41ab7dc79f6fa2bf51b3a9c0 (patch) | |
tree | 9cc218f0b2f4b1b6f25453f3e4347abbf5280df5 /o3d/samples | |
parent | d75aba1dd9552b603fc713fd00927b28bfd824bf (diff) | |
download | chromium_src-dd8cdfe00b66320d41ab7dc79f6fa2bf51b3a9c0.zip chromium_src-dd8cdfe00b66320d41ab7dc79f6fa2bf51b3a9c0.tar.gz chromium_src-dd8cdfe00b66320d41ab7dc79f6fa2bf51b3a9c0.tar.bz2 |
Currently returns (e.g.) 32 if 16 is the input. Fix so it meets documentation: "Returns the smallest power of 2 that is larger than or equal to size."
Review URL: http://codereview.chromium.org/3080020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples')
-rw-r--r-- | o3d/samples/o3djs/util.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/o3d/samples/o3djs/util.js b/o3d/samples/o3djs/util.js index d897b1e..d3542fa 100644 --- a/o3d/samples/o3djs/util.js +++ b/o3d/samples/o3djs/util.js @@ -263,6 +263,7 @@ o3djs.util.getBoundingBoxOfTree = function(treeRoot) { */ o3djs.util.getPowerOfTwoSize = function(size) { var powerOfTwo = 1; + size = size - 1; while (size) { size = size >> 1; powerOfTwo = powerOfTwo << 1; |