Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: printing/metafile.h

Issue 6879098: Fix print preview clipping issues due to scaling. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Proposed modification to metafile interface. Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef PRINTING_METAFILE_H_ 5 #ifndef PRINTING_METAFILE_H_
6 #define PRINTING_METAFILE_H_ 6 #define PRINTING_METAFILE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "ui/gfx/native_widget_types.h" 10 #include "ui/gfx/native_widget_types.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 // Initializes the metafile with the data in |src_buffer|. Returns true 51 // Initializes the metafile with the data in |src_buffer|. Returns true
52 // on success. 52 // on success.
53 // Note: It should only be called from within the browser process. 53 // Note: It should only be called from within the browser process.
54 virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size) = 0; 54 virtual bool InitFromData(const void* src_buffer, uint32 src_buffer_size) = 0;
55 55
56 // This method calls StartPage and then returns an appropriate 56 // This method calls StartPage and then returns an appropriate
57 // VectorPlatformDevice implementation bound to the context created by 57 // VectorPlatformDevice implementation bound to the context created by
58 // StartPage or NULL on error. 58 // StartPage or NULL on error.
59 virtual skia::PlatformDevice* StartPageForVectorCanvas( 59 virtual skia::PlatformDevice* StartPageForVectorCanvas(
60 const gfx::Size& page_size, const gfx::Point& content_origin, 60 const gfx::Size& page_size,
61 const gfx::Size& content_size,
vandebo (ex-Chrome) 2011/04/25 22:11:47 Instead of content_size and content_origin, we sho
Chris Guillory 2011/04/25 23:47:12 Done.
62 const gfx::Point& content_origin,
61 const float& scale_factor) = 0; 63 const float& scale_factor) = 0;
62 64
63 // Prepares a context for rendering a new page at the specified 65 // Prepares a context for rendering a new page at the specified
64 // |content_origin| with the given |page_size| and a |scale_factor| to use for 66 // |content_origin| with the given |page_size| and a |scale_factor| to use for
65 // the drawing. The units are in points (=1/72 in). Returns true on success. 67 // the drawing. The units are in points (=1/72 in). Returns true on success.
66 virtual bool StartPage(const gfx::Size& page_size, 68 virtual bool StartPage(const gfx::Size& page_size,
67 const gfx::Point& content_origin, 69 const gfx::Point& content_origin,
vandebo (ex-Chrome) 2011/04/25 22:11:47 StartPage and StartPageForVectorCanvas should have
Chris Guillory 2011/04/25 23:47:12 Done.
68 const float& scale_factor) = 0; 70 const float& scale_factor) = 0;
69 71
70 // Closes the current page and destroys the context used in rendering that 72 // Closes the current page and destroys the context used in rendering that
71 // page. The results of current page will be appended into the underlying 73 // page. The results of current page will be appended into the underlying
72 // data stream. Returns true on success. 74 // data stream. Returns true on success.
73 virtual bool FinishPage() = 0; 75 virtual bool FinishPage() = 0;
74 76
75 // Closes the metafile. No further rendering is allowed (the current page 77 // Closes the metafile. No further rendering is allowed (the current page
76 // is implicitly closed). 78 // is implicitly closed).
77 virtual bool FinishDocument() = 0; 79 virtual bool FinishDocument() = 0;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // Saves the underlying data to the file associated with fd. This function 144 // Saves the underlying data to the file associated with fd. This function
143 // should ONLY be called after the metafile is closed. 145 // should ONLY be called after the metafile is closed.
144 // Returns true if writing succeeded. 146 // Returns true if writing succeeded.
145 virtual bool SaveToFD(const base::FileDescriptor& fd) const = 0; 147 virtual bool SaveToFD(const base::FileDescriptor& fd) const = 0;
146 #endif // if defined(OS_CHROMEOS) 148 #endif // if defined(OS_CHROMEOS)
147 }; 149 };
148 150
149 } // namespace printing 151 } // namespace printing
150 152
151 #endif // PRINTING_METAFILE_H_ 153 #endif // PRINTING_METAFILE_H_
OLDNEW
« no previous file with comments | « printing/emf_win.cc ('k') | printing/pdf_metafile_skia.h » ('j') | printing/pdf_metafile_skia.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698