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

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

Issue 1829093002: Use sk_sp-based APIs for SkColorFilter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to reviews Created 4 years, 8 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
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_strip.h" 5 #include "chrome/browser/ui/views/tabs/tab_strip.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 looper_builder.addLayer(); 142 looper_builder.addLayer();
143 143
144 SkLayerDrawLooper::LayerInfo layer_info; 144 SkLayerDrawLooper::LayerInfo layer_info;
145 layer_info.fPaintBits |= SkLayerDrawLooper::kMaskFilter_Bit; 145 layer_info.fPaintBits |= SkLayerDrawLooper::kMaskFilter_Bit;
146 layer_info.fPaintBits |= SkLayerDrawLooper::kColorFilter_Bit; 146 layer_info.fPaintBits |= SkLayerDrawLooper::kColorFilter_Bit;
147 layer_info.fColorMode = SkXfermode::kDst_Mode; 147 layer_info.fColorMode = SkXfermode::kDst_Mode;
148 layer_info.fOffset.set(0, 1); 148 layer_info.fOffset.set(0, 1);
149 skia::RefPtr<SkMaskFilter> blur_mask = 149 skia::RefPtr<SkMaskFilter> blur_mask =
150 skia::AdoptRef(SkBlurMaskFilter::Create( 150 skia::AdoptRef(SkBlurMaskFilter::Create(
151 kNormal_SkBlurStyle, 0.5, SkBlurMaskFilter::kHighQuality_BlurFlag)); 151 kNormal_SkBlurStyle, 0.5, SkBlurMaskFilter::kHighQuality_BlurFlag));
152 skia::RefPtr<SkColorFilter> color_filter = skia::AdoptRef(
153 SkColorFilter::CreateModeFilter(color, SkXfermode::kSrcIn_Mode));
154 SkPaint* layer_paint = looper_builder.addLayer(layer_info); 152 SkPaint* layer_paint = looper_builder.addLayer(layer_info);
155 layer_paint->setMaskFilter(blur_mask.get()); 153 layer_paint->setMaskFilter(blur_mask.get());
156 layer_paint->setColorFilter(color_filter.get()); 154 layer_paint->setColorFilter(
155 SkColorFilter::MakeModeFilter(color, SkXfermode::kSrcIn_Mode));
157 156
158 return skia::AdoptRef(looper_builder.detachLooper()); 157 return skia::AdoptRef(looper_builder.detachLooper());
159 } 158 }
160 159
161 // Animation delegate used for any automatic tab movement. Hides the tab if it 160 // Animation delegate used for any automatic tab movement. Hides the tab if it
162 // is not fully visible within the tabstrip area, to prevent overflow clipping. 161 // is not fully visible within the tabstrip area, to prevent overflow clipping.
163 class TabAnimationDelegate : public gfx::AnimationDelegate { 162 class TabAnimationDelegate : public gfx::AnimationDelegate {
164 public: 163 public:
165 TabAnimationDelegate(TabStrip* tab_strip, Tab* tab); 164 TabAnimationDelegate(TabStrip* tab_strip, Tab* tab);
166 ~TabAnimationDelegate() override; 165 ~TabAnimationDelegate() override;
(...skipping 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after
2884 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); 2883 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point);
2885 if (view) 2884 if (view)
2886 return view; 2885 return view;
2887 } 2886 }
2888 Tab* tab = FindTabForEvent(point); 2887 Tab* tab = FindTabForEvent(point);
2889 if (tab) 2888 if (tab)
2890 return ConvertPointToViewAndGetEventHandler(this, tab, point); 2889 return ConvertPointToViewAndGetEventHandler(this, tab, point);
2891 } 2890 }
2892 return this; 2891 return this;
2893 } 2892 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698