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

Unified Diff: pdf/out_of_process_instance.cc

Issue 372273005: Fixes for re-enabling more MSVC level 4 warnings: pdf/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update pdfium Created 6 years, 5 months 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/out_of_process_instance.h ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/out_of_process_instance.cc
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index a08f8b053fd1cbe74273285136fb4bb59ea7c266..6f728b7662e766f111a56a0e2c45038b85ea2afb 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -629,11 +629,7 @@ void OutOfProcessInstance::OnPaint(
if (first_paint_) {
first_paint_ = false;
pp::Rect rect = pp::Rect(pp::Point(), image_data_.size());
- unsigned int color = kBackgroundColorA << 24 |
- kBackgroundColorR << 16 |
- kBackgroundColorG << 8 |
- kBackgroundColorB;
- FillRect(rect, color);
+ FillRect(rect, kBackgroundColor);
ready->push_back(PaintManager::ReadyRect(rect, image_data_, true));
}
@@ -724,12 +720,10 @@ void OutOfProcessInstance::CalculateBackgroundParts() {
// Add the left, right, and bottom rectangles. Note: we assume only
// horizontal centering.
- BackgroundPart part;
- part.color = kBackgroundColorA << 24 |
- kBackgroundColorR << 16 |
- kBackgroundColorG << 8 |
- kBackgroundColorB;
- part.location = pp::Rect(0, 0, left_width, bottom);
+ BackgroundPart part = {
+ pp::Rect(0, 0, left_width, bottom),
+ kBackgroundColor
+ };
if (!part.location.IsEmpty())
background_parts_.push_back(part);
part.location = pp::Rect(right_start, 0, right_width, bottom);
@@ -750,11 +744,11 @@ int OutOfProcessInstance::GetDocumentPixelHeight() const {
ceil(document_size_.height() * zoom_ * device_scale_));
}
-void OutOfProcessInstance::FillRect(const pp::Rect& rect, unsigned int color) {
+void OutOfProcessInstance::FillRect(const pp::Rect& rect, uint32 color) {
DCHECK(!image_data_.is_null() || rect.IsEmpty());
- unsigned int* buffer_start = static_cast<unsigned int*>(image_data_.data());
+ uint32* buffer_start = static_cast<uint32*>(image_data_.data());
int stride = image_data_.stride();
- unsigned int* ptr = buffer_start + rect.y() * stride / 4 + rect.x();
+ uint32* ptr = buffer_start + rect.y() * stride / 4 + rect.x();
int height = rect.height();
int width = rect.width();
for (int y = 0; y < height; ++y) {
« no previous file with comments | « pdf/out_of_process_instance.h ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698