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

Unified Diff: printing/print_settings.h

Issue 2795453002: Use DPI from Print Preview on Windows, handle non square (Closed)
Patch Set: Created 3 years, 9 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
Index: printing/print_settings.h
diff --git a/printing/print_settings.h b/printing/print_settings.h
index 1311ddbeb911f30b9ca39335c0b679ec6f711bab..fa389bb10109e438e3df1e44ac1e87150e57ca34 100644
--- a/printing/print_settings.h
+++ b/printing/print_settings.h
@@ -108,6 +108,13 @@ class PRINTING_EXPORT PrintSettings {
void set_rasterize_pdf(bool rasterize_pdf) { rasterize_pdf_ = rasterize_pdf; }
bool rasterize_pdf() const { return rasterize_pdf_; }
+ void set_desired_dpi(int dpi_horizontal, int dpi_vertical) {
+#if defined(OS_WIN)
+ desired_dpi_[0] = dpi_horizontal;
+ desired_dpi_[1] = dpi_vertical;
+#endif
+ }
+
void set_supports_alpha_blend(bool supports_alpha_blend) {
supports_alpha_blend_ = supports_alpha_blend;
}
@@ -157,7 +164,8 @@ class PRINTING_EXPORT PrintSettings {
void set_duplex_mode(DuplexMode duplex_mode) { duplex_mode_ = duplex_mode; }
DuplexMode duplex_mode() const { return duplex_mode_; }
- int desired_dpi() const { return desired_dpi_; }
+ int desired_dpi_horizontal() const { return desired_dpi_[0]; }
+ int desired_dpi_vertical() const { return desired_dpi_[1]; }
#if defined(OS_WIN)
void set_print_text_with_gdi(bool use_gdi) { print_text_with_gdi_ = use_gdi; }
@@ -185,7 +193,7 @@ class PRINTING_EXPORT PrintSettings {
// Desired visible dots per inch rendering for output. Printing should be
Lei Zhang 2017/03/31 22:21:13 Observation: From what I can tell, this was only u
rbpotter 2017/04/01 00:08:02 Removed it.
// scaled to ScreenDpi/dpix*desired_dpi.
- int desired_dpi_;
+ int desired_dpi_[2];
// Indicates if the user only wants to print the current selection.
bool selection_only_;

Powered by Google App Engine
This is Rietveld 408576698