| 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/string16.h" | 10 #include "base/string16.h" |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 drawSprite(draw, device->accessBitmap(false), x, y, paint); | 538 drawSprite(draw, device->accessBitmap(false), x, y, paint); |
| 539 } | 539 } |
| 540 | 540 |
| 541 bool VectorPlatformDeviceEmf::ApplyPaint(const SkPaint& paint) { | 541 bool VectorPlatformDeviceEmf::ApplyPaint(const SkPaint& paint) { |
| 542 // Note: The goal here is to transfert the SkPaint's state to the HDC's state. | 542 // Note: The goal here is to transfert the SkPaint's state to the HDC's state. |
| 543 // This function does not execute the SkPaint drawing commands. These should | 543 // This function does not execute the SkPaint drawing commands. These should |
| 544 // be executed in drawPaint(). | 544 // be executed in drawPaint(). |
| 545 | 545 |
| 546 SkPaint::Style style = paint.getStyle(); | 546 SkPaint::Style style = paint.getStyle(); |
| 547 if (!paint.getAlpha()) | 547 if (!paint.getAlpha()) |
| 548 style = SkPaint::kStyleCount; | 548 style = (SkPaint::Style) SkPaint::kStyleCount; |
| 549 | 549 |
| 550 switch (style) { | 550 switch (style) { |
| 551 case SkPaint::kFill_Style: | 551 case SkPaint::kFill_Style: |
| 552 if (!CreateBrush(true, paint) || | 552 if (!CreateBrush(true, paint) || |
| 553 !CreatePen(false, paint)) | 553 !CreatePen(false, paint)) |
| 554 return false; | 554 return false; |
| 555 break; | 555 break; |
| 556 case SkPaint::kStroke_Style: | 556 case SkPaint::kStroke_Style: |
| 557 if (!CreateBrush(false, paint) || | 557 if (!CreateBrush(false, paint) || |
| 558 !CreatePen(true, paint)) | 558 !CreatePen(true, paint)) |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 pixels, | 921 pixels, |
| 922 reinterpret_cast<const BITMAPINFO*>(&hdr), | 922 reinterpret_cast<const BITMAPINFO*>(&hdr), |
| 923 DIB_RGB_COLORS, | 923 DIB_RGB_COLORS, |
| 924 SRCCOPY); | 924 SRCCOPY); |
| 925 } | 925 } |
| 926 EndPlatformPaint(); | 926 EndPlatformPaint(); |
| 927 Cleanup(); | 927 Cleanup(); |
| 928 } | 928 } |
| 929 | 929 |
| 930 } // namespace skia | 930 } // namespace skia |
| OLD | NEW |