| 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> | |
| 9 #include <stddef.h> | 8 #include <stddef.h> |
| 10 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <windows.h> |
| 11 | 11 |
| 12 #include <memory> |
| 12 #include <vector> | 13 #include <vector> |
| 13 | 14 |
| 14 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 15 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "base/memory/scoped_ptr.h" | |
| 18 #include "printing/metafile.h" | 18 #include "printing/metafile.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class FilePath; | 21 class FilePath; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace gfx { | 24 namespace gfx { |
| 25 class Rect; | 25 class Rect; |
| 26 class Size; | 26 class Size; |
| 27 } | 27 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 bool Playback(HDC hdc, const RECT* rect) const override; | 81 bool Playback(HDC hdc, const RECT* rect) const override; |
| 82 bool SafePlayback(HDC hdc) const override; | 82 bool SafePlayback(HDC hdc) const override; |
| 83 | 83 |
| 84 HENHMETAFILE emf() const { return emf_; } | 84 HENHMETAFILE emf() const { return emf_; } |
| 85 | 85 |
| 86 // Returns true if metafile contains alpha blend. | 86 // Returns true if metafile contains alpha blend. |
| 87 bool IsAlphaBlendUsed() const; | 87 bool IsAlphaBlendUsed() const; |
| 88 | 88 |
| 89 // Returns new metafile with only bitmap created by playback of the current | 89 // Returns new metafile with only bitmap created by playback of the current |
| 90 // metafile. Returns NULL if fails. | 90 // metafile. Returns NULL if fails. |
| 91 scoped_ptr<Emf> RasterizeMetafile(int raster_area_in_pixels) const; | 91 std::unique_ptr<Emf> RasterizeMetafile(int raster_area_in_pixels) const; |
| 92 | 92 |
| 93 // Returns new metafile where AlphaBlend replaced by bitmaps. Returns NULL | 93 // Returns new metafile where AlphaBlend replaced by bitmaps. Returns NULL |
| 94 // if fails. | 94 // if fails. |
| 95 scoped_ptr<Emf> RasterizeAlphaBlend() const; | 95 std::unique_ptr<Emf> RasterizeAlphaBlend() const; |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 FRIEND_TEST_ALL_PREFIXES(EmfTest, DC); | 98 FRIEND_TEST_ALL_PREFIXES(EmfTest, DC); |
| 99 FRIEND_TEST_ALL_PREFIXES(EmfPrintingTest, PageBreak); | 99 FRIEND_TEST_ALL_PREFIXES(EmfPrintingTest, PageBreak); |
| 100 FRIEND_TEST_ALL_PREFIXES(EmfTest, FileBackedEmf); | 100 FRIEND_TEST_ALL_PREFIXES(EmfTest, FileBackedEmf); |
| 101 | 101 |
| 102 // Playbacks safely one EMF record. | 102 // Playbacks safely one EMF record. |
| 103 static int CALLBACK SafePlaybackProc(HDC hdc, | 103 static int CALLBACK SafePlaybackProc(HDC hdc, |
| 104 HANDLETABLE* handle_table, | 104 HANDLETABLE* handle_table, |
| 105 const ENHMETARECORD* record, | 105 const ENHMETARECORD* record, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 std::vector<Record> items_; | 185 std::vector<Record> items_; |
| 186 | 186 |
| 187 EnumerationContext context_; | 187 EnumerationContext context_; |
| 188 | 188 |
| 189 DISALLOW_COPY_AND_ASSIGN(Enumerator); | 189 DISALLOW_COPY_AND_ASSIGN(Enumerator); |
| 190 }; | 190 }; |
| 191 | 191 |
| 192 } // namespace printing | 192 } // namespace printing |
| 193 | 193 |
| 194 #endif // PRINTING_EMF_WIN_H_ | 194 #endif // PRINTING_EMF_WIN_H_ |
| OLD | NEW |