OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EMF_WIN_H_ | 5 #ifndef PRINTING_EMF_WIN_H_ |
6 #define PRINTING_EMF_WIN_H_ | 6 #define PRINTING_EMF_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return emf_; | 91 return emf_; |
92 } | 92 } |
93 | 93 |
94 // Returns true if metafile contains alpha blend. | 94 // Returns true if metafile contains alpha blend. |
95 bool IsAlphaBlendUsed() const; | 95 bool IsAlphaBlendUsed() const; |
96 | 96 |
97 // Returns new metafile with only bitmap created by playback of the current | 97 // Returns new metafile with only bitmap created by playback of the current |
98 // metafile. Returns NULL if fails. | 98 // metafile. Returns NULL if fails. |
99 Emf* RasterizeMetafile(int raster_area_in_pixels) const; | 99 Emf* RasterizeMetafile(int raster_area_in_pixels) const; |
100 | 100 |
| 101 // Returns new metafile where AlphaBlend replaced by bitmaps. Returns NULL |
| 102 // if fails. |
| 103 Emf* RasterizeAlphaBlend() const; |
| 104 |
101 private: | 105 private: |
102 FRIEND_TEST_ALL_PREFIXES(EmfTest, DC); | 106 FRIEND_TEST_ALL_PREFIXES(EmfTest, DC); |
103 FRIEND_TEST_ALL_PREFIXES(EmfPrintingTest, PageBreak); | 107 FRIEND_TEST_ALL_PREFIXES(EmfPrintingTest, PageBreak); |
104 FRIEND_TEST_ALL_PREFIXES(EmfTest, FileBackedEmf); | 108 FRIEND_TEST_ALL_PREFIXES(EmfTest, FileBackedEmf); |
105 | 109 |
106 // Retrieves the underlying data stream. It is a helper function. | 110 // Retrieves the underlying data stream. It is a helper function. |
107 bool GetDataAsVector(std::vector<uint8>* buffer) const; | 111 bool GetDataAsVector(std::vector<uint8>* buffer) const; |
108 | 112 |
109 // Playbacks safely one EMF record. | 113 // Playbacks safely one EMF record. |
110 static int CALLBACK SafePlaybackProc(HDC hdc, | 114 static int CALLBACK SafePlaybackProc(HDC hdc, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 std::vector<Record> items_; | 196 std::vector<Record> items_; |
193 | 197 |
194 EnumerationContext context_; | 198 EnumerationContext context_; |
195 | 199 |
196 DISALLOW_COPY_AND_ASSIGN(Enumerator); | 200 DISALLOW_COPY_AND_ASSIGN(Enumerator); |
197 }; | 201 }; |
198 | 202 |
199 } // namespace printing | 203 } // namespace printing |
200 | 204 |
201 #endif // PRINTING_EMF_WIN_H_ | 205 #endif // PRINTING_EMF_WIN_H_ |
OLD | NEW |