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

Unified Diff: gpu/tools/compositor_model_bench/render_model_utils.cc

Issue 1542513002: Switch to standard integer types in gpu/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 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
Index: gpu/tools/compositor_model_bench/render_model_utils.cc
diff --git a/gpu/tools/compositor_model_bench/render_model_utils.cc b/gpu/tools/compositor_model_bench/render_model_utils.cc
index 7e1eb5cc3e0816f9a6e1c137ffff5486040ce5d8..e73ebea7938dcc42ac11c0118ac35e2f50798ce4 100644
--- a/gpu/tools/compositor_model_bench/render_model_utils.cc
+++ b/gpu/tools/compositor_model_bench/render_model_utils.cc
@@ -6,6 +6,9 @@
#include "gpu/tools/compositor_model_bench/render_model_utils.h"
+#include <stddef.h>
+#include <stdint.h>
+
#include <cstdlib>
#include <map>
#include <set>
@@ -136,9 +139,9 @@ void TextureGenerator::GenerateImageForTexture(int texID,
int bytes_per_pixel = FormatBytesPerPixel(format);
DCHECK_LE(bytes_per_pixel, 4);
int imgID = images_generated_++;
- image_data_[imgID].reset(new uint8[width*height*bytes_per_pixel]);
+ image_data_[imgID].reset(new uint8_t[width * height * bytes_per_pixel]);
// Pick random colors to use for this texture.
- uint8 random_color[4];
+ uint8_t random_color[4];
for (int c = 0; c < 4; ++c) {
random_color[c] = std::rand() % 255;
}
@@ -148,7 +151,7 @@ void TextureGenerator::GenerateImageForTexture(int texID,
int pix_addr = (y * width + x) * bytes_per_pixel;
for (int c = 0; c < bytes_per_pixel; ++c) {
bool on = ((x/8) + (y/8)) % 2;
- uint8 v = on ? random_color[c] : ~random_color[c];
+ uint8_t v = on ? random_color[c] : ~random_color[c];
(image_data_[imgID])[pix_addr + c] = v;
}
if (bytes_per_pixel == 4) { // Randomize alpha.
« no previous file with comments | « gpu/tools/compositor_model_bench/render_model_utils.h ('k') | gpu/tools/compositor_model_bench/render_models.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698