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