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

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

Issue 6879013: skia::PlatformCanvas is being deprecated. Going forward we will use gfx::Canvas wherever we need ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | 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 "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/themes/theme_service.h" 9 #include "chrome/browser/themes/theme_service.h"
10 #include "chrome/browser/ui/views/frame/browser_frame.h" 10 #include "chrome/browser/ui/views/frame/browser_frame.h"
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 int bottom_y = y + split_point; 764 int bottom_y = y + split_point;
765 ui::ThemeProvider* tp = GetThemeProvider(); 765 ui::ThemeProvider* tp = GetThemeProvider();
766 SkBitmap* toolbar_left = tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER); 766 SkBitmap* toolbar_left = tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER);
767 int bottom_edge_height = std::min(toolbar_left->height(), h) - split_point; 767 int bottom_edge_height = std::min(toolbar_left->height(), h) - split_point;
768 768
769 // Split our canvas out so we can mask out the corners of the toolbar 769 // Split our canvas out so we can mask out the corners of the toolbar
770 // without masking out the frame. 770 // without masking out the frame.
771 canvas->SaveLayerAlpha( 771 canvas->SaveLayerAlpha(
772 255, gfx::Rect(x - kClientEdgeThickness, y, w + kClientEdgeThickness * 3, 772 255, gfx::Rect(x - kClientEdgeThickness, y, w + kClientEdgeThickness * 3,
773 h)); 773 h));
774 canvas->AsCanvasSkia()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); 774 canvas->AsCanvasSkia()->skia_canvas()->drawARGB(
775 0, 255, 255, 255, SkXfermode::kClear_Mode);
775 776
776 SkColor theme_toolbar_color = 777 SkColor theme_toolbar_color =
777 tp->GetColor(ThemeService::COLOR_TOOLBAR); 778 tp->GetColor(ThemeService::COLOR_TOOLBAR);
778 canvas->FillRectInt(theme_toolbar_color, x, bottom_y, w, bottom_edge_height); 779 canvas->FillRectInt(theme_toolbar_color, x, bottom_y, w, bottom_edge_height);
779 780
780 // Tile the toolbar image starting at the frame edge on the left and where the 781 // Tile the toolbar image starting at the frame edge on the left and where the
781 // horizontal tabstrip is (or would be) on the top. 782 // horizontal tabstrip is (or would be) on the top.
782 SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR); 783 SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR);
783 canvas->TileImageInt(*theme_toolbar, x, 784 canvas->TileImageInt(*theme_toolbar, x,
784 bottom_y - GetHorizontalTabStripVerticalOffset(false), x, 785 bottom_y - GetHorizontalTabStripVerticalOffset(false), x,
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 1074
1074 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, 1075 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width,
1075 int height) const { 1076 int height) const {
1076 int top_height = NonClientTopBorderHeight(false, false); 1077 int top_height = NonClientTopBorderHeight(false, false);
1077 int border_thickness = NonClientBorderThickness(); 1078 int border_thickness = NonClientBorderThickness();
1078 return gfx::Rect(border_thickness, top_height, 1079 return gfx::Rect(border_thickness, top_height,
1079 std::max(0, width - (2 * border_thickness)), 1080 std::max(0, width - (2 * border_thickness)),
1080 std::max(0, height - GetReservedHeight() - 1081 std::max(0, height - GetReservedHeight() -
1081 top_height - border_thickness)); 1082 top_height - border_thickness));
1082 } 1083 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view.cc ('k') | chrome/browser/ui/views/fullscreen_exit_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698