summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvmpstr <vmpstr@chromium.org>2015-05-28 11:23:32 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-28 18:24:00 +0000
commitc48fd0209655108ac33716ede56109724f839bc9 (patch)
tree85cda3e0081024c5141d21a8e59a7bc195b20bff
parentbc4f7fa505a2d59a434d8a164043210a960d9be9 (diff)
downloadchromium_src-c48fd0209655108ac33716ede56109724f839bc9.zip
chromium_src-c48fd0209655108ac33716ede56109724f839bc9.tar.gz
chromium_src-c48fd0209655108ac33716ede56109724f839bc9.tar.bz2
cc: Move RoundUp and RoundDown out of util.h into math_util.h
This patch merges util.h into math_util.h since the only two functions in there are math functions. R=danakj CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1161553012 Cr-Commit-Position: refs/heads/master@{#331823}
-rw-r--r--cc/BUILD.gn1
-rw-r--r--cc/base/BUILD.gn1
-rw-r--r--cc/base/math_util.h23
-rw-r--r--cc/base/math_util_unittest.cc54
-rw-r--r--cc/base/util.h31
-rw-r--r--cc/base/util_unittest.cc67
-rw-r--r--cc/cc.gyp1
-rw-r--r--cc/cc_tests.gyp1
-rw-r--r--cc/layers/picture_layer_impl.cc7
-rw-r--r--cc/playback/picture.cc1
-rw-r--r--cc/playback/pixel_ref_map.cc32
-rw-r--r--cc/raster/one_copy_tile_task_worker_pool.cc5
-rw-r--r--cc/raster/texture_compressor_etc1_unittest.cc1
-rw-r--r--cc/resources/resource_provider.cc12
-rw-r--r--cc/resources/texture_uploader.cc6
-rw-r--r--cc/resources/texture_uploader_unittest.cc4
-rw-r--r--cc/resources/video_resource_updater.cc6
-rw-r--r--cc/trees/layer_tree_host_impl.cc1
-rw-r--r--cc/trees/layer_tree_impl.cc1
19 files changed, 114 insertions, 141 deletions
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 2f631d8..ab2b1a0 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -778,7 +778,6 @@ test("cc_unittests") {
"base/scoped_ptr_vector_unittest.cc",
"base/simple_enclosed_region_unittest.cc",
"base/tiling_data_unittest.cc",
- "base/util_unittest.cc",
"debug/frame_timing_tracker_unittest.cc",
"debug/micro_benchmark_controller_unittest.cc",
"input/top_controls_manager_unittest.cc",
diff --git a/cc/base/BUILD.gn b/cc/base/BUILD.gn
index 509547e..71762f3 100644
--- a/cc/base/BUILD.gn
+++ b/cc/base/BUILD.gn
@@ -33,7 +33,6 @@ source_set("base") {
"time_util.h",
"unique_notifier.cc",
"unique_notifier.h",
- "util.h",
]
deps = [
diff --git a/cc/base/math_util.h b/cc/base/math_util.h
index 749b9bd..4c40e8e 100644
--- a/cc/base/math_util.h
+++ b/cc/base/math_util.h
@@ -96,6 +96,29 @@ class CC_EXPORT MathUtil {
return (d > 0.0) ? std::floor(d + 0.5) : std::ceil(d - 0.5);
}
+ // RoundUp rounds up a given |n| to be a multiple of |mul|.
+ // Examples:
+ // - RoundUp(123, 50) returns 150.
+ // - RoundUp(-123, 50) returns -100.
+ template <typename T>
+ static T RoundUp(T n, T mul) {
+ static_assert(std::numeric_limits<T>::is_integer,
+ "T must be an integer type");
+ return (n > 0) ? ((n + mul - 1) / mul) * mul : (n / mul) * mul;
+ }
+
+ // RoundDown rounds down a given |n| to be a multiple of |mul|.
+ // Examples:
+ // - RoundDown(123, 50) returns 100.
+ // - RoundDown(-123, 50) returns -150.
+ template <typename T>
+ static T RoundDown(T n, T mul) {
+ static_assert(std::numeric_limits<T>::is_integer,
+ "T must be an integer type");
+ return (n > 0) ? (n / mul) * mul : (n == 0) ? 0
+ : ((n - mul + 1) / mul) * mul;
+ }
+
template <typename T> static T ClampToRange(T value, T min, T max) {
return std::min(std::max(value, min), max);
}
diff --git a/cc/base/math_util_unittest.cc b/cc/base/math_util_unittest.cc
index 325870d..1d43e0f 100644
--- a/cc/base/math_util_unittest.cc
+++ b/cc/base/math_util_unittest.cc
@@ -193,5 +193,59 @@ TEST(MathUtilTest, MapEnclosedRectWith2dAxisAlignedTransform) {
EXPECT_EQ(gfx::Rect(2, 4, 6, 8), output);
}
+TEST(MathUtilTest, RoundUp) {
+ for (int multiplier = 1; multiplier <= 10; ++multiplier) {
+ // Try attempts in descending order, so that we can
+ // determine the correct value before it's needed.
+ int correct;
+ for (int attempt = 5 * multiplier; attempt >= -5 * multiplier; --attempt) {
+ if ((attempt % multiplier) == 0)
+ correct = attempt;
+ EXPECT_EQ(correct, MathUtil::RoundUp(attempt, multiplier))
+ << "attempt=" << attempt << " multiplier=" << multiplier;
+ }
+ }
+
+ for (unsigned multiplier = 1; multiplier <= 10; ++multiplier) {
+ // Try attempts in descending order, so that we can
+ // determine the correct value before it's needed.
+ unsigned correct;
+ for (unsigned attempt = 5 * multiplier; attempt > 0; --attempt) {
+ if ((attempt % multiplier) == 0)
+ correct = attempt;
+ EXPECT_EQ(correct, MathUtil::RoundUp(attempt, multiplier))
+ << "attempt=" << attempt << " multiplier=" << multiplier;
+ }
+ EXPECT_EQ(0u, MathUtil::RoundUp(0u, multiplier))
+ << "attempt=0 multiplier=" << multiplier;
+ }
+}
+
+TEST(MathUtilTest, RoundDown) {
+ for (int multiplier = 1; multiplier <= 10; ++multiplier) {
+ // Try attempts in ascending order, so that we can
+ // determine the correct value before it's needed.
+ int correct;
+ for (int attempt = -5 * multiplier; attempt <= 5 * multiplier; ++attempt) {
+ if ((attempt % multiplier) == 0)
+ correct = attempt;
+ EXPECT_EQ(correct, MathUtil::RoundDown(attempt, multiplier))
+ << "attempt=" << attempt << " multiplier=" << multiplier;
+ }
+ }
+
+ for (unsigned multiplier = 1; multiplier <= 10; ++multiplier) {
+ // Try attempts in ascending order, so that we can
+ // determine the correct value before it's needed.
+ unsigned correct;
+ for (unsigned attempt = 0; attempt <= 5 * multiplier; ++attempt) {
+ if ((attempt % multiplier) == 0)
+ correct = attempt;
+ EXPECT_EQ(correct, MathUtil::RoundDown(attempt, multiplier))
+ << "attempt=" << attempt << " multiplier=" << multiplier;
+ }
+ }
+}
+
} // namespace
} // namespace cc
diff --git a/cc/base/util.h b/cc/base/util.h
deleted file mode 100644
index a16d485..0000000
--- a/cc/base/util.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CC_BASE_UTIL_H_
-#define CC_BASE_UTIL_H_
-
-#include <limits>
-
-#include "base/basictypes.h"
-
-namespace cc {
-
-template <typename T> T RoundUp(T n, T mul) {
- static_assert(std::numeric_limits<T>::is_integer,
- "T must be an integer type");
- return (n > 0) ? ((n + mul - 1) / mul) * mul
- : (n / mul) * mul;
-}
-
-template <typename T> T RoundDown(T n, T mul) {
- static_assert(std::numeric_limits<T>::is_integer,
- "T must be an integer type");
- return (n > 0) ? (n / mul) * mul
- : (n == 0) ? 0
- : ((n - mul + 1) / mul) * mul;
-}
-
-} // namespace cc
-
-#endif // CC_BASE_UTIL_H_
diff --git a/cc/base/util_unittest.cc b/cc/base/util_unittest.cc
deleted file mode 100644
index 6665a6a..0000000
--- a/cc/base/util_unittest.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "cc/base/util.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace cc {
-namespace {
-
-TEST(UtilTest, RoundUp) {
- for (int multiplier = 1; multiplier <= 10; ++multiplier) {
- // Try attempts in descending order, so that we can
- // determine the correct value before it's needed.
- int correct;
- for (int attempt = 5 * multiplier; attempt >= -5 * multiplier; --attempt) {
- if ((attempt % multiplier) == 0)
- correct = attempt;
- EXPECT_EQ(correct, RoundUp(attempt, multiplier))
- << "attempt=" << attempt << " multiplier=" << multiplier;
- }
- }
-
- for (unsigned multiplier = 1; multiplier <= 10; ++multiplier) {
- // Try attempts in descending order, so that we can
- // determine the correct value before it's needed.
- unsigned correct;
- for (unsigned attempt = 5 * multiplier; attempt > 0; --attempt) {
- if ((attempt % multiplier) == 0)
- correct = attempt;
- EXPECT_EQ(correct, RoundUp(attempt, multiplier))
- << "attempt=" << attempt << " multiplier=" << multiplier;
- }
- EXPECT_EQ(0u, RoundUp(0u, multiplier))
- << "attempt=0 multiplier=" << multiplier;
- }
-}
-
-TEST(UtilTest, RoundDown) {
- for (int multiplier = 1; multiplier <= 10; ++multiplier) {
- // Try attempts in ascending order, so that we can
- // determine the correct value before it's needed.
- int correct;
- for (int attempt = -5 * multiplier; attempt <= 5 * multiplier; ++attempt) {
- if ((attempt % multiplier) == 0)
- correct = attempt;
- EXPECT_EQ(correct, RoundDown(attempt, multiplier))
- << "attempt=" << attempt << " multiplier=" << multiplier;
- }
- }
-
- for (unsigned multiplier = 1; multiplier <= 10; ++multiplier) {
- // Try attempts in ascending order, so that we can
- // determine the correct value before it's needed.
- unsigned correct;
- for (unsigned attempt = 0; attempt <= 5 * multiplier; ++attempt) {
- if ((attempt % multiplier) == 0)
- correct = attempt;
- EXPECT_EQ(correct, RoundDown(attempt, multiplier))
- << "attempt=" << attempt << " multiplier=" << multiplier;
- }
- }
-}
-
-} // namespace
-} // namespace cc
diff --git a/cc/cc.gyp b/cc/cc.gyp
index da4c7a1..4bb2f88 100644
--- a/cc/cc.gyp
+++ b/cc/cc.gyp
@@ -92,7 +92,6 @@
'base/time_util.h',
'base/unique_notifier.cc',
'base/unique_notifier.h',
- 'base/util.h',
'debug/benchmark_instrumentation.cc',
'debug/benchmark_instrumentation.h',
'debug/debug_colors.cc',
diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp
index e365b9e..d37c15f 100644
--- a/cc/cc_tests.gyp
+++ b/cc/cc_tests.gyp
@@ -23,7 +23,6 @@
'base/simple_enclosed_region_unittest.cc',
'base/tiling_data_unittest.cc',
'base/unique_notifier_unittest.cc',
- 'base/util_unittest.cc',
'debug/frame_timing_tracker_unittest.cc',
'debug/micro_benchmark_controller_unittest.cc',
'debug/rendering_stats_unittest.cc',
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 806ae0a..c6c8d66 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -12,7 +12,6 @@
#include "base/time/time.h"
#include "base/trace_event/trace_event_argument.h"
#include "cc/base/math_util.h"
-#include "cc/base/util.h"
#include "cc/debug/debug_colors.h"
#include "cc/debug/micro_benchmark_impl.h"
#include "cc/debug/traced_value.h"
@@ -695,7 +694,7 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
divisor = 2;
if (content_bounds.width() <= viewport_width / 4)
divisor = 1;
- default_tile_height = RoundUp(viewport_height, divisor) / divisor;
+ default_tile_height = MathUtil::RoundUp(viewport_height, divisor) / divisor;
// Grow default sizes to account for overlapping border texels.
default_tile_width += 2 * PictureLayerTiling::kBorderTexels;
@@ -731,12 +730,12 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
// Clamp the tile width/height to the content width/height to save space.
if (content_bounds.width() < default_tile_width) {
tile_width = std::min(tile_width, content_bounds.width());
- tile_width = RoundUp(tile_width, kTileRoundUp);
+ tile_width = MathUtil::RoundUp(tile_width, kTileRoundUp);
tile_width = std::min(tile_width, default_tile_width);
}
if (content_bounds.height() < default_tile_height) {
tile_height = std::min(tile_height, content_bounds.height());
- tile_height = RoundUp(tile_height, kTileRoundUp);
+ tile_height = MathUtil::RoundUp(tile_height, kTileRoundUp);
tile_height = std::min(tile_height, default_tile_height);
}
diff --git a/cc/playback/picture.cc b/cc/playback/picture.cc
index e86cba6..8ce9c66 100644
--- a/cc/playback/picture.cc
+++ b/cc/playback/picture.cc
@@ -12,7 +12,6 @@
#include "base/trace_event/trace_event_argument.h"
#include "base/values.h"
#include "cc/base/math_util.h"
-#include "cc/base/util.h"
#include "cc/debug/picture_debug_util.h"
#include "cc/debug/traced_picture.h"
#include "cc/debug/traced_value.h"
diff --git a/cc/playback/pixel_ref_map.cc b/cc/playback/pixel_ref_map.cc
index bb5a84c..a5c8f05 100644
--- a/cc/playback/pixel_ref_map.cc
+++ b/cc/playback/pixel_ref_map.cc
@@ -7,7 +7,7 @@
#include <algorithm>
#include <limits>
-#include "cc/base/util.h"
+#include "cc/base/math_util.h"
#include "cc/playback/display_item_list.h"
#include "cc/playback/picture.h"
#include "skia/ext/pixel_ref_utils.h"
@@ -33,15 +33,16 @@ void PixelRefMap::GatherPixelRefsFromPicture(SkPicture* picture) {
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture, &pixel_refs);
for (skia::DiscardablePixelRefList::const_iterator it = pixel_refs.begin();
it != pixel_refs.end(); ++it) {
- gfx::Point min(
- RoundDown(static_cast<int>(it->pixel_ref_rect.x()), cell_size_.width()),
- RoundDown(static_cast<int>(it->pixel_ref_rect.y()),
- cell_size_.height()));
- gfx::Point max(
- RoundDown(static_cast<int>(std::ceil(it->pixel_ref_rect.right())),
- cell_size_.width()),
- RoundDown(static_cast<int>(std::ceil(it->pixel_ref_rect.bottom())),
- cell_size_.height()));
+ gfx::Point min(MathUtil::RoundDown(static_cast<int>(it->pixel_ref_rect.x()),
+ cell_size_.width()),
+ MathUtil::RoundDown(static_cast<int>(it->pixel_ref_rect.y()),
+ cell_size_.height()));
+ gfx::Point max(MathUtil::RoundDown(
+ static_cast<int>(std::ceil(it->pixel_ref_rect.right())),
+ cell_size_.width()),
+ MathUtil::RoundDown(
+ static_cast<int>(std::ceil(it->pixel_ref_rect.bottom())),
+ cell_size_.height()));
for (int y = min.y(); y <= max.y(); y += cell_size_.height()) {
for (int x = min.x(); x <= max.x(); x += cell_size_.width()) {
@@ -147,11 +148,12 @@ void PixelRefMap::Iterator::PointToFirstPixelRef(const gfx::Rect& rect) {
gfx::Size cell_size(target_pixel_ref_map_->cell_size_);
// We have to find a cell_size aligned point that corresponds to
// query_rect. Point is a multiple of cell_size.
- min_point_ = gfx::Point(RoundDown(query_rect.x(), cell_size.width()),
- RoundDown(query_rect.y(), cell_size.height()));
- max_point_ =
- gfx::Point(RoundDown(query_rect.right() - 1, cell_size.width()),
- RoundDown(query_rect.bottom() - 1, cell_size.height()));
+ min_point_ =
+ gfx::Point(MathUtil::RoundDown(query_rect.x(), cell_size.width()),
+ MathUtil::RoundDown(query_rect.y(), cell_size.height()));
+ max_point_ = gfx::Point(
+ MathUtil::RoundDown(query_rect.right() - 1, cell_size.width()),
+ MathUtil::RoundDown(query_rect.bottom() - 1, cell_size.height()));
// Limit the points to known pixel ref boundaries.
min_point_ = gfx::Point(
diff --git a/cc/raster/one_copy_tile_task_worker_pool.cc b/cc/raster/one_copy_tile_task_worker_pool.cc
index b075fac..2f96458 100644
--- a/cc/raster/one_copy_tile_task_worker_pool.cc
+++ b/cc/raster/one_copy_tile_task_worker_pool.cc
@@ -10,7 +10,7 @@
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_argument.h"
-#include "cc/base/util.h"
+#include "cc/base/math_util.h"
#include "cc/debug/traced_value.h"
#include "cc/raster/raster_buffer.h"
#include "cc/resources/resource_pool.h"
@@ -307,7 +307,8 @@ OneCopyTileTaskWorkerPool::PlaybackAndScheduleCopyOnWorkerThread(
size_t chunk_size_in_rows = std::max(
static_cast<size_t>(1), max_bytes_per_copy_operation_ / bytes_per_row);
// Align chunk size to 4. Required to support compressed texture formats.
- chunk_size_in_rows = RoundUp(chunk_size_in_rows, static_cast<size_t>(4));
+ chunk_size_in_rows =
+ MathUtil::RoundUp(chunk_size_in_rows, static_cast<size_t>(4));
size_t y = 0;
size_t height = src->size().height();
while (y < height) {
diff --git a/cc/raster/texture_compressor_etc1_unittest.cc b/cc/raster/texture_compressor_etc1_unittest.cc
index 98ccd77..d0c63f4 100644
--- a/cc/raster/texture_compressor_etc1_unittest.cc
+++ b/cc/raster/texture_compressor_etc1_unittest.cc
@@ -4,7 +4,6 @@
#include "cc/raster/texture_compressor.h"
-#include "cc/base/util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index 923ed56..87cee0c 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -13,7 +13,7 @@
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/trace_event/trace_event.h"
-#include "cc/base/util.h"
+#include "cc/base/math_util.h"
#include "cc/resources/platform_color.h"
#include "cc/resources/returned_resource.h"
#include "cc/resources/shared_bitmap_manager.h"
@@ -1622,11 +1622,11 @@ void ResourceProvider::AcquirePixelBuffer(ResourceId id) {
gl->BindBuffer(GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM,
resource->gl_pixel_buffer_id);
unsigned bytes_per_pixel = BitsPerPixel(resource->format) / 8;
- gl->BufferData(GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM,
- resource->size.height() *
- RoundUp(bytes_per_pixel * resource->size.width(), 4u),
- NULL,
- GL_DYNAMIC_DRAW);
+ gl->BufferData(
+ GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM,
+ resource->size.height() *
+ MathUtil::RoundUp(bytes_per_pixel * resource->size.width(), 4u),
+ NULL, GL_DYNAMIC_DRAW);
gl->BindBuffer(GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM, 0);
}
diff --git a/cc/resources/texture_uploader.cc b/cc/resources/texture_uploader.cc
index 89271bd..1d6630b 100644
--- a/cc/resources/texture_uploader.cc
+++ b/cc/resources/texture_uploader.cc
@@ -9,7 +9,7 @@
#include "base/metrics/histogram.h"
#include "base/trace_event/trace_event.h"
-#include "cc/base/util.h"
+#include "cc/base/math_util.h"
#include "cc/resources/resource.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_interface.h"
@@ -191,7 +191,7 @@ void TextureUploader::UploadWithTexSubImage(const uint8* image,
// Use 4-byte row alignment (OpenGL default) for upload performance.
// Assuming that GL_UNPACK_ALIGNMENT has not changed from default.
unsigned upload_image_stride =
- RoundUp(bytes_per_pixel * source_rect.width(), 4u);
+ MathUtil::RoundUp(bytes_per_pixel * source_rect.width(), 4u);
if (upload_image_stride == image_rect.width() * bytes_per_pixel &&
!offset.x()) {
@@ -246,7 +246,7 @@ void TextureUploader::UploadWithMapTexSubImage(const uint8* image,
// Use 4-byte row alignment (OpenGL default) for upload performance.
// Assuming that GL_UNPACK_ALIGNMENT has not changed from default.
unsigned upload_image_stride =
- RoundUp(bytes_per_pixel * source_rect.width(), 4u);
+ MathUtil::RoundUp(bytes_per_pixel * source_rect.width(), 4u);
// Upload tile data via a mapped transfer buffer
uint8* pixel_dest =
diff --git a/cc/resources/texture_uploader_unittest.cc b/cc/resources/texture_uploader_unittest.cc
index b168962..9bd8f9d 100644
--- a/cc/resources/texture_uploader_unittest.cc
+++ b/cc/resources/texture_uploader_unittest.cc
@@ -4,7 +4,7 @@
#include "cc/resources/texture_uploader.h"
-#include "cc/base/util.h"
+#include "cc/base/math_util.h"
#include "cc/resources/prioritized_resource.h"
#include "gpu/command_buffer/client/gles2_interface_stub.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -129,7 +129,7 @@ class TextureUploadTestContext : public gpu::gles2::GLES2InterfaceStub {
// We'll expect the first byte of every row to be 0x1, and the last byte to
// be 0x2.
const unsigned int stride =
- RoundUp(bytes_per_pixel * width, unpack_alignment_);
+ MathUtil::RoundUp(bytes_per_pixel * width, unpack_alignment_);
for (GLsizei row = 0; row < height; ++row) {
const uint8* row_bytes =
bytes + (xoffset * bytes_per_pixel + (yoffset + row) * stride);
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index 2e475cb..f09650e 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -8,7 +8,7 @@
#include "base/bind.h"
#include "base/trace_event/trace_event.h"
-#include "cc/base/util.h"
+#include "cc/base/math_util.h"
#include "cc/output/gl_renderer.h"
#include "cc/resources/resource_provider.h"
#include "gpu/GLES2/gl2extchromium.h"
@@ -336,8 +336,8 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
size_t bytes_per_pixel = BitsPerPixel(plane_resource.resource_format) / 8;
// Use 4-byte row alignment (OpenGL default) for upload performance.
// Assuming that GL_UNPACK_ALIGNMENT has not changed from default.
- size_t upload_image_stride =
- RoundUp<size_t>(bytes_per_pixel * resource_size_pixels.width(), 4u);
+ size_t upload_image_stride = MathUtil::RoundUp<size_t>(
+ bytes_per_pixel * resource_size_pixels.width(), 4u);
const uint8_t* pixels;
if (upload_image_stride == video_stride_pixels * bytes_per_pixel) {
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 3be7e62..0adf8db 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -22,7 +22,6 @@
#include "cc/animation/scrollbar_animation_controller.h"
#include "cc/animation/timing_function.h"
#include "cc/base/math_util.h"
-#include "cc/base/util.h"
#include "cc/debug/benchmark_instrumentation.h"
#include "cc/debug/debug_rect_history.h"
#include "cc/debug/devtools_instrumentation.h"
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 14196fb..41dc1fa 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -16,7 +16,6 @@
#include "cc/animation/scrollbar_animation_controller_thinning.h"
#include "cc/base/math_util.h"
#include "cc/base/synced_property.h"
-#include "cc/base/util.h"
#include "cc/debug/devtools_instrumentation.h"
#include "cc/debug/traced_value.h"
#include "cc/input/layer_scroll_offset_delegate.h"