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

Side by Side Diff: ash/desktop_background/desktop_background_view.cc

Issue 929653002: Apply RTL transform to the background layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/desktop_background/desktop_background_view.h" 5 #include "ash/desktop_background/desktop_background_view.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "ash/ash_export.h" 9 #include "ash/ash_export.h"
10 #include "ash/desktop_background/desktop_background_controller.h" 10 #include "ash/desktop_background/desktop_background_controller.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 57 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
58 DisplayInfo info = display_manager->GetDisplayInfo(display.id()); 58 DisplayInfo info = display_manager->GetDisplayInfo(display.id());
59 float ui_scale = info.GetEffectiveUIScale(); 59 float ui_scale = info.GetEffectiveUIScale();
60 gfx::SizeF pixel_size = display.size(); 60 gfx::SizeF pixel_size = display.size();
61 pixel_size.Scale(1.0f / ui_scale); 61 pixel_size.Scale(1.0f / ui_scale);
62 gfx::Size rounded_size = gfx::ToFlooredSize(pixel_size); 62 gfx::Size rounded_size = gfx::ToFlooredSize(pixel_size);
63 DCHECK_EQ(1, child_count()); 63 DCHECK_EQ(1, child_count());
64 views::View* child = child_at(0); 64 views::View* child = child_at(0);
65 child->SetBounds(0, 0, rounded_size.width(), rounded_size.height()); 65 child->SetBounds(0, 0, rounded_size.width(), rounded_size.height());
66 gfx::Transform transform; 66 gfx::Transform transform;
67 // Apply RTL transform explicitly becacuse Views layer code
68 // doesn't handle RTL. crbug.com/458753.
69 transform.Translate(-child->GetMirroredX(), 0);
67 transform.Scale(ui_scale, ui_scale); 70 transform.Scale(ui_scale, ui_scale);
68 child->SetTransform(transform); 71 child->SetTransform(transform);
69 } 72 }
70 73
71 private: 74 private:
72 DISALLOW_COPY_AND_ASSIGN(LayerControlView); 75 DISALLOW_COPY_AND_ASSIGN(LayerControlView);
73 }; 76 };
74 77
75 } // namespace 78 } // namespace
76 79
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // Disable animation if transition to login screen from an empty background. 260 // Disable animation if transition to login screen from an empty background.
258 wm::SetWindowVisibilityAnimationTransition( 261 wm::SetWindowVisibilityAnimationTransition(
259 desktop_widget->GetNativeView(), wm::ANIMATE_NONE); 262 desktop_widget->GetNativeView(), wm::ANIMATE_NONE);
260 } 263 }
261 264
262 desktop_widget->SetBounds(params.parent->bounds()); 265 desktop_widget->SetBounds(params.parent->bounds());
263 return desktop_widget; 266 return desktop_widget;
264 } 267 }
265 268
266 } // namespace ash 269 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698