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

Unified Diff: ui/base/clipboard/clipboard_win.cc

Issue 8122013: Allow CanvasSkia to bind to an existing SkCanvas. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: 1 more fix Created 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/clipboard/clipboard_win.cc
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
index b86b36c99577db7392b1924b6ce3b9084f2a8513..21914945a08b328a5bc8b2bb0d73bed237025655 100644
--- a/ui/base/clipboard/clipboard_win.cc
+++ b/ui/base/clipboard/clipboard_win.cc
@@ -490,7 +490,7 @@ SkBitmap Clipboard::ReadImage(Buffer buffer) const {
gfx::CanvasSkia canvas(bitmap->bmiHeader.biWidth, bitmap->bmiHeader.biHeight,
false);
{
- skia::ScopedPlatformPaint scoped_platform_paint(&canvas);
+ skia::ScopedPlatformPaint scoped_platform_paint(canvas.sk_canvas());
HDC dc = scoped_platform_paint.GetPlatformSurface();
::SetDIBitsToDevice(dc, 0, 0, bitmap->bmiHeader.biWidth,
bitmap->bmiHeader.biHeight, 0, 0, 0,
@@ -505,7 +505,8 @@ SkBitmap Clipboard::ReadImage(Buffer buffer) const {
// we assume the alpha channel contains garbage and force the bitmap to be
// opaque as well. Note that this heuristic will fail on a transparent bitmap
// containing only black pixels...
- const SkBitmap& device_bitmap = canvas.getDevice()->accessBitmap(true);
+ const SkBitmap& device_bitmap =
+ canvas.sk_canvas()->getDevice()->accessBitmap(true);
{
SkAutoLockPixels lock(device_bitmap);
bool has_invalid_alpha_channel = bitmap->bmiHeader.biBitCount < 32 ||
« no previous file with comments | « ui/base/clipboard/clipboard_mac.mm ('k') | ui/gfx/canvas.h » ('j') | ui/gfx/canvas.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698