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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 871403005: Switch the background color in PDF Viewer when using Material Design (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits Created 5 years, 11 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
« pdf/pdfium/pdfium_engine.h ('K') | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | 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 4c5ba21d31a7163f683948f76bd1e950f7c4e0e6..15e4a4850092082c4e81d75e0f81ab9204db4b72 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -2366,6 +2366,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 +2945,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 +2959,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 +2971,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 +3423,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_);
« pdf/pdfium/pdfium_engine.h ('K') | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698