OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 2 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
3 * Copyright (C) 2007 Apple Inc. | 3 * Copyright (C) 2007 Apple Inc. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 void PrintContext::begin(float width, float height) { | 166 void PrintContext::begin(float width, float height) { |
167 ASSERT(width > 0); | 167 ASSERT(width > 0); |
168 ASSERT(height > 0); | 168 ASSERT(height > 0); |
169 | 169 |
170 // This function can be called multiple times to adjust printing parameters | 170 // This function can be called multiple times to adjust printing parameters |
171 // without going back to screen mode. | 171 // without going back to screen mode. |
172 m_isPrinting = true; | 172 m_isPrinting = true; |
173 | 173 |
174 FloatSize originalPageSize = FloatSize(width, height); | 174 FloatSize originalPageSize = FloatSize(width, height); |
175 FloatSize minLayoutSize = m_frame->resizePageRectsKeepingRatio( | 175 FloatSize minLayoutSize = m_frame->resizePageRectsKeepingRatio( |
176 originalPageSize, FloatSize(width * printingMinimumShrinkFactor, | 176 originalPageSize, |
177 height * printingMinimumShrinkFactor)); | 177 FloatSize(width * printingMinimumShrinkFactor, |
| 178 height * printingMinimumShrinkFactor)); |
178 | 179 |
179 // This changes layout, so callers need to make sure that they don't paint to | 180 // This changes layout, so callers need to make sure that they don't paint to |
180 // screen while in printing mode. | 181 // screen while in printing mode. |
181 m_frame->setPrinting( | 182 m_frame->setPrinting( |
182 true, minLayoutSize, originalPageSize, | 183 true, minLayoutSize, originalPageSize, |
183 printingMaximumShrinkFactor / printingMinimumShrinkFactor); | 184 printingMaximumShrinkFactor / printingMinimumShrinkFactor); |
184 } | 185 } |
185 | 186 |
186 void PrintContext::end() { | 187 void PrintContext::end() { |
187 ASSERT(m_isPrinting); | 188 ASSERT(m_isPrinting); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 printContext.computePageRectsWithPageSize(scaledPageSize); | 343 printContext.computePageRectsWithPageSize(scaledPageSize); |
343 return printContext.pageCount(); | 344 return printContext.pageCount(); |
344 } | 345 } |
345 | 346 |
346 DEFINE_TRACE(PrintContext) { | 347 DEFINE_TRACE(PrintContext) { |
347 visitor->trace(m_frame); | 348 visitor->trace(m_frame); |
348 visitor->trace(m_linkedDestinations); | 349 visitor->trace(m_linkedDestinations); |
349 } | 350 } |
350 | 351 |
351 } // namespace blink | 352 } // namespace blink |
OLD | NEW |