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

Side by Side Diff: views/view_unittest.cc

Issue 2825018: Canvas refactoring part 3.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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
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 "app/clipboard/clipboard.h" 7 #include "app/clipboard/clipboard.h"
8 #include "base/keyboard_codes.h" 8 #include "base/keyboard_codes.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "gfx/canvas.h" 11 #include "gfx/canvas_skia.h"
12 #include "gfx/path.h" 12 #include "gfx/path.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 #include "views/background.h" 14 #include "views/background.h"
15 #include "views/controls/button/checkbox.h" 15 #include "views/controls/button/checkbox.h"
16 #if defined(OS_WIN) 16 #if defined(OS_WIN)
17 #include "views/controls/button/native_button_win.h" 17 #include "views/controls/button/native_button_win.h"
18 #endif 18 #endif
19 #include "views/controls/native/native_view_host.h" 19 #include "views/controls/native/native_view_host.h"
20 #include "views/controls/scroll_view.h" 20 #include "views/controls/scroll_view.h"
21 #include "views/controls/textfield/textfield.h" 21 #include "views/controls/textfield/textfield.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 }; 74 };
75 75
76 // Paints the RootView. 76 // Paints the RootView.
77 void PaintRootView(views::RootView* root, bool empty_paint) { 77 void PaintRootView(views::RootView* root, bool empty_paint) {
78 if (!empty_paint) { 78 if (!empty_paint) {
79 root->PaintNow(); 79 root->PaintNow();
80 } else { 80 } else {
81 // User isn't logged in, so that PaintNow will generate an empty rectangle. 81 // User isn't logged in, so that PaintNow will generate an empty rectangle.
82 // Invoke paint directly. 82 // Invoke paint directly.
83 gfx::Rect paint_rect = root->GetScheduledPaintRect(); 83 gfx::Rect paint_rect = root->GetScheduledPaintRect();
84 gfx::Canvas canvas(paint_rect.width(), paint_rect.height(), true); 84 gfx::CanvasSkia canvas(paint_rect.width(), paint_rect.height(), true);
85 canvas.TranslateInt(-paint_rect.x(), -paint_rect.y()); 85 canvas.TranslateInt(-paint_rect.x(), -paint_rect.y());
86 canvas.ClipRectInt(0, 0, paint_rect.width(), paint_rect.height()); 86 canvas.ClipRectInt(0, 0, paint_rect.width(), paint_rect.height());
87 root->ProcessPaint(&canvas); 87 root->ProcessPaint(&canvas);
88 } 88 }
89 } 89 }
90 90
91 /* 91 /*
92 typedef CWinTraits<WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS> CVTWTraits; 92 typedef CWinTraits<WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS> CVTWTraits;
93 93
94 // A trivial window implementation that tracks whether or not it has been 94 // A trivial window implementation that tracks whether or not it has been
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 #endif 1342 #endif
1343 } 1343 }
1344 1344
1345 TEST_F(ViewTest, ChangeNativeViewHierarchyChangeHierarchy) { 1345 TEST_F(ViewTest, ChangeNativeViewHierarchyChangeHierarchy) {
1346 // TODO(georgey): Fix the test for Linux 1346 // TODO(georgey): Fix the test for Linux
1347 #if defined(OS_WIN) 1347 #if defined(OS_WIN)
1348 TestChangeNativeViewHierarchy test(this); 1348 TestChangeNativeViewHierarchy test(this);
1349 test.CheckChangingHierarhy(); 1349 test.CheckChangingHierarhy();
1350 #endif 1350 #endif
1351 } 1351 }
OLDNEW
« gfx/canvas.h ('K') | « views/view_text_utils.cc ('k') | views/widget/root_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698