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 // Many of these functions are based on those found in | 5 // Many of these functions are based on those found in |
6 // webkit/port/platform/PasteboardWin.cpp | 6 // webkit/port/platform/PasteboardWin.cpp |
7 | 7 |
8 #include "ui/base/clipboard/clipboard.h" | 8 #include "ui/base/clipboard/clipboard.h" |
9 | 9 |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 case 24: | 555 case 24: |
556 break; | 556 break; |
557 default: | 557 default: |
558 NOTREACHED(); | 558 NOTREACHED(); |
559 } | 559 } |
560 const void* bitmap_bits = reinterpret_cast<const char*>(bitmap) | 560 const void* bitmap_bits = reinterpret_cast<const char*>(bitmap) |
561 + bitmap->bmiHeader.biSize + color_table_length * sizeof(RGBQUAD); | 561 + bitmap->bmiHeader.biSize + color_table_length * sizeof(RGBQUAD); |
562 | 562 |
563 gfx::Canvas canvas(gfx::Size(bitmap->bmiHeader.biWidth, | 563 gfx::Canvas canvas(gfx::Size(bitmap->bmiHeader.biWidth, |
564 bitmap->bmiHeader.biHeight), | 564 bitmap->bmiHeader.biHeight), |
565 ui::SCALE_FACTOR_100P, | 565 1.0f, |
566 false); | 566 false); |
567 { | 567 { |
568 skia::ScopedPlatformPaint scoped_platform_paint(canvas.sk_canvas()); | 568 skia::ScopedPlatformPaint scoped_platform_paint(canvas.sk_canvas()); |
569 HDC dc = scoped_platform_paint.GetPlatformSurface(); | 569 HDC dc = scoped_platform_paint.GetPlatformSurface(); |
570 ::SetDIBitsToDevice(dc, 0, 0, bitmap->bmiHeader.biWidth, | 570 ::SetDIBitsToDevice(dc, 0, 0, bitmap->bmiHeader.biWidth, |
571 bitmap->bmiHeader.biHeight, 0, 0, 0, | 571 bitmap->bmiHeader.biHeight, 0, 0, 0, |
572 bitmap->bmiHeader.biHeight, bitmap_bits, bitmap, | 572 bitmap->bmiHeader.biHeight, bitmap_bits, bitmap, |
573 DIB_RGB_COLORS); | 573 DIB_RGB_COLORS); |
574 } | 574 } |
575 // Windows doesn't really handle alpha channels well in many situations. When | 575 // Windows doesn't really handle alpha channels well in many situations. When |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 if (!clipboard_owner_) | 821 if (!clipboard_owner_) |
822 return NULL; | 822 return NULL; |
823 | 823 |
824 if (clipboard_owner_->hwnd() == NULL) | 824 if (clipboard_owner_->hwnd() == NULL) |
825 clipboard_owner_->Create(base::Bind(&ClipboardOwnerWndProc)); | 825 clipboard_owner_->Create(base::Bind(&ClipboardOwnerWndProc)); |
826 | 826 |
827 return clipboard_owner_->hwnd(); | 827 return clipboard_owner_->hwnd(); |
828 } | 828 } |
829 | 829 |
830 } // namespace ui | 830 } // namespace ui |
OLD | NEW |