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

Side by Side Diff: chrome/browser/themes/browser_theme_pack.cc

Issue 10690115: Fixes misaligned tab background image (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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/themes/browser_theme_pack.h" 5 #include "chrome/browser/themes/browser_theme_pack.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/memory/ref_counted_memory.h" 9 #include "base/memory/ref_counted_memory.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 gfx::Size bg_tint_dip_size(image_rep_to_tint.GetWidth(), 1009 gfx::Size bg_tint_dip_size(image_rep_to_tint.GetWidth(),
1010 image_rep_to_tint.GetHeight()); 1010 image_rep_to_tint.GetHeight());
1011 int vertical_offset = bitmaps->count(prs_id) 1011 int vertical_offset = bitmaps->count(prs_id)
1012 ? kRestoredTabVerticalOffset : 0; 1012 ? kRestoredTabVerticalOffset : 0;
1013 gfx::Canvas canvas(gfx::Size(bg_tint.width(), bg_tint.height()), 1013 gfx::Canvas canvas(gfx::Size(bg_tint.width(), bg_tint.height()),
1014 false); 1014 false);
1015 SkScalar image_rep_to_tint_scale = 1015 SkScalar image_rep_to_tint_scale =
1016 SkFloatToScalar(image_rep_to_tint.GetScale()); 1016 SkFloatToScalar(image_rep_to_tint.GetScale());
1017 canvas.sk_canvas()->scale(image_rep_to_tint_scale, 1017 canvas.sk_canvas()->scale(image_rep_to_tint_scale,
1018 image_rep_to_tint_scale); 1018 image_rep_to_tint_scale);
1019 canvas.TileImageInt(bg_tint, 0, vertical_offset, 1019 canvas.TileImageInt(bg_tint, 0, vertical_offset, 0, 0,
1020 bg_tint_dip_size.width(), bg_tint_dip_size.height()); 1020 bg_tint_dip_size.width(), bg_tint_dip_size.height());
1021 1021
1022 // If they've provided a custom image, overlay it. 1022 // If they've provided a custom image, overlay it.
1023 ImageCache::const_iterator overlay_it = bitmaps->find(prs_id); 1023 ImageCache::const_iterator overlay_it = bitmaps->find(prs_id);
1024 if (overlay_it != bitmaps->end()) { 1024 if (overlay_it != bitmaps->end()) {
1025 const gfx::ImageSkia* overlay = overlay_it->second->ToImageSkia(); 1025 const gfx::ImageSkia* overlay = overlay_it->second->ToImageSkia();
1026 canvas.TileImageInt(*overlay, 0, 0, bg_tint_dip_size.width(), 1026 canvas.TileImageInt(*overlay, 0, 0, bg_tint_dip_size.width(),
1027 overlay->height()); 1027 overlay->height());
1028 } 1028 }
1029 SkBitmap bg_tab = canvas.ExtractBitmap(); 1029 SkBitmap bg_tab = canvas.ExtractBitmap();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 hsl.h = tints_[i].h; 1085 hsl.h = tints_[i].h;
1086 hsl.s = tints_[i].s; 1086 hsl.s = tints_[i].s;
1087 hsl.l = tints_[i].l; 1087 hsl.l = tints_[i].l;
1088 return hsl; 1088 return hsl;
1089 } 1089 }
1090 } 1090 }
1091 } 1091 }
1092 1092
1093 return ThemeService::GetDefaultTint(id); 1093 return ThemeService::GetDefaultTint(id);
1094 } 1094 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698