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

Unified Diff: ash/desktop_background/desktop_background_view.cc

Issue 2095193002: clang-format all of //ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: ash/desktop_background/desktop_background_view.cc
diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc
index 8d16ed3c759047adfe72cdfb1486c4f0f1c285fd..1b05745655c80117156cb510b2f4d147984e2f6e 100644
--- a/ash/desktop_background/desktop_background_view.cc
+++ b/ash/desktop_background/desktop_background_view.cc
@@ -150,10 +150,10 @@ void DesktopBackgroundView::OnPaint(gfx::Canvas* canvas) {
if (wallpaper_layout == WALLPAPER_LAYOUT_CENTER_CROPPED) {
// The dimension with the smallest ratio must be cropped, the other one
// is preserved. Both are set in gfx::Size cropped_size.
- double horizontal_ratio = static_cast<double>(width()) /
- static_cast<double>(wallpaper.width());
- double vertical_ratio = static_cast<double>(height()) /
- static_cast<double>(wallpaper.height());
+ double horizontal_ratio =
+ static_cast<double>(width()) / static_cast<double>(wallpaper.width());
+ double vertical_ratio =
+ static_cast<double>(height()) / static_cast<double>(wallpaper.height());
gfx::Size cropped_size;
if (vertical_ratio > horizontal_ratio) {
@@ -166,33 +166,28 @@ void DesktopBackgroundView::OnPaint(gfx::Canvas* canvas) {
gfx::ToFlooredInt(static_cast<double>(height()) / horizontal_ratio));
}
- gfx::Rect wallpaper_cropped_rect(
- 0, 0, wallpaper.width(), wallpaper.height());
+ gfx::Rect wallpaper_cropped_rect(0, 0, wallpaper.width(),
+ wallpaper.height());
wallpaper_cropped_rect.ClampToCenteredSize(cropped_size);
- canvas->DrawImageInt(wallpaper,
- wallpaper_cropped_rect.x(), wallpaper_cropped_rect.y(),
- wallpaper_cropped_rect.width(), wallpaper_cropped_rect.height(),
- 0, 0, width(), height(),
- true);
+ canvas->DrawImageInt(
+ wallpaper, wallpaper_cropped_rect.x(), wallpaper_cropped_rect.y(),
+ wallpaper_cropped_rect.width(), wallpaper_cropped_rect.height(), 0, 0,
+ width(), height(), true);
} else if (wallpaper_layout == WALLPAPER_LAYOUT_TILE) {
canvas->TileImageInt(wallpaper, 0, 0, width(), height());
} else if (wallpaper_layout == WALLPAPER_LAYOUT_STRETCH) {
// This is generally not recommended as it may show artifacts.
- canvas->DrawImageInt(wallpaper, 0, 0, wallpaper.width(),
- wallpaper.height(), 0, 0, width(), height(), true);
+ canvas->DrawImageInt(wallpaper, 0, 0, wallpaper.width(), wallpaper.height(),
+ 0, 0, width(), height(), true);
} else {
float image_scale = canvas->image_scale();
gfx::Rect wallpaper_rect(0, 0, wallpaper.width() / image_scale,
wallpaper.height() / image_scale);
// All other are simply centered, and not scaled (but may be clipped).
- canvas->DrawImageInt(
- wallpaper,
- 0, 0, wallpaper.width(), wallpaper.height(),
- (width() - wallpaper_rect.width()) / 2,
- (height() - wallpaper_rect.height()) / 2,
- wallpaper_rect.width(),
- wallpaper_rect.height(),
- true);
+ canvas->DrawImageInt(wallpaper, 0, 0, wallpaper.width(), wallpaper.height(),
+ (width() - wallpaper_rect.width()) / 2,
+ (height() - wallpaper_rect.height()) / 2,
+ wallpaper_rect.width(), wallpaper_rect.height(), true);
}
}

Powered by Google App Engine
This is Rietveld 408576698