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

Unified Diff: ui/views/view.cc

Issue 2261593002: Use ScopedRTLFlipCanvas more pervasively for RTL flipping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix namespace Created 4 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/view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index e6d51dd2cc56b693ab36adcce0041bb033c29352..ac8031943a1d887aeebc151452a8de0157ea6bd5 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -841,16 +841,8 @@ void View::Paint(const ui::PaintContext& parent_context) {
if (is_invalidated || !paint_cache_.UseCache(context, size())) {
ui::PaintRecorder recorder(context, size(), &paint_cache_);
gfx::Canvas* canvas = recorder.canvas();
-
- // If the View we are about to paint requested the canvas to be flipped, we
- // should change the transform appropriately.
- // The canvas mirroring is undone once the View is done painting so that we
- // don't pass the canvas with the mirrored transform to Views that didn't
- // request the canvas to be flipped.
- if (FlipCanvasOnPaintForRTLUI()) {
- canvas->Translate(gfx::Vector2d(width(), 0));
- canvas->Scale(-1, 1);
- }
+ gfx::ScopedRTLFlipCanvas scoped_canvas(canvas, width(),
+ flip_canvas_on_paint_for_rtl_ui_);
// Delegate painting the contents of the View to the virtual OnPaint method.
OnPaint(canvas);
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698