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

Side by Side Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 2893083002: cc: Move SkShader construction to a single spot in PaintShader (Closed)
Patch Set: update Created 3 years, 6 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 | « cc/paint/paint_shader.cc ('k') | content/browser/web_contents/aura/shadow_layer_delegate.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) 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 "chrome/browser/ui/views/tabs/tab.h" 5 #include "chrome/browser/ui/views/tabs/tab.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 return GetLayoutInsets(TAB).left() - 0.5f; 111 return GetLayoutInsets(TAB).left() - 0.5f;
112 } 112 }
113 113
114 void DrawHighlight(gfx::Canvas* canvas, 114 void DrawHighlight(gfx::Canvas* canvas,
115 const SkPoint& p, 115 const SkPoint& p,
116 SkScalar radius, 116 SkScalar radius,
117 SkColor color) { 117 SkColor color) {
118 const SkColor colors[2] = { color, SkColorSetA(color, 0) }; 118 const SkColor colors[2] = { color, SkColorSetA(color, 0) };
119 cc::PaintFlags flags; 119 cc::PaintFlags flags;
120 flags.setAntiAlias(true); 120 flags.setAntiAlias(true);
121 flags.setShader(cc::WrapSkShader(SkGradientShader::MakeRadial( 121 flags.setShader(cc::PaintShader::MakeRadialGradient(
122 p, radius, colors, nullptr, 2, SkShader::kClamp_TileMode))); 122 p, radius, colors, nullptr, 2, SkShader::kClamp_TileMode));
123 canvas->sk_canvas()->drawRect( 123 canvas->sk_canvas()->drawRect(
124 SkRect::MakeXYWH(p.x() - radius, p.y() - radius, radius * 2, radius * 2), 124 SkRect::MakeXYWH(p.x() - radius, p.y() - radius, radius * 2, radius * 2),
125 flags); 125 flags);
126 } 126 }
127 127
128 // Returns whether the favicon for the given URL should be colored according to 128 // Returns whether the favicon for the given URL should be colored according to
129 // the browser theme. 129 // the browser theme.
130 bool ShouldThemifyFaviconForUrl(const GURL& url) { 130 bool ShouldThemifyFaviconForUrl(const GURL& url) {
131 return url.SchemeIs(content::kChromeUIScheme) && 131 return url.SchemeIs(content::kChromeUIScheme) &&
132 url.host() != chrome::kChromeUIHelpHost && 132 url.host() != chrome::kChromeUIHelpHost &&
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 return; 1440 return;
1441 1441
1442 // Extends the area to the bottom when the crash animation is in progress. 1442 // Extends the area to the bottom when the crash animation is in progress.
1443 if (crash_icon_animation_->is_animating()) 1443 if (crash_icon_animation_->is_animating())
1444 bounds.set_height(height() - bounds.y()); 1444 bounds.set_height(height() - bounds.y());
1445 SchedulePaintInRect(GetMirroredRect(bounds)); 1445 SchedulePaintInRect(GetMirroredRect(bounds));
1446 } 1446 }
1447 1447
1448 Tab::BackgroundCache::BackgroundCache() = default; 1448 Tab::BackgroundCache::BackgroundCache() = default;
1449 Tab::BackgroundCache::~BackgroundCache() = default; 1449 Tab::BackgroundCache::~BackgroundCache() = default;
OLDNEW
« no previous file with comments | « cc/paint/paint_shader.cc ('k') | content/browser/web_contents/aura/shadow_layer_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698