OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "printing/printed_document.h" | 5 #include "printing/printed_document.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "printing/page_number.h" | 10 #include "printing/page_number.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // Setup the matrix to translate and scale to the right place. Take in | 107 // Setup the matrix to translate and scale to the right place. Take in |
108 // account the actual shrinking factor. | 108 // account the actual shrinking factor. |
109 // Note that the printing output is relative to printable area of the page. | 109 // Note that the printing output is relative to printable area of the page. |
110 // That is 0,0 is offset by PHYSICALOFFSETX/Y from the page. | 110 // That is 0,0 is offset by PHYSICALOFFSETX/Y from the page. |
111 SimpleModifyWorldTransform( | 111 SimpleModifyWorldTransform( |
112 context, | 112 context, |
113 content_area.x() - page_setup.printable_area().x(), | 113 content_area.x() - page_setup.printable_area().x(), |
114 content_area.y() - page_setup.printable_area().y(), | 114 content_area.y() - page_setup.printable_area().y(), |
115 mutable_.shrink_factor); | 115 mutable_.shrink_factor); |
116 | 116 |
117 if (!page.native_metafile()->SafePlayback(context)) { | 117 if (!page.metafile()->SafePlayback(context)) { |
118 NOTREACHED(); | 118 NOTREACHED(); |
119 } | 119 } |
120 | 120 |
121 BOOL res = RestoreDC(context, saved_state); | 121 BOOL res = RestoreDC(context, saved_state); |
122 DCHECK_NE(res, 0); | 122 DCHECK_NE(res, 0); |
123 } | 123 } |
124 | 124 |
125 // Print the header and footer. Offset by printable area offset (see comment | 125 // Print the header and footer. Offset by printable area offset (see comment |
126 // above). | 126 // above). |
127 SimpleModifyWorldTransform( | 127 SimpleModifyWorldTransform( |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 DCHECK(result == SIMPLEREGION || result == COMPLEXREGION); | 182 DCHECK(result == SIMPLEREGION || result == COMPLEXREGION); |
183 TextOut(context, | 183 TextOut(context, |
184 bounds.x(), bounds.y(), | 184 bounds.x(), bounds.y(), |
185 text.c_str(), | 185 text.c_str(), |
186 static_cast<int>(text.size())); | 186 static_cast<int>(text.size())); |
187 int res = RestoreDC(context, saved_state); | 187 int res = RestoreDC(context, saved_state); |
188 DCHECK_NE(res, 0); | 188 DCHECK_NE(res, 0); |
189 } | 189 } |
190 | 190 |
191 } // namespace printing | 191 } // namespace printing |
OLD | NEW |