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 "printing/page_number.h" | 8 #include "printing/page_number.h" |
9 #include "printing/printed_pages_source.h" | 9 #include "printing/printed_pages_source.h" |
10 #include "printing/printed_page.h" | 10 #include "printing/printed_page.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 #ifndef NDEBUG | 38 #ifndef NDEBUG |
39 { | 39 { |
40 // Make sure the page is from our list. | 40 // Make sure the page is from our list. |
41 base::AutoLock lock(lock_); | 41 base::AutoLock lock(lock_); |
42 DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get()); | 42 DCHECK(&page == mutable_.pages_.find(page.page_number() - 1)->second.get()); |
43 } | 43 } |
44 #endif | 44 #endif |
45 | 45 |
46 DCHECK(context); | 46 DCHECK(context); |
47 | 47 |
48 const printing::PageSetup& page_setup( | 48 const PageSetup& page_setup(immutable_.settings_.page_setup_device_units()); |
49 immutable_.settings_.page_setup_device_units()); | |
50 gfx::Rect content_area; | 49 gfx::Rect content_area; |
51 page.GetCenteredPageContentRect(page_setup.physical_size(), &content_area); | 50 page.GetCenteredPageContentRect(page_setup.physical_size(), &content_area); |
52 | 51 |
53 // Save the state to make sure the context this function call does not modify | 52 // Save the state to make sure the context this function call does not modify |
54 // the device context. | 53 // the device context. |
55 int saved_state = SaveDC(context); | 54 int saved_state = SaveDC(context); |
56 DCHECK_NE(saved_state, 0); | 55 DCHECK_NE(saved_state, 0); |
57 skia::InitializeDC(context); | 56 skia::InitializeDC(context); |
58 { | 57 { |
59 // Save the state (again) to apply the necessary world transformation. | 58 // Save the state (again) to apply the necessary world transformation. |
(...skipping 16 matching lines...) Expand all Loading... |
76 | 75 |
77 BOOL res = RestoreDC(context, saved_state); | 76 BOOL res = RestoreDC(context, saved_state); |
78 DCHECK_NE(res, 0); | 77 DCHECK_NE(res, 0); |
79 } | 78 } |
80 | 79 |
81 int res = RestoreDC(context, saved_state); | 80 int res = RestoreDC(context, saved_state); |
82 DCHECK_NE(res, 0); | 81 DCHECK_NE(res, 0); |
83 } | 82 } |
84 | 83 |
85 } // namespace printing | 84 } // namespace printing |
OLD | NEW |