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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 874663006: Make the PDF viewer background color a property of the instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/pdfium/pdfium_engine.h ('k') | pdf/preview_mode_client.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 2990f40b9a2fd9242f9b42601a39a4d59352bbad..294ab2fdf0d850171b033a040afd22953bd5f309 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -600,7 +600,6 @@ 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);
@@ -2368,14 +2367,6 @@ 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.
@@ -2947,7 +2938,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(), background_color_);
+ left.height(), client_->GetBackgroundColor());
}
if (page_rect.right() < document_size_.width()) {
@@ -2961,7 +2952,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(), background_color_);
+ right.height(), client_->GetBackgroundColor());
}
// Paint separator.
@@ -2973,7 +2964,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(), background_color_);
+ bottom.height(), client_->GetBackgroundColor());
}
void PDFiumEngine::PaintPageShadow(int progressive_index,
@@ -3425,7 +3416,8 @@ 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, background_color_));
+ page_shadow_.reset(new ShadowMatrix(depth, factor,
+ client_->GetBackgroundColor()));
DCHECK(!image_data->is_null());
DrawShadow(image_data, shadow_rect, page_rect, clip_rect, *page_shadow_);
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | pdf/preview_mode_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698