OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/image.h" | 5 #include "printing/image.h" |
6 | 6 |
7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
8 | 8 |
| 9 #include "base/logging.h" |
9 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
10 #include "gfx/rect.h" | 11 #include "gfx/rect.h" |
11 | 12 |
12 namespace printing { | 13 namespace printing { |
13 | 14 |
14 bool Image::LoadMetafile(const NativeMetafile& metafile) { | 15 bool Image::LoadMetafile(const NativeMetafile& metafile) { |
15 // The printing system uses single-page metafiles (page indexes are 1-based). | 16 // The printing system uses single-page metafiles (page indexes are 1-based). |
16 const unsigned int page_number = 1; | 17 const unsigned int page_number = 1; |
17 gfx::Rect rect(metafile.GetPageBounds(page_number)); | 18 gfx::Rect rect(metafile.GetPageBounds(page_number)); |
18 if (rect.width() < 1 || rect.height() < 1) | 19 if (rect.width() < 1 || rect.height() < 1) |
(...skipping 14 matching lines...) Expand all Loading... |
33 DCHECK(bitmap_context.get()); | 34 DCHECK(bitmap_context.get()); |
34 | 35 |
35 metafile.RenderPage(page_number, bitmap_context, | 36 metafile.RenderPage(page_number, bitmap_context, |
36 CGRectMake(0, 0, size_.width(), size_.height()), | 37 CGRectMake(0, 0, size_.width(), size_.height()), |
37 true, false, false, false); | 38 true, false, false, false); |
38 | 39 |
39 return true; | 40 return true; |
40 } | 41 } |
41 | 42 |
42 } // namespace printing | 43 } // namespace printing |
OLD | NEW |