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

Side by Side Diff: ash/common/shelf/shelf_button.cc

Issue 2690583002: Make cc/paint have concrete types (Closed)
Patch Set: PaintRecord as typedef, fixup playback calls Created 3 years, 9 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
« no previous file with comments | « ash/common/shelf/overflow_button.cc ('k') | cc/layers/painted_overlay_scrollbar_layer.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/common/shelf/shelf_button.h" 5 #include "ash/common/shelf/shelf_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/ash_constants.h" 9 #include "ash/common/ash_constants.h"
10 #include "ash/common/shelf/ink_drop_button_listener.h" 10 #include "ash/common/shelf/ink_drop_button_listener.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 DCHECK_EQ(width(), height()); 147 DCHECK_EQ(width(), height());
148 DCHECK_EQ(kIndicatorRadiusDip, width() / 2); 148 DCHECK_EQ(kIndicatorRadiusDip, width() / 2);
149 const float dsf = canvas->UndoDeviceScaleFactor(); 149 const float dsf = canvas->UndoDeviceScaleFactor();
150 const int kStrokeWidthPx = 1; 150 const int kStrokeWidthPx = 1;
151 gfx::PointF center = gfx::RectF(GetLocalBounds()).CenterPoint(); 151 gfx::PointF center = gfx::RectF(GetLocalBounds()).CenterPoint();
152 center.Scale(dsf); 152 center.Scale(dsf);
153 153
154 // Fill the center. 154 // Fill the center.
155 cc::PaintFlags flags; 155 cc::PaintFlags flags;
156 flags.setColor(kIndicatorColor); 156 flags.setColor(kIndicatorColor);
157 flags.setFlags(cc::PaintFlags::kAntiAlias_Flag); 157 flags.setAntiAlias(true);
158 canvas->DrawCircle(center, dsf * kIndicatorRadiusDip - kStrokeWidthPx, 158 canvas->DrawCircle(center, dsf * kIndicatorRadiusDip - kStrokeWidthPx,
159 flags); 159 flags);
160 160
161 // Stroke the border. 161 // Stroke the border.
162 flags.setColor(SkColorSetA(SK_ColorBLACK, 0x4D)); 162 flags.setColor(SkColorSetA(SK_ColorBLACK, 0x4D));
163 flags.setStyle(SkPaint::kStroke_Style); 163 flags.setStyle(cc::PaintFlags::kStroke_Style);
164 canvas->DrawCircle( 164 canvas->DrawCircle(
165 center, dsf * kIndicatorRadiusDip - kStrokeWidthPx / 2.0f, flags); 165 center, dsf * kIndicatorRadiusDip - kStrokeWidthPx / 2.0f, flags);
166 } 166 }
167 167
168 // ShelfButtonAnimation::Observer 168 // ShelfButtonAnimation::Observer
169 void AnimationProgressed() override { 169 void AnimationProgressed() override {
170 UpdateAnimating(); 170 UpdateAnimating();
171 SchedulePaint(); 171 SchedulePaint();
172 } 172 }
173 173
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 icon_view_->SetHorizontalAlignment(is_horizontal_shelf 505 icon_view_->SetHorizontalAlignment(is_horizontal_shelf
506 ? views::ImageView::CENTER 506 ? views::ImageView::CENTER
507 : views::ImageView::LEADING); 507 : views::ImageView::LEADING);
508 icon_view_->SetVerticalAlignment(is_horizontal_shelf 508 icon_view_->SetVerticalAlignment(is_horizontal_shelf
509 ? views::ImageView::LEADING 509 ? views::ImageView::LEADING
510 : views::ImageView::CENTER); 510 : views::ImageView::CENTER);
511 SchedulePaint(); 511 SchedulePaint();
512 } 512 }
513 513
514 } // namespace ash 514 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/overflow_button.cc ('k') | cc/layers/painted_overlay_scrollbar_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698