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

Unified Diff: ui/arc/notification/arc_custom_notification_view.cc

Issue 2640243005: Align layers for ARC notification surface to pixels (Closed)
Patch Set: . Created 3 years, 11 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 | « ash/wm/window_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/arc/notification/arc_custom_notification_view.cc
diff --git a/ui/arc/notification/arc_custom_notification_view.cc b/ui/arc/notification/arc_custom_notification_view.cc
index f28246e65a5a959456a666176cfb8e7f0b4e9ab3..8e33e369cb25f1de5a8c3a22c3d447bc86426a0f 100644
--- a/ui/arc/notification/arc_custom_notification_view.cc
+++ b/ui/arc/notification/arc_custom_notification_view.cc
@@ -4,6 +4,7 @@
#include "ui/arc/notification/arc_custom_notification_view.h"
+#include "ash/wm/window_util.h"
#include "base/auto_reset.h"
#include "base/memory/ptr_util.h"
#include "components/exo/notification_surface.h"
@@ -366,6 +367,11 @@ void ArcCustomNotificationView::AttachSurface() {
UpdatePreferredSize();
Attach(surface_->window());
+ // The texture for this window can be placed at subpixel position
+ // with fractional scale factor. Force to align it at the pixel
+ // boundary here, and when layout is updated in Layout().
+ ash::wm::SnapWindowToPixelBoundary(surface_->window());
+
// Creates slide helper after this view is added to its parent.
slide_helper_.reset(new SlideHelper(this));
@@ -432,6 +438,8 @@ void ArcCustomNotificationView::Layout() {
floating_close_button_widget_->SetBounds(close_button_bounds);
UpdateCloseButtonVisiblity();
+
+ ash::wm::SnapWindowToPixelBoundary(surface_->window());
}
void ArcCustomNotificationView::OnPaint(gfx::Canvas* canvas) {
« no previous file with comments | « ash/wm/window_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698