| 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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 const RECT* src_rect) { | 686 const RECT* src_rect) { |
| 687 SkASSERT(false); | 687 SkASSERT(false); |
| 688 } | 688 } |
| 689 | 689 |
| 690 void VectorPlatformDeviceEmf::LoadClipRegion() { | 690 void VectorPlatformDeviceEmf::LoadClipRegion() { |
| 691 SkMatrix t; | 691 SkMatrix t; |
| 692 t.reset(); | 692 t.reset(); |
| 693 LoadClippingRegionToDC(hdc_, clip_region_, t); | 693 LoadClippingRegionToDC(hdc_, clip_region_, t); |
| 694 } | 694 } |
| 695 | 695 |
| 696 #ifdef SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG | |
| 697 SkBaseDevice* VectorPlatformDeviceEmf::onCreateCompatibleDevice( | |
| 698 SkBitmap::Config config, int width, int height, bool isOpaque, | |
| 699 Usage /*usage*/) { | |
| 700 SkASSERT(config == SkBitmap::kARGB_8888_Config); | |
| 701 return VectorPlatformDeviceEmf::CreateDevice(width, height, isOpaque, NULL); | |
| 702 } | |
| 703 #endif | |
| 704 | |
| 705 SkBaseDevice* VectorPlatformDeviceEmf::onCreateDevice(const SkImageInfo& info, | 696 SkBaseDevice* VectorPlatformDeviceEmf::onCreateDevice(const SkImageInfo& info, |
| 706 Usage /*usage*/) { | 697 Usage /*usage*/) { |
| 707 SkASSERT(info.colorType() == kPMColor_SkColorType); | 698 SkASSERT(info.colorType() == kN32_SkColorType); |
| 708 return VectorPlatformDeviceEmf::CreateDevice( | 699 return VectorPlatformDeviceEmf::CreateDevice( |
| 709 info.width(), info.height(), info.isOpaque(), NULL); | 700 info.width(), info.height(), info.isOpaque(), NULL); |
| 710 } | 701 } |
| 711 | 702 |
| 712 bool VectorPlatformDeviceEmf::CreateBrush(bool use_brush, COLORREF color) { | 703 bool VectorPlatformDeviceEmf::CreateBrush(bool use_brush, COLORREF color) { |
| 713 SkASSERT(previous_brush_ == NULL); | 704 SkASSERT(previous_brush_ == NULL); |
| 714 // We can't use SetDCBrushColor() or DC_BRUSH when drawing to a EMF buffer. | 705 // We can't use SetDCBrushColor() or DC_BRUSH when drawing to a EMF buffer. |
| 715 // SetDCBrushColor() calls are not recorded at all and DC_BRUSH will use | 706 // SetDCBrushColor() calls are not recorded at all and DC_BRUSH will use |
| 716 // WHITE_BRUSH instead. | 707 // WHITE_BRUSH instead. |
| 717 | 708 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 pixels, | 977 pixels, |
| 987 reinterpret_cast<const BITMAPINFO*>(&hdr), | 978 reinterpret_cast<const BITMAPINFO*>(&hdr), |
| 988 DIB_RGB_COLORS, | 979 DIB_RGB_COLORS, |
| 989 SRCCOPY); | 980 SRCCOPY); |
| 990 } | 981 } |
| 991 EndPlatformPaint(); | 982 EndPlatformPaint(); |
| 992 Cleanup(); | 983 Cleanup(); |
| 993 } | 984 } |
| 994 | 985 |
| 995 } // namespace skia | 986 } // namespace skia |
| OLD | NEW |