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

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

Issue 6879013: skia::PlatformCanvas is being deprecated. Going forward we will use gfx::Canvas wherever we need ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 | « content/browser/renderer_host/render_widget_host_unittest.cc ('k') | ui/gfx/canvas_skia.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 return SkBitmap(); 447 return SkBitmap();
448 ::SelectObject(source_dc, source_bitmap); 448 ::SelectObject(source_dc, source_bitmap);
449 449
450 // Get the dimensions of the bitmap. 450 // Get the dimensions of the bitmap.
451 BITMAPINFO bitmap_info = {}; 451 BITMAPINFO bitmap_info = {};
452 bitmap_info.bmiHeader.biSize = sizeof(bitmap_info.bmiHeader); 452 bitmap_info.bmiHeader.biSize = sizeof(bitmap_info.bmiHeader);
453 ::GetDIBits(source_dc, source_bitmap, 0, 0, 0, &bitmap_info, DIB_RGB_COLORS); 453 ::GetDIBits(source_dc, source_bitmap, 0, 0, 0, &bitmap_info, DIB_RGB_COLORS);
454 int width = bitmap_info.bmiHeader.biWidth; 454 int width = bitmap_info.bmiHeader.biWidth;
455 int height = bitmap_info.bmiHeader.biHeight; 455 int height = bitmap_info.bmiHeader.biHeight;
456 456
457 gfx::CanvasSkia canvas(width, height, false); 457 gfx::CanvasSkia canvas;
458 canvas.Init(width, height, false);
458 459
459 HDC destination_dc = canvas.beginPlatformPaint(); 460 HDC destination_dc = canvas.BeginPlatformPaint();
460 ::BitBlt(destination_dc, 0, 0, width, height, source_dc, 0, 0, SRCCOPY); 461 ::BitBlt(destination_dc, 0, 0, width, height, source_dc, 0, 0, SRCCOPY);
461 canvas.endPlatformPaint(); 462 canvas.EndPlatformPaint();
462 return canvas.ExtractBitmap(); 463 return canvas.ExtractBitmap();
463 } 464 }
464 465
465 void Clipboard::ReadBookmark(string16* title, std::string* url) const { 466 void Clipboard::ReadBookmark(string16* title, std::string* url) const {
466 if (title) 467 if (title)
467 title->clear(); 468 title->clear();
468 469
469 if (url) 470 if (url)
470 url->clear(); 471 url->clear();
471 472
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", 656 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass",
656 L"ClipboardOwnerWindow", 657 L"ClipboardOwnerWindow",
657 0, 0, 0, 0, 0, 658 0, 0, 0, 0, 0,
658 HWND_MESSAGE, 659 HWND_MESSAGE,
659 0, 0, 0); 660 0, 0, 0);
660 } 661 }
661 return clipboard_owner_; 662 return clipboard_owner_;
662 } 663 }
663 664
664 } // namespace ui 665 } // namespace ui
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_unittest.cc ('k') | ui/gfx/canvas_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698