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

Side by Side Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc

Issue 8122013: Allow CanvasSkia to bind to an existing SkCanvas. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: 1 more fix Created 9 years, 2 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/frame/opaque_browser_frame_view.h" 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 int bottom_y = y + split_point; 795 int bottom_y = y + split_point;
796 ui::ThemeProvider* tp = GetThemeProvider(); 796 ui::ThemeProvider* tp = GetThemeProvider();
797 SkBitmap* toolbar_left = tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER); 797 SkBitmap* toolbar_left = tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER);
798 int bottom_edge_height = std::min(toolbar_left->height(), h) - split_point; 798 int bottom_edge_height = std::min(toolbar_left->height(), h) - split_point;
799 799
800 // Split our canvas out so we can mask out the corners of the toolbar 800 // Split our canvas out so we can mask out the corners of the toolbar
801 // without masking out the frame. 801 // without masking out the frame.
802 canvas->SaveLayerAlpha( 802 canvas->SaveLayerAlpha(
803 255, gfx::Rect(x - kClientEdgeThickness, y, w + kClientEdgeThickness * 3, 803 255, gfx::Rect(x - kClientEdgeThickness, y, w + kClientEdgeThickness * 3,
804 h)); 804 h));
805 canvas->AsCanvasSkia()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); 805 canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
806 806
807 SkColor theme_toolbar_color = 807 SkColor theme_toolbar_color =
808 tp->GetColor(ThemeService::COLOR_TOOLBAR); 808 tp->GetColor(ThemeService::COLOR_TOOLBAR);
809 canvas->FillRectInt(theme_toolbar_color, x, bottom_y, w, bottom_edge_height); 809 canvas->FillRectInt(theme_toolbar_color, x, bottom_y, w, bottom_edge_height);
810 810
811 // Tile the toolbar image starting at the frame edge on the left and where the 811 // Tile the toolbar image starting at the frame edge on the left and where the
812 // horizontal tabstrip is (or would be) on the top. 812 // horizontal tabstrip is (or would be) on the top.
813 SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR); 813 SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR);
814 canvas->TileImageInt(*theme_toolbar, x, 814 canvas->TileImageInt(*theme_toolbar, x,
815 bottom_y - GetHorizontalTabStripVerticalOffset(false), x, 815 bottom_y - GetHorizontalTabStripVerticalOffset(false), x,
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 g_browser_process->profile_manager()->GetProfileInfoCache(); 1170 g_browser_process->profile_manager()->GetProfileInfoCache();
1171 Profile* profile = browser_view_->browser()->profile(); 1171 Profile* profile = browser_view_->browser()->profile();
1172 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); 1172 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
1173 if (index != std::string::npos) { 1173 if (index != std::string::npos) {
1174 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); 1174 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index));
1175 avatar_button_->SetText(UTF16ToWideHack( 1175 avatar_button_->SetText(UTF16ToWideHack(
1176 cache.GetNameOfProfileAtIndex(index))); 1176 cache.GetNameOfProfileAtIndex(index)));
1177 } 1177 }
1178 } 1178 }
1179 } 1179 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698