| 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 "skia/ext/vector_platform_device_emf_win.h" | 5 #include "skia/ext/vector_platform_device_emf_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 const RECT* src_rect) { | 688 const RECT* src_rect) { |
| 689 SkASSERT(false); | 689 SkASSERT(false); |
| 690 } | 690 } |
| 691 | 691 |
| 692 void VectorPlatformDeviceEmf::LoadClipRegion() { | 692 void VectorPlatformDeviceEmf::LoadClipRegion() { |
| 693 SkMatrix t; | 693 SkMatrix t; |
| 694 t.reset(); | 694 t.reset(); |
| 695 LoadClippingRegionToDC(hdc_, clip_region_, t); | 695 LoadClippingRegionToDC(hdc_, clip_region_, t); |
| 696 } | 696 } |
| 697 | 697 |
| 698 SkBaseDevice* VectorPlatformDeviceEmf::onCreateDevice(const SkImageInfo& info, | 698 SkBaseDevice* VectorPlatformDeviceEmf::onCreateCompatibleDevice( |
| 699 Usage /*usage*/) { | 699 const CreateInfo& info) { |
| 700 SkASSERT(info.colorType() == kN32_SkColorType); | 700 SkASSERT(info.fInfo.colorType() == kN32_SkColorType); |
| 701 return VectorPlatformDeviceEmf::CreateDevice( | 701 return VectorPlatformDeviceEmf::CreateDevice( |
| 702 info.width(), info.height(), info.isOpaque(), NULL); | 702 info.fInfo.width(), info.fInfo.height(), info.fInfo.isOpaque(), NULL); |
| 703 } | 703 } |
| 704 | 704 |
| 705 bool VectorPlatformDeviceEmf::CreateBrush(bool use_brush, COLORREF color) { | 705 bool VectorPlatformDeviceEmf::CreateBrush(bool use_brush, COLORREF color) { |
| 706 SkASSERT(previous_brush_ == NULL); | 706 SkASSERT(previous_brush_ == NULL); |
| 707 // We can't use SetDCBrushColor() or DC_BRUSH when drawing to a EMF buffer. | 707 // We can't use SetDCBrushColor() or DC_BRUSH when drawing to a EMF buffer. |
| 708 // SetDCBrushColor() calls are not recorded at all and DC_BRUSH will use | 708 // SetDCBrushColor() calls are not recorded at all and DC_BRUSH will use |
| 709 // WHITE_BRUSH instead. | 709 // WHITE_BRUSH instead. |
| 710 | 710 |
| 711 if (!use_brush) { | 711 if (!use_brush) { |
| 712 // Set the transparency. | 712 // Set the transparency. |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 pixels, | 979 pixels, |
| 980 reinterpret_cast<const BITMAPINFO*>(&hdr), | 980 reinterpret_cast<const BITMAPINFO*>(&hdr), |
| 981 DIB_RGB_COLORS, | 981 DIB_RGB_COLORS, |
| 982 SRCCOPY); | 982 SRCCOPY); |
| 983 } | 983 } |
| 984 EndPlatformPaint(); | 984 EndPlatformPaint(); |
| 985 Cleanup(); | 985 Cleanup(); |
| 986 } | 986 } |
| 987 | 987 |
| 988 } // namespace skia | 988 } // namespace skia |
| OLD | NEW |