OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/printing/pdf_to_emf_converter.h" | 5 #include "chrome/browser/printing/pdf_to_emf_converter.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 Emf::Enumerator emf_enum(emf, nullptr, nullptr); | 366 Emf::Enumerator emf_enum(emf, nullptr, nullptr); |
367 for (const Emf::Record& record : emf_enum) { | 367 for (const Emf::Record& record : emf_enum) { |
368 auto* emf_record = record.record(); | 368 auto* emf_record = record.record(); |
369 if (emf_record->iType != EMR_GDICOMMENT) | 369 if (emf_record->iType != EMR_GDICOMMENT) |
370 continue; | 370 continue; |
371 | 371 |
372 const EMRGDICOMMENT* comment = | 372 const EMRGDICOMMENT* comment = |
373 reinterpret_cast<const EMRGDICOMMENT*>(emf_record); | 373 reinterpret_cast<const EMRGDICOMMENT*>(emf_record); |
374 const char* data = reinterpret_cast<const char*>(comment->Data); | 374 const char* data = reinterpret_cast<const char*>(comment->Data); |
375 const uint16_t* ptr = reinterpret_cast<const uint16_t*>(data); | 375 const uint16_t* ptr = reinterpret_cast<const uint16_t*>(data); |
376 int ret = | 376 int ret = ExtEscape(hdc, PASSTHROUGH, 2 + *ptr, data, 0, nullptr); |
377 ExtEscape(hdc, POSTSCRIPT_PASSTHROUGH, 2 + *ptr, data, 0, nullptr); | |
378 DCHECK_EQ(*ptr, ret); | 377 DCHECK_EQ(*ptr, ret); |
379 } | 378 } |
380 } | 379 } |
381 Close(); | 380 Close(); |
382 return true; | 381 return true; |
383 } | 382 } |
384 | 383 |
385 PdfConverterUtilityProcessHostClient::PdfConverterUtilityProcessHostClient( | 384 PdfConverterUtilityProcessHostClient::PdfConverterUtilityProcessHostClient( |
386 base::WeakPtr<PdfConverterImpl> converter, | 385 base::WeakPtr<PdfConverterImpl> converter, |
387 const PdfRenderSettings& settings) | 386 const PdfRenderSettings& settings) |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 std::unique_ptr<PdfConverterImpl> converter = | 639 std::unique_ptr<PdfConverterImpl> converter = |
641 base::MakeUnique<PdfConverterImpl>(); | 640 base::MakeUnique<PdfConverterImpl>(); |
642 converter->Start( | 641 converter->Start( |
643 new PdfConverterUtilityProcessHostClient(converter->GetWeakPtr(), | 642 new PdfConverterUtilityProcessHostClient(converter->GetWeakPtr(), |
644 conversion_settings), | 643 conversion_settings), |
645 data, start_callback); | 644 data, start_callback); |
646 return std::move(converter); | 645 return std::move(converter); |
647 } | 646 } |
648 | 647 |
649 } // namespace printing | 648 } // namespace printing |
OLD | NEW |