Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3505)

Unified Diff: cc/texture_uploader.cc

Issue 11470024: Don't spam the GPU process with memory usage stats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/single_thread_proxy.cc ('k') | cc/thread_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/texture_uploader.cc
diff --git a/cc/texture_uploader.cc b/cc/texture_uploader.cc
index 6ff13c70a614336a3aaa705b80e6b4949ca918bb..bac2871c4390c62a4986453c44e3d37a5c51e6d4 100644
--- a/cc/texture_uploader.cc
+++ b/cc/texture_uploader.cc
@@ -12,6 +12,7 @@
#include "base/metrics/histogram.h"
#include "cc/prioritized_resource.h"
#include "cc/resource.h"
+#include "cc/util.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
#include "ui/gfx/rect.h"
@@ -32,11 +33,6 @@ static const double defaultEstimatedTexturesPerSecond = 48.0 * 60.0;
// Flush interval when performing texture uploads.
const int textureUploadFlushPeriod = 4;
-unsigned int RoundUp(unsigned int n, unsigned int mul)
-{
- return (((n - 1) / mul) * mul) + mul;
-}
-
} // anonymous namespace
namespace cc {
@@ -237,7 +233,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 int upload_image_stride =
- RoundUp(bytes_per_pixel * source_rect.width(), 4);
+ RoundUp(bytes_per_pixel * source_rect.width(), 4u);
if (upload_image_stride == image_rect.width() * bytes_per_pixel && !offset.x()) {
pixel_source = &image[image_rect.width() * bytes_per_pixel * offset.y()];
@@ -307,7 +303,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 int upload_image_stride =
- RoundUp(bytes_per_pixel * source_rect.width(), 4);
+ RoundUp(bytes_per_pixel * source_rect.width(), 4u);
// Upload tile data via a mapped transfer buffer
uint8* pixel_dest = static_cast<uint8*>(
« no previous file with comments | « cc/single_thread_proxy.cc ('k') | cc/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698