summaryrefslogtreecommitdiffstats
path: root/cc/base
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-28 11:42:39 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-28 11:42:39 +0000
commit2a58e14322fb357f248528b4b4c77e10fa53ae2d (patch)
tree890aa3b6fe2416ca4c49786b3976f784332cea3b /cc/base
parente15ed2be6d44ab35e80ab71ec1d9e5eb459435eb (diff)
downloadchromium_src-2a58e14322fb357f248528b4b4c77e10fa53ae2d.zip
chromium_src-2a58e14322fb357f248528b4b4c77e10fa53ae2d.tar.gz
chromium_src-2a58e14322fb357f248528b4b4c77e10fa53ae2d.tar.bz2
Revert of [#7] Pass gfx structs by const ref (gfx::Size) (https://codereview.chromium.org/145313006/)
Reason for revert: Suspected of breaking the Linux ASAN tests ( http://build.chromium.org/p/chromium.memory/builders/Linux%20ASAN%20Tests%20%283%29/builds/22104 ) Original issue's description: > [#7] Pass gfx::Size by const ref. > > Any struct of size > 4 bytes should be passed by const ref. > Passing by ref for these structs is faster than passing by value, > especially when invoking function has multiple parameters and some > other scenarios mentioned in the bug. > > BUG=159273 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247426 TBR=danakj@chromium.org,enne@chromium.org,bulach@chromium.org,piman@chromium.org,prashant.n@samsung.com NOTREECHECKS=true NOTRY=true BUG=159273 Review URL: https://codereview.chromium.org/142863008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247437 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/base')
-rw-r--r--cc/base/math_util.cc2
-rw-r--r--cc/base/math_util.h2
-rw-r--r--cc/base/tiling_data.cc12
-rw-r--r--cc/base/tiling_data.h12
-rw-r--r--cc/base/tiling_data_unittest.cc44
5 files changed, 36 insertions, 36 deletions
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc
index 72b1e7f..8abfa90f0 100644
--- a/cc/base/math_util.cc
+++ b/cc/base/math_util.cc
@@ -508,7 +508,7 @@ gfx::Vector2dF MathUtil::ProjectVector(const gfx::Vector2dF& source,
projected_length * destination.y());
}
-scoped_ptr<base::Value> MathUtil::AsValue(const gfx::Size& s) {
+scoped_ptr<base::Value> MathUtil::AsValue(gfx::Size s) {
scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue());
res->SetDouble("width", s.width());
res->SetDouble("height", s.height());
diff --git a/cc/base/math_util.h b/cc/base/math_util.h
index fca08ef..6cad1ad 100644
--- a/cc/base/math_util.h
+++ b/cc/base/math_util.h
@@ -165,7 +165,7 @@ class CC_EXPORT MathUtil {
const gfx::Vector2dF& destination);
// Conversion to value.
- static scoped_ptr<base::Value> AsValue(const gfx::Size& s);
+ static scoped_ptr<base::Value> AsValue(gfx::Size s);
static scoped_ptr<base::Value> AsValue(const gfx::SizeF& s);
static scoped_ptr<base::Value> AsValue(const gfx::Rect& r);
static bool FromValue(const base::Value*, gfx::Rect* out_rect);
diff --git a/cc/base/tiling_data.cc b/cc/base/tiling_data.cc
index 8b3ba62..9cdf027 100644
--- a/cc/base/tiling_data.cc
+++ b/cc/base/tiling_data.cc
@@ -29,8 +29,8 @@ TilingData::TilingData()
}
TilingData::TilingData(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels)
: max_texture_size_(max_texture_size),
total_size_(total_size),
@@ -39,8 +39,8 @@ TilingData::TilingData(
}
TilingData::TilingData(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
int border_texels)
: max_texture_size_(max_texture_size),
total_size_(total_size),
@@ -48,12 +48,12 @@ TilingData::TilingData(
RecomputeNumTiles();
}
-void TilingData::SetTotalSize(const gfx::Size& total_size) {
+void TilingData::SetTotalSize(gfx::Size total_size) {
total_size_ = total_size;
RecomputeNumTiles();
}
-void TilingData::SetMaxTextureSize(const gfx::Size& max_texture_size) {
+void TilingData::SetMaxTextureSize(gfx::Size max_texture_size) {
max_texture_size_ = max_texture_size;
RecomputeNumTiles();
}
diff --git a/cc/base/tiling_data.h b/cc/base/tiling_data.h
index 9540c38..96e6ae0 100644
--- a/cc/base/tiling_data.h
+++ b/cc/base/tiling_data.h
@@ -23,19 +23,19 @@ class CC_EXPORT TilingData {
public:
TilingData();
TilingData(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels);
TilingData(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
int border_texels);
gfx::Size total_size() const { return total_size_; }
- void SetTotalSize(const gfx::Size& total_size);
+ void SetTotalSize(const gfx::Size total_size);
gfx::Size max_texture_size() const { return max_texture_size_; }
- void SetMaxTextureSize(const gfx::Size& max_texture_size);
+ void SetMaxTextureSize(gfx::Size max_texture_size);
int border_texels() const { return border_texels_; }
void SetHasBorderTexels(bool has_border_texels);
diff --git a/cc/base/tiling_data_unittest.cc b/cc/base/tiling_data_unittest.cc
index 55b3b6d..db2d6f2 100644
--- a/cc/base/tiling_data_unittest.cc
+++ b/cc/base/tiling_data_unittest.cc
@@ -13,8 +13,8 @@ namespace cc {
namespace {
int NumTiles(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels) {
TilingData tiling(max_texture_size, total_size, has_border_texels);
int num_tiles = tiling.num_tiles_x() * tiling.num_tiles_y();
@@ -28,8 +28,8 @@ int NumTiles(
}
int XIndex(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels,
int x_coord) {
TilingData tiling(max_texture_size, total_size, has_border_texels);
@@ -37,8 +37,8 @@ int XIndex(
}
int YIndex(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels,
int y_coord) {
TilingData tiling(max_texture_size, total_size, has_border_texels);
@@ -46,8 +46,8 @@ int YIndex(
}
int MinBorderXIndex(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels,
int x_coord) {
TilingData tiling(max_texture_size, total_size, has_border_texels);
@@ -55,8 +55,8 @@ int MinBorderXIndex(
}
int MinBorderYIndex(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels,
int y_coord) {
TilingData tiling(max_texture_size, total_size, has_border_texels);
@@ -64,8 +64,8 @@ int MinBorderYIndex(
}
int MaxBorderXIndex(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels,
int x_coord) {
TilingData tiling(max_texture_size, total_size, has_border_texels);
@@ -73,8 +73,8 @@ int MaxBorderXIndex(
}
int MaxBorderYIndex(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels,
int y_coord) {
TilingData tiling(max_texture_size, total_size, has_border_texels);
@@ -82,8 +82,8 @@ int MaxBorderYIndex(
}
int PosX(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels,
int x_index) {
TilingData tiling(max_texture_size, total_size, has_border_texels);
@@ -91,8 +91,8 @@ int PosX(
}
int PosY(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels,
int y_index) {
TilingData tiling(max_texture_size, total_size, has_border_texels);
@@ -100,8 +100,8 @@ int PosY(
}
int SizeX(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels,
int x_index) {
TilingData tiling(max_texture_size, total_size, has_border_texels);
@@ -109,8 +109,8 @@ int SizeX(
}
int SizeY(
- const gfx::Size& max_texture_size,
- const gfx::Size& total_size,
+ gfx::Size max_texture_size,
+ gfx::Size total_size,
bool has_border_texels,
int y_index) {
TilingData tiling(max_texture_size, total_size, has_border_texels);