Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: ui/base/clipboard/clipboard_win.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new usage of scale in FastShowPickler Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/clipboard/clipboard_mac.mm ('k') | ui/base/cursor/cursor_loader_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_mac.mm ('k') | ui/base/cursor/cursor_loader_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698