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

Unified Diff: ui/views/button_drag_utils.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Resolving comments Created 3 years, 5 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/views/button_drag_utils.cc
diff --git a/ui/views/button_drag_utils.cc b/ui/views/button_drag_utils.cc
index 064a133d2691b4f59520840cc3ad5e3a4af249b9..26810990fd32e6fa93851114234f176b3a8759d3 100644
--- a/ui/views/button_drag_utils.cc
+++ b/ui/views/button_drag_utils.cc
@@ -18,6 +18,7 @@
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/button/label_button_border.h"
#include "ui/views/drag_utils.h"
+#include "ui/views/paint_info.h"
#include "ui/views/widget/widget.h"
#include "url/gurl.h"
@@ -83,7 +84,11 @@ void SetDragImage(const GURL& url,
SkBitmap bitmap;
float raster_scale = ScaleFactorForDragFromWidget(&widget);
SkColor color = SK_ColorTRANSPARENT;
- button.Paint(ui::CanvasPainter(&bitmap, size, raster_scale, color).context());
+ button.Paint(views::PaintInfo(
+ ui::CanvasPainter(&bitmap, size, raster_scale, color,
+ widget.GetCompositor()->is_pixel_canvas())
+ .context(),
+ size));
gfx::ImageSkia image(gfx::ImageSkiaRep(bitmap, raster_scale));
data->provider().SetDragImage(image, press_point);
}

Powered by Google App Engine
This is Rietveld 408576698