Index: pdf/pdfium/pdfium_engine.cc |
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc |
index 4c5ba21d31a7163f683948f76bd1e950f7c4e0e6..81fa0594c39f05023030257f4ba3c814ed204a52 100644 |
--- a/pdf/pdfium/pdfium_engine.cc |
+++ b/pdf/pdfium/pdfium_engine.cc |
@@ -599,6 +599,7 @@ PDFiumEngine::PDFiumEngine(PDFEngine::Client* client) |
most_visible_page_(-1), |
called_do_document_action_(false), |
render_grayscale_(false), |
+ background_color_(0), |
progressive_paint_timeout_(0), |
getting_password_(false) { |
find_factory_.Initialize(this); |
@@ -2366,6 +2367,14 @@ int PDFiumEngine::GetNumberOfPages() { |
return pages_.size(); |
} |
+uint32 PDFiumEngine::GetBackgroundColor() { |
+ return background_color_; |
+} |
+ |
+void PDFiumEngine::SetBackgroundColor(uint32 background_color) { |
+ background_color_ = background_color; |
+} |
+ |
pp::VarArray PDFiumEngine::GetBookmarks() { |
pp::VarDictionary dict = TraverseBookmarks(doc_, NULL); |
// The root bookmark contains no useful information. |
@@ -2937,7 +2946,7 @@ void PDFiumEngine::FillPageSides(int progressive_index) { |
FPDFBitmap_FillRect(bitmap, left.x() - dirty_in_screen.x(), |
left.y() - dirty_in_screen.y(), left.width(), |
- left.height(), kBackgroundColor); |
+ left.height(), background_color_); |
} |
if (page_rect.right() < document_size_.width()) { |
@@ -2951,7 +2960,7 @@ void PDFiumEngine::FillPageSides(int progressive_index) { |
FPDFBitmap_FillRect(bitmap, right.x() - dirty_in_screen.x(), |
right.y() - dirty_in_screen.y(), right.width(), |
- right.height(), kBackgroundColor); |
+ right.height(), background_color_); |
} |
// Paint separator. |
@@ -2963,7 +2972,7 @@ void PDFiumEngine::FillPageSides(int progressive_index) { |
FPDFBitmap_FillRect(bitmap, bottom.x() - dirty_in_screen.x(), |
bottom.y() - dirty_in_screen.y(), bottom.width(), |
- bottom.height(), kBackgroundColor); |
+ bottom.height(), background_color_); |
} |
void PDFiumEngine::PaintPageShadow(int progressive_index, |
@@ -3415,7 +3424,7 @@ void PDFiumEngine::DrawPageShadow(const pp::Rect& page_rc, |
// We need to check depth only to verify our copy of shadow matrix is correct. |
if (!page_shadow_.get() || page_shadow_->depth() != depth) |
- page_shadow_.reset(new ShadowMatrix(depth, factor, kBackgroundColor)); |
+ page_shadow_.reset(new ShadowMatrix(depth, factor, background_color_)); |
DCHECK(!image_data->is_null()); |
DrawShadow(image_data, shadow_rect, page_rect, clip_rect, *page_shadow_); |