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 #include "printing/emf_win.h" | 5 #include "printing/emf_win.h" |
6 | 6 |
7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 res = true; | 442 res = true; |
443 break; | 443 break; |
444 default: { | 444 default: { |
445 res = Play(context); | 445 res = Play(context); |
446 break; | 446 break; |
447 } | 447 } |
448 } | 448 } |
449 return res; | 449 return res; |
450 } | 450 } |
451 | 451 |
452 SkBaseDevice* Emf::StartPageForVectorCanvas( | |
453 const gfx::Size& page_size, const gfx::Rect& content_area, | |
454 const float& scale_factor) { | |
455 if (!StartPage(page_size, content_area, scale_factor)) | |
456 return NULL; | |
457 | |
458 return skia::VectorPlatformDeviceEmf::CreateDevice(page_size.width(), | |
459 page_size.height(), | |
460 true, hdc_); | |
461 } | |
462 | |
463 bool Emf::StartPage(const gfx::Size& /*page_size*/, | 452 bool Emf::StartPage(const gfx::Size& /*page_size*/, |
464 const gfx::Rect& /*content_area*/, | 453 const gfx::Rect& /*content_area*/, |
465 const float& /*scale_factor*/) { | 454 const float& /*scale_factor*/) { |
466 return true; | 455 return true; |
467 } | 456 } |
468 | 457 |
469 bool Emf::FinishPage() { | 458 bool Emf::FinishPage() { |
470 return true; | 459 return true; |
471 } | 460 } |
472 | 461 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 RECT rect = page_bounds.ToRECT(); | 579 RECT rect = page_bounds.ToRECT(); |
591 ::EnumEnhMetaFile(hdc, emf(), &RasterizeAlphaBlendProc, &bitmap_dc, &rect); | 580 ::EnumEnhMetaFile(hdc, emf(), &RasterizeAlphaBlendProc, &bitmap_dc, &rect); |
592 | 581 |
593 result->FinishDocument(); | 582 result->FinishDocument(); |
594 | 583 |
595 return result.Pass(); | 584 return result.Pass(); |
596 } | 585 } |
597 | 586 |
598 | 587 |
599 } // namespace printing | 588 } // namespace printing |
OLD | NEW |