summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-13 22:35:50 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-13 22:35:50 +0000
commitabffeda32d465d4ccbbdf6d6a3275c1ab03e5434 (patch)
tree8479b7ed52725b5ab58299ff26d26cdb1a2707cb /views
parent0ff4f5d315a8c17e95fc30fc9983a10a84c627d6 (diff)
downloadchromium_src-abffeda32d465d4ccbbdf6d6a3275c1ab03e5434.zip
chromium_src-abffeda32d465d4ccbbdf6d6a3275c1ab03e5434.tar.gz
chromium_src-abffeda32d465d4ccbbdf6d6a3275c1ab03e5434.tar.bz2
Misc. cleanup: simplify some code, add a few comments
BUG=none TEST=none Review URL: http://codereview.chromium.org/3143016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56106 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/view.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/views/view.cc b/views/view.cc
index 02d2766..9acbd47 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -400,16 +400,12 @@ void View::ProcessPaint(gfx::Canvas* canvas) {
// where this view is located (related to its parent).
canvas->TranslateInt(MirroredX(), y());
- // Save the state again, so that any changes don't effect PaintChildren.
- canvas->Save();
-
// If the View we are about to paint requested the canvas to be flipped, we
// should change the transform appropriately.
- bool flip_canvas = FlipCanvasOnPaintForRTLUI();
- if (flip_canvas) {
+ canvas->Save();
+ if (FlipCanvasOnPaintForRTLUI()) {
canvas->TranslateInt(width(), 0);
canvas->ScaleInt(-1, 1);
- canvas->Save();
}
Paint(canvas);
@@ -417,10 +413,8 @@ void View::ProcessPaint(gfx::Canvas* canvas) {
// We must undo the canvas mirroring 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 (flip_canvas)
- canvas->Restore();
-
canvas->Restore();
+
PaintChildren(canvas);
}