| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser_theme_provider.h" | 5 #include "chrome/browser/browser_theme_provider.h" |
| 6 | 6 |
| 7 #include "base/gfx/png_decoder.h" | 7 #include "base/gfx/png_decoder.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/browser_list.h" | 10 #include "chrome/browser/browser_list.h" |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 // The requested image is a background tab. Get a frame to create the | 802 // The requested image is a background tab. Get a frame to create the |
| 803 // tab against. As themes don't use the glass frame, we don't have to | 803 // tab against. As themes don't use the glass frame, we don't have to |
| 804 // worry about compositing them together, as our default theme provides | 804 // worry about compositing them together, as our default theme provides |
| 805 // the necessary bitmaps. | 805 // the necessary bitmaps. |
| 806 int base_id = (id == IDR_THEME_TAB_BACKGROUND) ? | 806 int base_id = (id == IDR_THEME_TAB_BACKGROUND) ? |
| 807 IDR_THEME_FRAME : IDR_THEME_FRAME_INCOGNITO; | 807 IDR_THEME_FRAME : IDR_THEME_FRAME_INCOGNITO; |
| 808 | 808 |
| 809 std::map<int, SkBitmap*>::iterator it = image_cache_.find(base_id); | 809 std::map<int, SkBitmap*>::iterator it = image_cache_.find(base_id); |
| 810 if (it != image_cache_.end()) { | 810 if (it != image_cache_.end()) { |
| 811 SkBitmap* frame = it->second; | 811 SkBitmap* frame = it->second; |
| 812 int blur_amount = (HasCustomImage(id)) ? 1 : 5; | 812 int blur_amount = (HasCustomImage(id)) ? 1 : 2; |
| 813 SkBitmap blurred = | 813 SkBitmap blurred = |
| 814 skia::ImageOperations::CreateBlurredBitmap(*frame, blur_amount); | 814 skia::ImageOperations::CreateBlurredBitmap(*frame, blur_amount); |
| 815 SkBitmap* bg_tab = new SkBitmap(TintBitmap(blurred, TINT_BACKGROUND_TAB)); | 815 SkBitmap* bg_tab = new SkBitmap(TintBitmap(blurred, TINT_BACKGROUND_TAB)); |
| 816 | 816 |
| 817 // If they've provided a custom image, overlay it. | 817 // If they've provided a custom image, overlay it. |
| 818 if (HasCustomImage(id)) { | 818 if (HasCustomImage(id)) { |
| 819 SkBitmap* overlay = LoadThemeBitmap(id); | 819 SkBitmap* overlay = LoadThemeBitmap(id); |
| 820 if (overlay) { | 820 if (overlay) { |
| 821 SkCanvas canvas(*bg_tab); | 821 SkCanvas canvas(*bg_tab); |
| 822 for (int x = 0; x < bg_tab->width(); x += overlay->width()) | 822 for (int x = 0; x < bg_tab->width(); x += overlay->width()) |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 delete i->second; | 966 delete i->second; |
| 967 } | 967 } |
| 968 image_cache_.clear(); | 968 image_cache_.clear(); |
| 969 } | 969 } |
| 970 | 970 |
| 971 #if defined(TOOLKIT_VIEWS) | 971 #if defined(TOOLKIT_VIEWS) |
| 972 void BrowserThemeProvider::FreePlatformCaches() { | 972 void BrowserThemeProvider::FreePlatformCaches() { |
| 973 // Views (Skia) has no platform image cache to clear. | 973 // Views (Skia) has no platform image cache to clear. |
| 974 } | 974 } |
| 975 #endif | 975 #endif |
| OLD | NEW |