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

Unified Diff: pdf/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/instance.h ('k') | pdf/out_of_process_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/instance.cc
diff --git a/pdf/instance.cc b/pdf/instance.cc
index b0b668070da8d72883c753a204f68330fe4546cd..9dee0f6aaeca5f3b2ff101085ac9a8f92e2ac5bb 100644
--- a/pdf/instance.cc
+++ b/pdf/instance.cc
@@ -768,11 +768,7 @@ void Instance::OnPaint(const std::vector<pp::Rect>& paint_rects,
if (first_paint_) {
first_paint_ = false;
pp::Rect rect = pp::Rect(pp::Point(), plugin_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));
*pending = paint_rects;
return;
@@ -1024,12 +1020,10 @@ void Instance::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);
@@ -1066,17 +1060,17 @@ int Instance::GetDocumentPixelHeight() const {
device_scale_));
}
-void Instance::FillRect(const pp::Rect& rect, unsigned int color) {
+void Instance::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) {
for (int x = 0; x < width; ++x)
*(ptr + x) = color;
- ptr += stride /4;
+ ptr += stride / 4;
}
}
« no previous file with comments | « pdf/instance.h ('k') | pdf/out_of_process_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698