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

Side by Side Diff: ui/views/desktop/desktop_background.cc

Issue 8598024: Now that we are doing a hard-cut-over to Aura, remove a bunch of *Views based classes that are ob... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' 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/views/desktop/desktop_background.h ('k') | ui/views/desktop/desktop_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/views/desktop/desktop_background.h"
6
7 #include "ui/gfx/canvas_skia.h"
8 #include "ui/gfx/path.h"
9 #include "views/view.h"
10
11 namespace views {
12 namespace desktop {
13
14 DesktopBackground::DesktopBackground() {
15 }
16
17 DesktopBackground::~DesktopBackground() {
18 }
19
20 void DesktopBackground::Paint(gfx::Canvas* canvas, View* view) const {
21 // Paint the sky.
22 canvas->FillRect(SK_ColorCYAN, view->GetLocalBounds());
23
24 SkPaint paint;
25 paint.setAntiAlias(true);
26 paint.setStyle(SkPaint::kFill_Style);
27
28 // Paint the rolling fields of green.
29 {
30 gfx::Path path;
31 path.moveTo(0, view->height() / 2);
32 path.cubicTo(view->height() / 4, view->height() / 4,
33 view->height() / 2, view->height() / 2,
34 SkIntToScalar(view->width()), view->height() / 2);
35 path.lineTo(SkIntToScalar(view->width()), SkIntToScalar(view->height()));
36 path.lineTo(0, SkIntToScalar(view->height()));
37 path.close();
38
39 paint.setColor(SK_ColorGREEN);
40 canvas->GetSkCanvas()->drawPath(path, paint);
41 }
42
43 // Paint the shining sun.
44 {
45 gfx::Path path;
46 path.addCircle(view->height() / 4, view->height() / 8, view->height() / 16);
47 path.close();
48
49 paint.setColor(SK_ColorYELLOW);
50 canvas->GetSkCanvas()->drawPath(path, paint);
51 }
52 }
53
54 } // namespace desktop
55 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/desktop/desktop_background.h ('k') | ui/views/desktop/desktop_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698