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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 1533413002: Switch to standard integer types in pdf/. (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
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | pdf/pdfium/pdfium_mem_buffer_file_read.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 5287a2961b8a927f486b3b399113baecee35820d..0528c94ecca007a1e58ec053c96689974027318d 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -5,11 +5,14 @@
#include "pdf/pdfium/pdfium_engine.h"
#include <math.h>
+#include <stddef.h>
+#include <stdint.h>
#include "base/i18n/icu_encoding_detection.h"
#include "base/i18n/icu_string_conversions.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/stl_util.h"
@@ -71,7 +74,7 @@ namespace {
#define kHighlightColorG 193
#define kHighlightColorB 218
-const uint32 kPendingPageColor = 0xFFEEEEEE;
+const uint32_t kPendingPageColor = 0xFFEEEEEE;
#define kFormHighlightColor 0xFFE4DD
#define kFormHighlightAlpha 100
@@ -3102,14 +3105,11 @@ void PDFiumEngine::Highlight(void* buffer,
for (int y = t; y < t + h; ++y) {
for (int x = l; x < l + w; ++x) {
- uint8* pixel = static_cast<uint8*>(buffer) + y * stride + x * 4;
+ uint8_t* pixel = static_cast<uint8_t*>(buffer) + y * stride + x * 4;
// This is our highlight color.
- pixel[0] = static_cast<uint8>(
- pixel[0] * (kHighlightColorB / 255.0));
- pixel[1] = static_cast<uint8>(
- pixel[1] * (kHighlightColorG / 255.0));
- pixel[2] = static_cast<uint8>(
- pixel[2] * (kHighlightColorR / 255.0));
+ pixel[0] = static_cast<uint8_t>(pixel[0] * (kHighlightColorB / 255.0));
+ pixel[1] = static_cast<uint8_t>(pixel[1] * (kHighlightColorG / 255.0));
+ pixel[2] = static_cast<uint8_t>(pixel[2] * (kHighlightColorR / 255.0));
}
}
}
@@ -3381,12 +3381,12 @@ void PDFiumEngine::DrawPageShadow(const pp::Rect& page_rc,
// Page drop shadow parameters.
const double factor = 0.5;
- uint32 depth = std::max(
- std::max(page_rect.x() - shadow_rect.x(),
- page_rect.y() - shadow_rect.y()),
- std::max(shadow_rect.right() - page_rect.right(),
- shadow_rect.bottom() - page_rect.bottom()));
- depth = static_cast<uint32>(depth * 1.5) + 1;
+ uint32_t depth =
+ std::max(std::max(page_rect.x() - shadow_rect.x(),
+ page_rect.y() - shadow_rect.y()),
+ std::max(shadow_rect.right() - page_rect.right(),
+ shadow_rect.bottom() - page_rect.bottom()));
+ depth = static_cast<uint32_t>(depth * 1.5) + 1;
// We need to check depth only to verify our copy of shadow matrix is correct.
if (!page_shadow_.get() || page_shadow_->depth() != depth)
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | pdf/pdfium/pdfium_mem_buffer_file_read.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698