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

Side by Side Diff: ui/app_list/views/app_list_background.cc

Issue 290333012: [Win] Draw the circular avatar programmatically rather than with a frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing virtual keyword Created 6 years, 7 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 | « chrome/browser/ui/views/profiles/profile_chooser_view.cc ('k') | ui/gfx/canvas.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/app_list/views/app_list_background.h" 5 #include "ui/app_list/views/app_list_background.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "third_party/skia/include/core/SkPaint.h" 9 #include "third_party/skia/include/core/SkPaint.h"
10 #include "third_party/skia/include/core/SkPath.h" 10 #include "third_party/skia/include/core/SkPath.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 void AppListBackground::Paint(gfx::Canvas* canvas, 43 void AppListBackground::Paint(gfx::Canvas* canvas,
44 views::View* view) const { 44 views::View* view) const {
45 gfx::Rect bounds = view->GetContentsBounds(); 45 gfx::Rect bounds = view->GetContentsBounds();
46 46
47 canvas->Save(); 47 canvas->Save();
48 SkPath path; 48 SkPath path;
49 // Contents corner radius is 1px smaller than border corner radius. 49 // Contents corner radius is 1px smaller than border corner radius.
50 SkScalar radius = SkIntToScalar(corner_radius_ - 1); 50 SkScalar radius = SkIntToScalar(corner_radius_ - 1);
51 path.addRoundRect(gfx::RectToSkRect(bounds), radius, radius); 51 path.addRoundRect(gfx::RectToSkRect(bounds), radius, radius);
52 canvas->ClipPath(path); 52 canvas->ClipPath(path, false);
53 53
54 SkPaint paint; 54 SkPaint paint;
55 paint.setStyle(SkPaint::kFill_Style); 55 paint.setStyle(SkPaint::kFill_Style);
56 56
57 int contents_top = bounds.y(); 57 int contents_top = bounds.y();
58 views::View* search_box_view = main_view_->search_box_view(); 58 views::View* search_box_view = main_view_->search_box_view();
59 if (main_view_->visible() && search_box_view->visible()) { 59 if (main_view_->visible() && search_box_view->visible()) {
60 const gfx::Rect search_box_view_bounds = 60 const gfx::Rect search_box_view_bounds =
61 search_box_view->ConvertRectToWidget(search_box_view->GetLocalBounds()); 61 search_box_view->ConvertRectToWidget(search_box_view->GetLocalBounds());
62 gfx::Rect search_box_rect(bounds.x(), 62 gfx::Rect search_box_rect(bounds.x(),
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 IDR_APP_LIST_EXPERIMENTAL_ICON); 107 IDR_APP_LIST_EXPERIMENTAL_ICON);
108 canvas->DrawImageInt(experimental_icon, 108 canvas->DrawImageInt(experimental_icon,
109 contents_rect.right() - experimental_icon.width(), 109 contents_rect.right() - experimental_icon.width(),
110 contents_rect.bottom() - experimental_icon.height()); 110 contents_rect.bottom() - experimental_icon.height());
111 } 111 }
112 112
113 canvas->Restore(); 113 canvas->Restore();
114 } 114 }
115 115
116 } // namespace app_list 116 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/profiles/profile_chooser_view.cc ('k') | ui/gfx/canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698