OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |