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

Side by Side Diff: views/aura_desktop/aura_desktop_main.cc

Issue 8405002: ui/gfx: Convert Canvas::FillRectInt() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: save some vertical space, interactive_ui_tests are fixed by Peter's fix Created 9 years, 1 month 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 | « ui/gfx/render_text_win.cc ('k') | views/border.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/i18n/icu_util.h" 7 #include "base/i18n/icu_util.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 }; 75 };
76 76
77 class TestView : public views::View { 77 class TestView : public views::View {
78 public: 78 public:
79 TestView() : color_shifting_(false), color_(SK_ColorYELLOW) {} 79 TestView() : color_shifting_(false), color_(SK_ColorYELLOW) {}
80 virtual ~TestView() {} 80 virtual ~TestView() {}
81 81
82 private: 82 private:
83 // Overridden from views::View: 83 // Overridden from views::View:
84 virtual void OnPaint(gfx::Canvas* canvas) { 84 virtual void OnPaint(gfx::Canvas* canvas) {
85 canvas->FillRectInt(color_, 0, 0, width(), height()); 85 canvas->FillRect(color_, GetLocalBounds());
86 } 86 }
87 virtual bool OnMousePressed(const views::MouseEvent& event) { 87 virtual bool OnMousePressed(const views::MouseEvent& event) {
88 color_shifting_ = true; 88 color_shifting_ = true;
89 return true; 89 return true;
90 } 90 }
91 virtual void OnMouseMoved(const views::MouseEvent& event) { 91 virtual void OnMouseMoved(const views::MouseEvent& event) {
92 if (color_shifting_) { 92 if (color_shifting_) {
93 color_ = SkColorSetRGB((SkColorGetR(color_) + 5) % 255, 93 color_ = SkColorSetRGB((SkColorGetR(color_) + 5) % 255,
94 SkColorGetG(color_), 94 SkColorGetG(color_),
95 SkColorGetB(color_)); 95 SkColorGetB(color_));
(...skipping 11 matching lines...) Expand all
107 }; 107 };
108 108
109 class TestWindowContents : public views::WidgetDelegateView { 109 class TestWindowContents : public views::WidgetDelegateView {
110 public: 110 public:
111 TestWindowContents() {} 111 TestWindowContents() {}
112 virtual ~TestWindowContents() {} 112 virtual ~TestWindowContents() {}
113 113
114 private: 114 private:
115 // Overridden from views::View: 115 // Overridden from views::View:
116 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { 116 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
117 canvas->FillRectInt(SK_ColorGRAY, 0, 0, width(), height()); 117 canvas->FillRect(SK_ColorGRAY, GetLocalBounds());
118 } 118 }
119 119
120 // Overridden from views::WidgetDelegateView: 120 // Overridden from views::WidgetDelegateView:
121 virtual string16 GetWindowTitle() const OVERRIDE { 121 virtual string16 GetWindowTitle() const OVERRIDE {
122 return ASCIIToUTF16("Test Window!"); 122 return ASCIIToUTF16("Test Window!");
123 } 123 }
124 virtual View* GetContentsView() OVERRIDE { 124 virtual View* GetContentsView() OVERRIDE {
125 return this; 125 return this;
126 } 126 }
127 127
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 contents, window2, gfx::Rect(120, 150, 200, 200)); 182 contents, window2, gfx::Rect(120, 150, 200, 200));
183 views_window->Show(); 183 views_window->Show();
184 184
185 aura::Desktop::GetInstance()->Run(); 185 aura::Desktop::GetInstance()->Run();
186 186
187 delete aura::Desktop::GetInstance(); 187 delete aura::Desktop::GetInstance();
188 188
189 return 0; 189 return 0;
190 } 190 }
191 191
OLDNEW
« no previous file with comments | « ui/gfx/render_text_win.cc ('k') | views/border.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698