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