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

Unified Diff: views/drag_utils.cc

Issue 2862025: Canvas refactoring part 2.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 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
« no previous file with comments | « views/controls/tree/tree_view.cc ('k') | views/widget/root_view_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/drag_utils.cc
===================================================================
--- views/drag_utils.cc (revision 50452)
+++ views/drag_utils.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/utf_string_conversions.h"
#include "gfx/canvas.h"
+#include "gfx/canvas_skia.h"
#include "gfx/font.h"
#include "googleurl/src/gurl.h"
#include "grit/app_resources.h"
@@ -48,9 +49,9 @@
button.SetBounds(0, 0, prefsize.width(), prefsize.height());
// Render the image.
- gfx::Canvas canvas(prefsize.width(), prefsize.height(), false);
- button.Paint(&canvas, true);
- SetDragImageOnDataObject(canvas, prefsize,
+ gfx::CanvasSkia canvas(prefsize.width(), prefsize.height(), false);
+ button.Paint(canvas.AsCanvas(), true);
+ SetDragImageOnDataObject(*canvas.AsCanvas(), prefsize,
gfx::Point(prefsize.width() / 2, prefsize.height() / 2), data);
}
@@ -68,7 +69,7 @@
// Add +2 here to allow room for the halo.
const int height = font.height() + icon->height() +
kLinkDragImageVPadding + 2;
- gfx::Canvas canvas(width, height, false /* translucent */);
+ gfx::CanvasSkia canvas(width, height, false /* translucent */);
// Paint the icon.
canvas.DrawBitmapInt(*icon, (width - icon->width()) / 2, 0);
@@ -87,7 +88,7 @@
width, font.height(), gfx::Canvas::TEXT_ALIGN_CENTER);
#endif
- SetDragImageOnDataObject(canvas, gfx::Size(width, height),
+ SetDragImageOnDataObject(*canvas.AsCanvas(), gfx::Size(width, height),
gfx::Point(width / 2, kLinkDragImageVPadding),
data_object);
}
« no previous file with comments | « views/controls/tree/tree_view.cc ('k') | views/widget/root_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698