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

Side by Side Diff: views/view_unittest.cc

Issue 6529037: Rename ProcessPaint to Paint() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « views/view.cc ('k') | views/widget/root_view.h » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <map> 5 #include <map>
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "ui/base/clipboard/clipboard.h" 9 #include "ui/base/clipboard/clipboard.h"
10 #include "ui/base/keycodes/keyboard_codes.h" 10 #include "ui/base/keycodes/keyboard_codes.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void PaintRootView(views::RootView* root, bool empty_paint) { 62 void PaintRootView(views::RootView* root, bool empty_paint) {
63 if (!empty_paint) { 63 if (!empty_paint) {
64 root->PaintNow(); 64 root->PaintNow();
65 } else { 65 } else {
66 // User isn't logged in, so that PaintNow will generate an empty rectangle. 66 // User isn't logged in, so that PaintNow will generate an empty rectangle.
67 // Invoke paint directly. 67 // Invoke paint directly.
68 gfx::Rect paint_rect = root->GetScheduledPaintRect(); 68 gfx::Rect paint_rect = root->GetScheduledPaintRect();
69 gfx::CanvasSkia canvas(paint_rect.width(), paint_rect.height(), true); 69 gfx::CanvasSkia canvas(paint_rect.width(), paint_rect.height(), true);
70 canvas.TranslateInt(-paint_rect.x(), -paint_rect.y()); 70 canvas.TranslateInt(-paint_rect.x(), -paint_rect.y());
71 canvas.ClipRectInt(0, 0, paint_rect.width(), paint_rect.height()); 71 canvas.ClipRectInt(0, 0, paint_rect.width(), paint_rect.height());
72 root->ProcessPaint(&canvas); 72 root->Paint(&canvas);
73 } 73 }
74 } 74 }
75 75
76 /* 76 /*
77 typedef CWinTraits<WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS> CVTWTraits; 77 typedef CWinTraits<WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS> CVTWTraits;
78 78
79 // A trivial window implementation that tracks whether or not it has been 79 // A trivial window implementation that tracks whether or not it has been
80 // painted. This is used by the painting test to determine if paint will result 80 // painted. This is used by the painting test to determine if paint will result
81 // in an empty region. 81 // in an empty region.
82 class EmptyWindow : public CWindowImpl<EmptyWindow, 82 class EmptyWindow : public CWindowImpl<EmptyWindow,
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 // |v2| now occupies (100, 200) to (200, 400) in |root|. 1550 // |v2| now occupies (100, 200) to (200, 400) in |root|.
1551 1551
1552 root->ClearPaintRect(); 1552 root->ClearPaintRect();
1553 v2->SchedulePaint(); 1553 v2->SchedulePaint();
1554 1554
1555 rect = root->GetScheduledPaintRect(); 1555 rect = root->GetScheduledPaintRect();
1556 EXPECT_EQ(gfx::Rect(100, 200, 100, 200), rect); 1556 EXPECT_EQ(gfx::Rect(100, 200, 100, 200), rect);
1557 1557
1558 widget->CloseNow(); 1558 widget->CloseNow();
1559 } 1559 }
OLDNEW
« no previous file with comments | « views/view.cc ('k') | views/widget/root_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698