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

Unified Diff: ui/views/button_drag_utils.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Sync with ToT Created 3 years, 4 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 | « ui/views/bubble/bubble_frame_view.cc ('k') | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c898239ead0946da31c82d459815c6f77ba4da24 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::CreateRootPaintInfo(
+ 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);
}
« no previous file with comments | « ui/views/bubble/bubble_frame_view.cc ('k') | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698