diff options
author | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-28 09:46:00 +0000 |
---|---|---|
committer | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-28 09:46:00 +0000 |
commit | 4ebf5d12a9da2fe381b5bc6e53eba76a2abed8d4 (patch) | |
tree | 8709d2a1c9b6afcff614c4d58b774cb2ba89ff31 /printing/pdf_ps_metafile_cairo.cc | |
parent | fae8f2508f0927d4099fa78be85f089bae55575c (diff) | |
download | chromium_src-4ebf5d12a9da2fe381b5bc6e53eba76a2abed8d4.zip chromium_src-4ebf5d12a9da2fe381b5bc6e53eba76a2abed8d4.tar.gz chromium_src-4ebf5d12a9da2fe381b5bc6e53eba76a2abed8d4.tar.bz2 |
Create constant variables kPointsPerInch and kPixelsPerInch and conversion functions.
BUG=47277
TEST=units_unittest.cc
Review URL: http://codereview.chromium.org/2877001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50968 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/pdf_ps_metafile_cairo.cc')
-rw-r--r-- | printing/pdf_ps_metafile_cairo.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/printing/pdf_ps_metafile_cairo.cc b/printing/pdf_ps_metafile_cairo.cc index b87992f..96b72c5 100644 --- a/printing/pdf_ps_metafile_cairo.cc +++ b/printing/pdf_ps_metafile_cairo.cc @@ -14,17 +14,11 @@ #include "base/file_descriptor_posix.h" #include "base/file_util.h" #include "base/logging.h" +#include "printing/units.h" #include "skia/ext/vector_platform_device_linux.h" namespace { -// The hardcoded margins, in points. These values are based on 72 dpi, -// with approximately 0.25 margins on top, left, and right, and 0.56 on bottom. -const double kTopMargin = 0.25 * 72.0; -const double kBottomMargin = 0.56 * 72.0; -const double kLeftMargin = 0.25 * 72.0; -const double kRightMargin = 0.25 * 72.0; - // Tests if |surface| is valid. bool IsSurfaceValid(cairo_surface_t* surface) { return cairo_surface_status(surface) == CAIRO_STATUS_SUCCESS; @@ -249,4 +243,9 @@ void PdfPsMetafile::CleanUpAll() { skia::VectorPlatformDevice::ClearFontCache(); } +const double PdfPsMetafile::kTopMargin = 0.25 * printing::kPointsPerInch; +const double PdfPsMetafile::kBottomMargin = 0.56 * printing::kPointsPerInch; +const double PdfPsMetafile::kLeftMargin = 0.25 * printing::kPointsPerInch; +const double PdfPsMetafile::kRightMargin = 0.25 * printing::kPointsPerInch; + } // namespace printing |