diff options
author | scroggo <scroggo@google.com> | 2015-12-10 11:39:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-10 19:40:32 +0000 |
commit | 66142aeb157633e07f84a4eb792a9c87f2149172 (patch) | |
tree | 81324e6e60984def0978b4bc3cb0141c2ed1ee43 | |
parent | 3e7b541a4c2cfbae7617d2d81084e846fb848c88 (diff) | |
download | chromium_src-66142aeb157633e07f84a4eb792a9c87f2149172.zip chromium_src-66142aeb157633e07f84a4eb792a9c87f2149172.tar.gz chromium_src-66142aeb157633e07f84a4eb792a9c87f2149172.tar.bz2 |
Use proper namespace in skia/ext
The code was cut and pasted and kept its old namespace.
Remove SkPointToCGPoint and CGPointToSkPoint, which were not used anywhere.
BUG=561010
Review URL: https://codereview.chromium.org/1508893003
Cr-Commit-Position: refs/heads/master@{#364427}
60 files changed, 171 insertions, 181 deletions
diff --git a/chrome/browser/themes/theme_service_mac.mm b/chrome/browser/themes/theme_service_mac.mm index 1b9a541..061e513 100644 --- a/chrome/browser/themes/theme_service_mac.mm +++ b/chrome/browser/themes/theme_service_mac.mm @@ -113,7 +113,7 @@ NSColor* ThemeService::GetNSColor(int id) const { return nscolor_iter->second; SkColor sk_color = GetColor(id); - NSColor* color = gfx::SkColorToCalibratedNSColor(sk_color); + NSColor* color = skia::SkColorToCalibratedNSColor(sk_color); // We loaded successfully. Cache the color. if (color) diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm index 22f98a3..e0d3574 100644 --- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm +++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm @@ -638,7 +638,7 @@ namespace { // Convert a color constant to an NSColor that can be compared with |bitmap|. NSColor* ColorInBitmapColorSpace(SkColor color, NSBitmapImageRep* bitmap) { - return [gfx::SkColorToSRGBNSColor(color) + return [skia::SkColorToSRGBNSColor(color) colorUsingColorSpace:[bitmap colorSpace]]; } diff --git a/chrome/browser/ui/cocoa/apps/titlebar_background_view.mm b/chrome/browser/ui/cocoa/apps/titlebar_background_view.mm index e56048e..6cde534 100644 --- a/chrome/browser/ui/cocoa/apps/titlebar_background_view.mm +++ b/chrome/browser/ui/cocoa/apps/titlebar_background_view.mm @@ -35,8 +35,8 @@ positioned:NSWindowBelow relativeTo:nil]; - [titlebar_background_view setColor:gfx::SkColorToSRGBNSColor(activeColor) - inactiveColor:gfx::SkColorToSRGBNSColor(inactiveColor)]; + [titlebar_background_view setColor:skia::SkColorToSRGBNSColor(activeColor) + inactiveColor:skia::SkColorToSRGBNSColor(inactiveColor)]; return titlebar_background_view.autorelease(); } diff --git a/chrome/browser/ui/cocoa/autofill/autofill_notification_controller.mm b/chrome/browser/ui/cocoa/autofill/autofill_notification_controller.mm index 0246250..3bb1263 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_notification_controller.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_notification_controller.mm @@ -74,14 +74,14 @@ base::scoped_nsobject<AutofillNotificationView> view( [[AutofillNotificationView alloc] initWithFrame:NSZeroRect]); [view setBackgroundColor: - gfx::SkColorToCalibratedNSColor(notification->GetBackgroundColor())]; + skia::SkColorToCalibratedNSColor(notification->GetBackgroundColor())]; [view setBorderColor: - gfx::SkColorToCalibratedNSColor(notification->GetBorderColor())]; + skia::SkColorToCalibratedNSColor(notification->GetBorderColor())]; [self setView:view]; textview_.reset([[HyperlinkTextView alloc] initWithFrame:NSZeroRect]); NSColor* textColor = - gfx::SkColorToCalibratedNSColor(notification->GetTextColor()); + skia::SkColorToCalibratedNSColor(notification->GetTextColor()); [textview_ setMessage:base::SysUTF16ToNSString(notification->display_text()) withFont:[NSFont labelFontOfSize:[[textview_ font] pointSize]] messageColor:textColor]; diff --git a/chrome/browser/ui/cocoa/autofill/autofill_section_view.mm b/chrome/browser/ui/cocoa/autofill/autofill_section_view.mm index e10435a..b69ab99 100644 --- a/chrome/browser/ui/cocoa/autofill/autofill_section_view.mm +++ b/chrome/browser/ui/cocoa/autofill/autofill_section_view.mm @@ -44,7 +44,7 @@ SkColor kShadingColor = 0x07000000; // SkColorSetARGB(7, 0, 0, 0); - (NSColor*)hoverColor { // Shading color is specified as a alpha component color, so premultiply. - NSColor* shadingColor = gfx::SkColorToCalibratedNSColor(kShadingColor); + NSColor* shadingColor = skia::SkColorToCalibratedNSColor(kShadingColor); NSColor* blendedColor = [[[self window] backgroundColor] blendedColorWithFraction:[shadingColor alphaComponent] ofColor:shadingColor]; diff --git a/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm index 46b794c..50b0993 100644 --- a/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm +++ b/chrome/browser/ui/cocoa/autofill/card_unmask_prompt_view_bridge.mm @@ -304,7 +304,7 @@ void CardUnmaskPromptViewBridge::PerformClose() { if (!text.empty()) { if (!permanentErrorBox_) { permanentErrorBox_ = [CardUnmaskPromptViewCocoa createPlainBox]; - [permanentErrorBox_ setFillColor:gfx::SkColorToCalibratedNSColor( + [permanentErrorBox_ setFillColor:skia::SkColorToCalibratedNSColor( autofill::kWarningColor)]; [permanentErrorBox_ setContentViewMargins:NSMakeSize(kPermanentErrorHorizontalPadding, @@ -312,7 +312,7 @@ void CardUnmaskPromptViewBridge::PerformClose() { permanentErrorLabel_.reset([constrained_window::CreateLabel() retain]); [permanentErrorLabel_ setAutoresizingMask:NSViewWidthSizable]; - [permanentErrorLabel_ setTextColor:gfx::SkColorToCalibratedNSColor( + [permanentErrorLabel_ setTextColor:skia::SkColorToCalibratedNSColor( kPermanentErrorTextColor)]; [permanentErrorBox_ addSubview:permanentErrorLabel_]; @@ -482,7 +482,7 @@ void CardUnmaskPromptViewBridge::PerformClose() { base::scoped_nsobject<NSBox> box = [CardUnmaskPromptViewCocoa createPlainBox]; [box setAutoresizingMask:NSViewWidthSizable]; - [box setFillColor:gfx::SkColorToCalibratedNSColor(kShadingColor)]; + [box setFillColor:skia::SkColorToCalibratedNSColor(kShadingColor)]; [box setContentViewMargins:NSMakeSize(chrome_style::kHorizontalPadding, chrome_style::kClientBottomPadding)]; [storageView_ addSubview:box]; @@ -516,7 +516,7 @@ void CardUnmaskPromptViewBridge::PerformClose() { base::scoped_nsobject<NSBox> separator = [CardUnmaskPromptViewCocoa createPlainBox]; [separator setAutoresizingMask:NSViewWidthSizable]; - [separator setFillColor:gfx::SkColorToCalibratedNSColor(kSubtleBorderColor)]; + [separator setFillColor:skia::SkColorToCalibratedNSColor(kSubtleBorderColor)]; [storageView_ addSubview:separator]; [box sizeToFit]; @@ -659,7 +659,7 @@ void CardUnmaskPromptViewBridge::PerformClose() { [mainView addSubview:progressOverlayView_]; progressOverlayLabel_.reset([constrained_window::CreateLabel() retain]); - NSColor* throbberBlueColor = gfx::SkColorToCalibratedNSColor( + NSColor* throbberBlueColor = skia::SkColorToCalibratedNSColor( ui::NativeThemeMac::instance()->GetSystemColor( ui::NativeTheme::kColorId_ThrobberSpinningColor)); [progressOverlayLabel_ setTextColor:throbberBlueColor]; @@ -713,7 +713,7 @@ void CardUnmaskPromptViewBridge::PerformClose() { // Add error message label. errorLabel_.reset([constrained_window::CreateLabel() retain]); [errorLabel_ - setTextColor:gfx::SkColorToCalibratedNSColor(autofill::kWarningColor)]; + setTextColor:skia::SkColorToCalibratedNSColor(autofill::kWarningColor)]; [mainView addSubview:errorLabel_]; // Add cancel button. diff --git a/chrome/browser/ui/cocoa/autofill/new_credit_card_bubble_cocoa.mm b/chrome/browser/ui/cocoa/autofill/new_credit_card_bubble_cocoa.mm index b44cc70..3c8c92b 100644 --- a/chrome/browser/ui/cocoa/autofill/new_credit_card_bubble_cocoa.mm +++ b/chrome/browser/ui/cocoa/autofill/new_credit_card_bubble_cocoa.mm @@ -88,7 +88,7 @@ const CGFloat kAnchorlessTopPadding = 10; ui::NativeTheme* nativeTheme = ui::NativeThemeMac::instance(); [[self bubble] setBackgroundColor: - gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( + skia::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( ui::NativeTheme::kColorId_DialogBackground))]; [self performLayout]; } diff --git a/chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.mm b/chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.mm index aa8ca94..81550a8 100644 --- a/chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.mm +++ b/chrome/browser/ui/cocoa/autofill/password_generation_popup_view_cocoa.mm @@ -41,22 +41,22 @@ const CGFloat kDividerHeight = 1; const CGFloat kPasswordSectionVerticalSeparation = 5; NSColor* DividerColor() { - return gfx::SkColorToCalibratedNSColor( + return skia::SkColorToCalibratedNSColor( PasswordGenerationPopupView::kDividerColor); } NSColor* HelpTextBackgroundColor() { - return gfx::SkColorToCalibratedNSColor( + return skia::SkColorToCalibratedNSColor( PasswordGenerationPopupView::kExplanatoryTextBackgroundColor); } NSColor* HelpTextColor() { - return gfx::SkColorToCalibratedNSColor( + return skia::SkColorToCalibratedNSColor( PasswordGenerationPopupView::kExplanatoryTextColor); } NSColor* HelpLinkColor() { - return gfx::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); + return skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); } } // namespace diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm index 77d95d9..a609c13 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm @@ -54,7 +54,7 @@ NSRectFill(dirtyRect); // Overlay with a lighter background color. - NSColor* toolbarColor = gfx::SkColorToCalibratedNSColor( + NSColor* toolbarColor = skia::SkColorToCalibratedNSColor( chrome::GetDetachedBookmarkBarBackgroundColor(themeService)); CGFloat alpha = morph * [toolbarColor alphaComponent]; [[toolbarColor colorWithAlphaComponent:alpha] set]; @@ -75,7 +75,7 @@ NSRect strokeRect = [self bounds]; strokeRect.size.height = [self cr_lineWidth]; if (NSIntersectsRect(strokeRect, dirtyRect)) { - NSColor* strokeColor = gfx::SkColorToCalibratedNSColor( + NSColor* strokeColor = skia::SkColorToCalibratedNSColor( chrome::GetDetachedBookmarkBarSeparatorColor(themeService)); strokeColor = [[self strokeColor] blendedColorWithFraction:morph ofColor:strokeColor]; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_sync_promo_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_sync_promo_controller.mm index be81a2e..41fb770 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_sync_promo_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_sync_promo_controller.mm @@ -68,12 +68,12 @@ const int kFontSize = 11; - (void)loadView { NSBox* promoView = [[[NSBox alloc] init] autorelease]; [promoView setBoxType:NSBoxCustom]; - [promoView setFillColor:gfx::SkColorToDeviceNSColor(kBackgroundColor)]; + [promoView setFillColor:skia::SkColorToDeviceNSColor(kBackgroundColor)]; [promoView setContentViewMargins:NSMakeSize(chrome_style::kHorizontalPadding, kVerticalPadding)]; [promoView setBorderType:NSLineBorder]; [promoView setBorderWidth:kBorderWidth]; - [promoView setBorderColor:gfx::SkColorToDeviceNSColor(kBorderColor)]; + [promoView setBorderColor:skia::SkColorToDeviceNSColor(kBorderColor)]; // Add the sync promo text. size_t offset; @@ -85,13 +85,13 @@ const int kFontSize = 11; NSString* nsPromoText = SysUTF16ToNSString(promoText); NSString* nsLinkText = SysUTF16ToNSString(linkText); NSFont* font = [NSFont labelFontOfSize:kFontSize]; - NSColor* linkColor = gfx::SkColorToCalibratedNSColor( + NSColor* linkColor = skia::SkColorToCalibratedNSColor( chrome_style::GetLinkColor()); textView_.reset([[HyperlinkTextView alloc] init]); [textView_ setMessage:nsPromoText withFont:font - messageColor:gfx::SkColorToDeviceNSColor(kTextColor)]; + messageColor:skia::SkColorToDeviceNSColor(kTextColor)]; [textView_ addLinkRange:NSMakeRange(offset, [nsLinkText length]) withURL:@"about:blank" // using a link here is bad ui linkColor:linkColor]; diff --git a/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm b/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm index 50d2a37..58390da 100644 --- a/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm @@ -95,7 +95,7 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) { [[self bubble] setAlignment:info_bubble::kAlignRightEdgeToAnchorEdge]; [[self bubble] setArrowLocation:info_bubble::kNoArrow]; [[self bubble] setBackgroundColor: - gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( + skia::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( ui::NativeTheme::kColorId_DialogBackground))]; [self performLayout]; @@ -233,7 +233,7 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) { [separatorView setBoxType:NSBoxCustom]; ui::NativeTheme* nativeTheme = ui::NativeThemeMac::instance(); [separatorView setBorderColor: - gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( + skia::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( ui::NativeTheme::kColorId_MenuSeparatorColor))]; [[[self window] contentView] addSubview:separatorView]; @@ -336,7 +336,7 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) { NSAttributedString* title = [self attributedTitle]; if ([self hoverState] != kHoverStateNone) { ui::NativeTheme* nativeTheme = ui::NativeThemeMac::instance(); - [gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( + [skia::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor)) set]; NSRectFillUsingOperation(bounds, NSCompositeSourceOver); @@ -344,7 +344,7 @@ void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval) { base::scoped_nsobject<NSMutableAttributedString> selectedTitle( [[NSMutableAttributedString alloc] initWithAttributedString:title]); NSColor* selectedTitleColor = - gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( + skia::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor)); [selectedTitle addAttribute:NSForegroundColorAttributeName value:selectedTitleColor diff --git a/chrome/browser/ui/cocoa/color_chooser_mac.mm b/chrome/browser/ui/cocoa/color_chooser_mac.mm index bc9166c..a6b5d1e 100644 --- a/chrome/browser/ui/cocoa/color_chooser_mac.mm +++ b/chrome/browser/ui/cocoa/color_chooser_mac.mm @@ -74,7 +74,7 @@ ColorChooserMac::ColorChooserMac(content::WebContents* web_contents, SkColor initial_color) : web_contents_(web_contents) { panel_.reset([[ColorPanelCocoa alloc] initWithChooser:this]); - [panel_ setColor:gfx::SkColorToDeviceNSColor(initial_color)]; + [panel_ setColor:skia::SkColorToDeviceNSColor(initial_color)]; [[NSColorPanel sharedColorPanel] makeKeyAndOrderFront:nil]; } @@ -101,7 +101,7 @@ void ColorChooserMac::End() { } void ColorChooserMac::SetSelectedColor(SkColor color) { - [panel_ setColor:gfx::SkColorToDeviceNSColor(color)]; + [panel_ setColor:skia::SkColorToDeviceNSColor(color)]; } @implementation ColorPanelCocoa @@ -139,7 +139,7 @@ void ColorChooserMac::SetSelectedColor(SkColor color) { nonUserChange_ = NO; return; } - chooser_->DidChooseColorInColorPanel(gfx::NSDeviceColorToSkColor( + chooser_->DidChooseColorInColorPanel(skia::NSDeviceColorToSkColor( [[panel color] colorUsingColorSpaceName:NSDeviceRGBColorSpace])); nonUserChange_ = NO; } diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm index 0c8cb09..9ea5fe9 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_button.mm @@ -46,8 +46,8 @@ NSGradient* GetButtonGradient(ButtonState button_state) { const SkColor start[] = {0xFFF0F0F0, 0xFFF4F4F4, 0xFFEBEBEB, 0xFFEDEDED}; const SkColor end[] = {0xFFE0E0E0, 0xFFE4E4E4, 0xFFDBDBDB, 0xFFDEDEDE}; - NSColor* start_color = gfx::SkColorToCalibratedNSColor(start[button_state]); - NSColor* end_color = gfx::SkColorToCalibratedNSColor(end[button_state]); + NSColor* start_color = skia::SkColorToCalibratedNSColor(start[button_state]); + NSColor* end_color = skia::SkColorToCalibratedNSColor(end[button_state]); return [[[NSGradient alloc] initWithColorsAndLocations: start_color, 0.0, start_color, 0.38, @@ -59,7 +59,7 @@ NSShadow* GetButtonHighlight(ButtonState button_state) { const SkColor color[] = {0xBFFFFFFF, 0xF2FFFFFF, 0x24000000, 0x00000000}; NSShadow* shadow = [[[NSShadow alloc] init] autorelease]; - [shadow setShadowColor:gfx::SkColorToCalibratedNSColor(color[button_state])]; + [shadow setShadowColor:skia::SkColorToCalibratedNSColor(color[button_state])]; [shadow setShadowOffset:NSMakeSize(0, -1)]; [shadow setShadowBlurRadius:2]; return shadow; @@ -69,7 +69,7 @@ NSShadow* GetButtonShadow(ButtonState button_state) { const SkColor color[] = {0x14000000, 0x1F000000, 0x00000000, 0x00000000}; NSShadow* shadow = [[[NSShadow alloc] init] autorelease]; - [shadow setShadowColor:gfx::SkColorToCalibratedNSColor(color[button_state])]; + [shadow setShadowColor:skia::SkColorToCalibratedNSColor(color[button_state])]; [shadow setShadowOffset:NSMakeSize(0, -1)]; [shadow setShadowBlurRadius:0]; return shadow; @@ -78,7 +78,7 @@ NSShadow* GetButtonShadow(ButtonState button_state) { NSColor* GetButtonBorderColor(ButtonState button_state) { const SkColor color[] = {0x40000000, 0x4D000000, 0x4D000000, 0x1F000000}; - return gfx::SkColorToCalibratedNSColor(color[button_state]); + return skia::SkColorToCalibratedNSColor(color[button_state]); } NSAttributedString* GetButtonAttributedString( @@ -93,7 +93,7 @@ NSAttributedString* GetButtonAttributedString( base::scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); [shadow setShadowColor: - gfx::SkColorToCalibratedNSColor(shadow_color[cellButtonState(cell)])]; + skia::SkColorToCalibratedNSColor(shadow_color[cellButtonState(cell)])]; [shadow setShadowOffset:NSMakeSize(0, -1)]; [shadow setShadowBlurRadius:0]; @@ -109,7 +109,7 @@ NSAttributedString* GetButtonAttributedString( NSDictionary* attributes = [NSDictionary dictionaryWithObjectsAndKeys: font, NSFontAttributeName, - gfx::SkColorToCalibratedNSColor(text_color[cellButtonState(cell)]), + skia::SkColorToCalibratedNSColor(text_color[cellButtonState(cell)]), NSForegroundColorAttributeName, shadow.get(), NSShadowAttributeName, paragraphStyle.get(), NSParagraphStyleAttributeName, diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.mm index 102b198..3225ea1 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.mm @@ -40,7 +40,7 @@ backing:bufferingType defer:NO])) { [self setHasShadow:YES]; - [self setBackgroundColor:gfx::SkColorToCalibratedNSColor( + [self setBackgroundColor:skia::SkColorToCalibratedNSColor( chrome_style::GetBackgroundColor())]; [self setOpaque:NO]; [self setReleasedWhenClosed:NO]; diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm index 4952dbe..7bd7af0 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm @@ -307,7 +307,7 @@ bool HasAttribute(id item, CellAttributesMask attributeMask) { prompt_->GetUserCount())]; [[storeLinkButton_ cell] setUnderlineOnHover:YES]; [[storeLinkButton_ cell] setTextColor: - gfx::SkColorToCalibratedNSColor(chrome_style::GetLinkColor())]; + skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor())]; } [iconView_ setImage:prompt_->icon().ToNSImage()]; @@ -566,7 +566,7 @@ bool HasAttribute(id item, CellAttributesMask attributeMask) { [cell setAlignment:NSLeftTextAlignment]; [cell setUnderlineOnHover:YES]; [cell setTextColor: - gfx::SkColorToCalibratedNSColor(chrome_style::GetLinkColor())]; + skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor())]; size_t detailsIndex = [[item objectForKey:kPermissionsDetailIndex] unsignedIntegerValue]; diff --git a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm index eca6ecf..9b52b47 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm @@ -125,7 +125,7 @@ void ExtensionInstalledBubbleBridge::UpdateAnchorPosition() { const extensions::Extension* extension = extensionBubble->extension(); browser_ = extensionBubble->browser(); DCHECK(browser_); - icon_.reset([gfx::SkBitmapToNSImage(extensionBubble->icon()) retain]); + icon_.reset([skia::SkBitmapToNSImage(extensionBubble->icon()) retain]); pageActionPreviewShowing_ = NO; if (extension->is_app()) { @@ -155,7 +155,7 @@ void ExtensionInstalledBubbleBridge::UpdateAnchorPosition() { bundle_ = bundle; DCHECK(browser); browser_ = browser; - icon_.reset([gfx::SkBitmapToNSImage(SkBitmap()) retain]); + icon_.reset([skia::SkBitmapToNSImage(SkBitmap()) retain]); pageActionPreviewShowing_ = NO; type_ = extension_installed_bubble::kBundle; [self showWindow:self]; @@ -407,7 +407,7 @@ void ExtensionInstalledBubbleBridge::UpdateAnchorPosition() { [view setMessage:message withFont:font messageColor:[NSColor blackColor]]; [view addLinkRange:NSMakeRange(0, [link length]) withURL:@"about:blank" // using a link here is bad ui - linkColor:gfx::SkColorToCalibratedNSColor( + linkColor:skia::SkColorToCalibratedNSColor( chrome_style::GetLinkColor())]; // HACK! The TextView does not report correct height even after you stuff @@ -489,7 +489,7 @@ void ExtensionInstalledBubbleBridge::UpdateAnchorPosition() { [[manageShortcutLink_ cell] setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; [[manageShortcutLink_ cell] - setTextColor:gfx::SkColorToCalibratedNSColor( + setTextColor:skia::SkColorToCalibratedNSColor( chrome_style::GetLinkColor())]; [GTMUILocalizerAndLayoutTweaker sizeToFitView:manageShortcutLink_]; newWindowHeight += extension_installed_bubble::kInnerVerticalMargin; diff --git a/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm b/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm index d57c999..c10ea56 100644 --- a/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm +++ b/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm @@ -79,7 +79,7 @@ CGFloat kMinWidth = 320.0; [[self bubble] setAlignment:info_bubble::kAlignArrowToAnchor]; [[self bubble] setArrowLocation:info_bubble::kTopRight]; [[self bubble] setBackgroundColor: - gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( + skia::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( ui::NativeTheme::kColorId_DialogBackground))]; if (!g_animations_enabled) diff --git a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm index d8d34be..aa5478d 100644 --- a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm @@ -124,7 +124,7 @@ [view setMessage:message withFont:font messageColor:[NSColor blackColor]]; if (linkLength != 0) { NSColor* linkColor = - gfx::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); + skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); [view addLinkRange:NSMakeRange(linkOffset, linkLength) withURL:base::SysUTF8ToNSString(delegate->GetLinkURL().spec()) linkColor:linkColor]; diff --git a/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm b/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm index 0f737f0..87bb2c0 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm @@ -41,8 +41,8 @@ SkColor topColor = infobars::InfoBar::GetTopColor(infobarType); SkColor bottomColor = infobars::InfoBar::GetBottomColor(infobarType); base::scoped_nsobject<NSGradient> gradient([[NSGradient alloc] - initWithStartingColor:gfx::SkColorToCalibratedNSColor(topColor) - endingColor:gfx::SkColorToCalibratedNSColor(bottomColor)]); + initWithStartingColor:skia::SkColorToCalibratedNSColor(topColor) + endingColor:skia::SkColorToCalibratedNSColor(bottomColor)]); [self setGradient:gradient]; } diff --git a/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm index 260da53..42d6bb8 100644 --- a/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm @@ -23,7 +23,7 @@ gfx::Range linkRange = delegate->message_link_range(); if (!linkRange.is_empty()) { NSColor* linkColor = - gfx::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); + skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); HyperlinkTextView* view = (HyperlinkTextView*)label_.get(); [view addLinkRange:linkRange.ToNSRange() withURL:@"about:blank" // using a link here is bad ui diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm index 6a06929..5f99177 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm @@ -63,10 +63,10 @@ NSColor* DimTextColor() { return [NSColor darkGrayColor]; } NSColor* PositiveTextColor() { - return gfx::SkColorToCalibratedNSColor(SkColorSetRGB(0x0b, 0x80, 0x43)); + return skia::SkColorToCalibratedNSColor(SkColorSetRGB(0x0b, 0x80, 0x43)); } NSColor* NegativeTextColor() { - return gfx::SkColorToCalibratedNSColor(SkColorSetRGB(0xc5, 0x39, 0x29)); + return skia::SkColorToCalibratedNSColor(SkColorSetRGB(0xc5, 0x39, 0x29)); } NSColor* URLTextColor() { return [NSColor colorWithCalibratedRed:0.0 green:0.55 blue:0.0 alpha:1.0]; diff --git a/chrome/browser/ui/cocoa/one_click_signin_view_controller.mm b/chrome/browser/ui/cocoa/one_click_signin_view_controller.mm index 0cc0502..4b4905e 100644 --- a/chrome/browser/ui/cocoa/one_click_signin_view_controller.mm +++ b/chrome/browser/ui/cocoa/one_click_signin_view_controller.mm @@ -140,7 +140,7 @@ void ShiftOriginY(NSView* view, CGFloat amount) { totalYOffset += [GTMUILocalizerAndLayoutTweaker sizeToFitView:advancedLink_].height; [[advancedLink_ cell] setTextColor: - gfx::SkColorToCalibratedNSColor(chrome_style::GetLinkColor())]; + skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor())]; } else { // Don't display the advanced link for the error bubble. // To align the Learn More link with the OK button, we need to offset by @@ -249,7 +249,7 @@ void ShiftOriginY(NSView* view, CGFloat amount) { } NSColor* linkColor = - gfx::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); + skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); [informativeTextView_ setMessage:messageText withFont:font messageColor:[NSColor blackColor]]; diff --git a/chrome/browser/ui/cocoa/passwords/confirmation_password_saved_view_controller.mm b/chrome/browser/ui/cocoa/passwords/confirmation_password_saved_view_controller.mm index cabcae5..23f5122 100644 --- a/chrome/browser/ui/cocoa/passwords/confirmation_password_saved_view_controller.mm +++ b/chrome/browser/ui/cocoa/passwords/confirmation_password_saved_view_controller.mm @@ -78,7 +78,7 @@ withFont:font messageColor:textColor]; NSColor* linkColor = - gfx::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); + skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); [confirmationText_ addLinkRange:model_->save_confirmation_link_range().ToNSRange() withURL:@"about:blank" // using a link here is bad ui diff --git a/chrome/browser/ui/cocoa/passwords/manage_passwords_view_controller.mm b/chrome/browser/ui/cocoa/passwords/manage_passwords_view_controller.mm index c293295..c22c1a9 100644 --- a/chrome/browser/ui/cocoa/passwords/manage_passwords_view_controller.mm +++ b/chrome/browser/ui/cocoa/passwords/manage_passwords_view_controller.mm @@ -113,7 +113,7 @@ [cell setControlSize:NSSmallControlSize]; [cell setShouldUnderline:NO]; [cell setUnderlineOnHover:NO]; - [cell setTextColor:gfx::SkColorToCalibratedNSColor( + [cell setTextColor:skia::SkColorToCalibratedNSColor( chrome_style::GetLinkColor())]; [manageButton_ setCell:cell.get()]; [manageButton_ sizeToFit]; diff --git a/chrome/browser/ui/cocoa/passwords/passwords_list_view_controller.mm b/chrome/browser/ui/cocoa/passwords/passwords_list_view_controller.mm index 19f13d7..510ce4d 100644 --- a/chrome/browser/ui/cocoa/passwords/passwords_list_view_controller.mm +++ b/chrome/browser/ui/cocoa/passwords/passwords_list_view_controller.mm @@ -61,7 +61,7 @@ NSTextField* FederationLabel(const base::string16& text) { [cell setControlSize:NSSmallControlSize]; [cell setShouldUnderline:NO]; [cell setUnderlineOnHover:NO]; - [cell setTextColor:gfx::SkColorToCalibratedNSColor( + [cell setTextColor:skia::SkColorToCalibratedNSColor( chrome_style::GetLinkColor())]; [undoButton_ setCell:cell.get()]; [undoButton_ sizeToFit]; diff --git a/chrome/browser/ui/cocoa/passwords/pending_password_view_controller.mm b/chrome/browser/ui/cocoa/passwords/pending_password_view_controller.mm index 04c459e..e0bc846 100644 --- a/chrome/browser/ui/cocoa/passwords/pending_password_view_controller.mm +++ b/chrome/browser/ui/cocoa/passwords/pending_password_view_controller.mm @@ -103,7 +103,7 @@ const SkColor kWarmWelcomeColor = SkColorSetRGB(0x64, 0x64, 0x64); NSRange titleBrandLinkRange = model_->title_brand_link_range().ToNSRange(); if (titleBrandLinkRange.length) { NSColor* linkColor = - gfx::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); + skia::SkColorToCalibratedNSColor(chrome_style::GetLinkColor()); [titleView addLinkRange:titleBrandLinkRange withURL:@"about:blank" // using a link here is bad ui linkColor:linkColor]; @@ -145,7 +145,7 @@ const SkColor kWarmWelcomeColor = SkColorSetRGB(0x64, 0x64, 0x64); [warm_welcome setFrameSize:NSMakeSize(kDesiredBubbleWidth - 2*kFramePadding, MAXFLOAT)]; [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:warm_welcome]; - NSColor* color = gfx::SkColorToCalibratedNSColor(kWarmWelcomeColor); + NSColor* color = skia::SkColorToCalibratedNSColor(kWarmWelcomeColor); [warm_welcome setTextColor:color]; } diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm index 46cfa20..8ea6762 100644 --- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm +++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm @@ -166,7 +166,7 @@ NSTextView* BuildFixedWidthTextViewWithLink( CGFloat frame_width) { base::scoped_nsobject<HyperlinkTextView> text_view( [[HyperlinkTextView alloc] initWithFrame:NSZeroRect]); - NSColor* link_color = gfx::SkColorToCalibratedNSColor( + NSColor* link_color = skia::SkColorToCalibratedNSColor( chrome_style::GetLinkColor()); NSMutableString* finalMessage = [NSMutableString stringWithFormat:@"%@\n", message]; @@ -199,7 +199,7 @@ NSTextView* BuildFixedWidthTextViewWithLink( // Returns the native dialog background color. NSColor* GetDialogBackgroundColor() { - return gfx::SkColorToCalibratedNSColor( + return skia::SkColorToCalibratedNSColor( ui::NativeThemeMac::instance()->GetSystemColor( ui::NativeTheme::kColorId_DialogBackground)); } @@ -799,7 +799,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, // native control. SkColor hoverColor = ui::GetAuraColor( ui::NativeTheme::kColorId_ButtonHoverBackgroundColor, nullptr); - hoverColor_.reset([gfx::SkColorToSRGBNSColor(hoverColor) retain]); + hoverColor_.reset([skia::SkColorToSRGBNSColor(hoverColor) retain]); [self setBordered:NO]; [self setFont:[NSFont labelFontOfSize:kTextFontSize]]; @@ -1565,7 +1565,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, tutorialMode_ = mode; NSColor* tutorialBackgroundColor = - gfx::SkColorToSRGBNSColor(profiles::kAvatarTutorialBackgroundColor); + skia::SkColorToSRGBNSColor(profiles::kAvatarTutorialBackgroundColor); base::scoped_nsobject<NSView> container([[BackgroundColorView alloc] initWithFrame:NSMakeRect(0, 0, kFixedMenuWidth, 0) withColor:tutorialBackgroundColor]); @@ -1642,7 +1642,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, NSTextField* contentLabel = BuildLabel( contentMessage, NSMakePoint(kHorizontalSpacing, yOffset), - gfx::SkColorToSRGBNSColor(profiles::kAvatarTutorialContentTextColor)); + skia::SkColorToSRGBNSColor(profiles::kAvatarTutorialContentTextColor)); [contentLabel setFrameSize:NSMakeSize(availableWidth, 0)]; [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:contentLabel]; [container addSubview:contentLabel]; @@ -1996,7 +1996,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, avatarMenu_->GetItemAt(avatarMenu_->GetActiveProfileIndex()); DCHECK(item.signed_in); - NSColor* backgroundColor = gfx::SkColorToCalibratedNSColor( + NSColor* backgroundColor = skia::SkColorToCalibratedNSColor( profiles::kAvatarBubbleAccountsBackgroundColor); base::scoped_nsobject<NSView> container([[BackgroundColorView alloc] initWithFrame:rect @@ -2325,7 +2325,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, [[HyperlinkButtonCell buttonWithString:title] retain]); [[link cell] setShouldUnderline:NO]; - [[link cell] setTextColor:gfx::SkColorToCalibratedNSColor( + [[link cell] setTextColor:skia::SkColorToCalibratedNSColor( chrome_style::GetLinkColor())]; [link setTitle:title]; [link setBordered:NO]; @@ -2358,7 +2358,7 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, if (warningImage) availableTextWidth -= kHorizontalSpacing; - NSColor* backgroundColor = gfx::SkColorToCalibratedNSColor( + NSColor* backgroundColor = skia::SkColorToCalibratedNSColor( profiles::kAvatarBubbleAccountsBackgroundColor); base::scoped_nsobject<BackgroundColorHoverButton> button( [[BackgroundColorHoverButton alloc] initWithFrame:rect diff --git a/chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_view_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_view_controller.mm index eebe9e6..faf59b4 100644 --- a/chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_view_controller.mm +++ b/chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_view_controller.mm @@ -92,7 +92,7 @@ NSTextView* AddTextView( [[HyperlinkTextView alloc] initWithFrame:NSZeroRect]); NSFont* font = ui::ResourceBundle::GetSharedInstance().GetFont( font_style).GetNativeFont(); - NSColor* linkColor = gfx::SkColorToCalibratedNSColor( + NSColor* linkColor = skia::SkColorToCalibratedNSColor( chrome_style::GetLinkColor()); NSMutableString* finalMessage = [NSMutableString stringWithString: base::SysUTF16ToNSString(message)]; @@ -246,13 +246,13 @@ NSTextField* AddTextField( // Prompt box. [promptBox_ - setBorderColor:gfx::SkColorToCalibratedNSColor( + setBorderColor:skia::SkColorToCalibratedNSColor( ui::GetSigninConfirmationPromptBarColor( ui::NativeThemeMac::instance(), ui::kSigninConfirmationPromptBarBorderAlpha))]; [promptBox_ setBorderWidth:kDialogAlertBarBorderWidth]; [promptBox_ - setFillColor:gfx::SkColorToCalibratedNSColor( + setFillColor:skia::SkColorToCalibratedNSColor( ui::GetSigninConfirmationPromptBarColor( ui::NativeThemeMac::instance(), ui::kSigninConfirmationPromptBarBackgroundAlpha))]; diff --git a/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm b/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm index 5953fb9..7087688 100644 --- a/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm +++ b/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm @@ -237,7 +237,7 @@ scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( @implementation ScreenCaptureNotificationView - (void)drawRect:(NSRect)dirtyRect { - [gfx::SkColorToSRGBNSColor(ui::NativeThemeMac::instance()->GetSystemColor( + [skia::SkColorToSRGBNSColor(ui::NativeThemeMac::instance()->GetSystemColor( ui::NativeTheme::kColorId_DialogBackground)) set]; [[NSBezierPath bezierPathWithRoundedRect:[self bounds] xRadius:kWindowCornerRadius diff --git a/chrome/browser/ui/cocoa/spinner_view.mm b/chrome/browser/ui/cocoa/spinner_view.mm index 69f7b0c..ee52d19 100644 --- a/chrome/browser/ui/cocoa/spinner_view.mm +++ b/chrome/browser/ui/cocoa/spinner_view.mm @@ -121,7 +121,7 @@ NSString* const kRotationAnimationName = @"RotationAnimationName"; ui::NativeTheme* nativeTheme = ui::NativeThemeMac::instance(); SkColor throbberBlueColor = nativeTheme->GetSystemColor( ui::NativeTheme::kColorId_ThrobberSpinningColor); - CGColorRef blueColor = gfx::CGColorCreateFromSkColor(throbberBlueColor); + CGColorRef blueColor = skia::CGColorCreateFromSkColor(throbberBlueColor); [shapeLayer_ setStrokeColor:blueColor]; CGColorRelease(blueColor); diff --git a/chrome/browser/ui/cocoa/status_icons/status_icon_mac.mm b/chrome/browser/ui/cocoa/status_icons/status_icon_mac.mm index a8ac589..f0566fe 100644 --- a/chrome/browser/ui/cocoa/status_icons/status_icon_mac.mm +++ b/chrome/browser/ui/cocoa/status_icons/status_icon_mac.mm @@ -66,7 +66,7 @@ NSStatusItem* StatusIconMac::item() { void StatusIconMac::SetImage(const gfx::ImageSkia& image) { if (!image.isNull()) { - NSImage* ns_image = gfx::SkBitmapToNSImage(*image.bitmap()); + NSImage* ns_image = skia::SkBitmapToNSImage(*image.bitmap()); if (ns_image) [item() setImage:ns_image]; } diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm index 6184e42..c02c58f 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm @@ -1556,7 +1556,7 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) { if (isApp) { SkBitmap* icon = extensions_tab_helper->GetExtensionAppIcon(); if (icon) - image = gfx::SkBitmapToNSImageWithColorSpace(*icon, colorSpace); + image = skia::SkBitmapToNSImageWithColorSpace(*icon, colorSpace); } else { image = mac::FaviconForWebContents(contents); } diff --git a/components/suggestions/image_encoder_ios.mm b/components/suggestions/image_encoder_ios.mm index ffac9a2..79d639c 100644 --- a/components/suggestions/image_encoder_ios.mm +++ b/components/suggestions/image_encoder_ios.mm @@ -14,7 +14,8 @@ namespace suggestions { SkBitmap* DecodeJPEGToSkBitmap(const void* encoded_data, size_t size) { NSData* data = [NSData dataWithBytes:encoded_data length:size]; UIImage* image = [UIImage imageWithData:data scale:1.0]; - return new SkBitmap(gfx::CGImageToSkBitmap(image.CGImage, [image size], YES)); + return new SkBitmap(skia::CGImageToSkBitmap(image.CGImage, [image size], + YES)); } bool EncodeSkBitmapToJPEG(const SkBitmap& bitmap, @@ -22,7 +23,7 @@ bool EncodeSkBitmapToJPEG(const SkBitmap& bitmap, base::ScopedCFTypeRef<CGColorSpaceRef> color_space( CGColorSpaceCreateDeviceRGB()); UIImage* image = - gfx::SkBitmapToUIImageWithColorSpace(bitmap, 1 /* scale */, color_space); + skia::SkBitmapToUIImageWithColorSpace(bitmap, 1 /* scale */, color_space); NSData* data = UIImageJPEGRepresentation(image, 1.0); const char* bytes = reinterpret_cast<const char*>([data bytes]); dest->assign(bytes, bytes + [data length]); diff --git a/content/child/npapi/webplugin_delegate_impl_mac.mm b/content/child/npapi/webplugin_delegate_impl_mac.mm index f945eda..2598ed3 100644 --- a/content/child/npapi/webplugin_delegate_impl_mac.mm +++ b/content/child/npapi/webplugin_delegate_impl_mac.mm @@ -275,7 +275,7 @@ void WebPluginDelegateImpl::UpdateGeometryAndContext( } void WebPluginDelegateImpl::Paint(SkCanvas* canvas, const gfx::Rect& rect) { - gfx::SkiaBitLocker bit_locker(canvas); + skia::SkiaBitLocker bit_locker(canvas); CGContextRef context = bit_locker.cgContext(); CGPaint(context, rect); } diff --git a/content/common/cursors/webcursor_mac.mm b/content/common/cursors/webcursor_mac.mm index 13c8c0b9..38870ed 100644 --- a/content/common/cursors/webcursor_mac.mm +++ b/content/common/cursors/webcursor_mac.mm @@ -169,7 +169,7 @@ NSCursor* CreateCustomCursor(const std::vector<char>& custom_data, // Both the image and its representation need to have the same size for // cursors to appear in high resolution on retina displays. Note that the // size of a representation is not the same as pixelsWide or pixelsHigh. - NSImage* cursor_image = gfx::SkBitmapToNSImage(bitmap); + NSImage* cursor_image = skia::SkBitmapToNSImage(bitmap); [cursor_image setSize:dip_size]; [[[cursor_image representations] objectAtIndex:0] setSize:dip_size]; @@ -354,7 +354,7 @@ void WebCursor::InitFromNSCursor(NSCursor* cursor) { cursor_info.type = WebCursorInfo::TypeCustom; NSPoint hot_spot = [cursor hotSpot]; cursor_info.hotspot = gfx::Point(hot_spot.x, hot_spot.y); - cursor_info.custom_image = gfx::CGImageToSkBitmap(cg_image); + cursor_info.custom_image = skia::CGImageToSkBitmap(cg_image); } else { cursor_info.type = WebCursorInfo::TypePointer; } diff --git a/ios/chrome/browser/suggestions/image_fetcher_impl.mm b/ios/chrome/browser/suggestions/image_fetcher_impl.mm index 01cde48..02e398e 100644 --- a/ios/chrome/browser/suggestions/image_fetcher_impl.mm +++ b/ios/chrome/browser/suggestions/image_fetcher_impl.mm @@ -48,7 +48,7 @@ void ImageFetcherImpl::StartOrQueueNetworkRequest( UIImage* image = [UIImage imageWithData:data scale:1]; if (image) { SkBitmap bitmap = - gfx::CGImageToSkBitmap(image.CGImage, [image size], YES); + skia::CGImageToSkBitmap(image.CGImage, [image size], YES); callback.Run(page_url, &bitmap); if (delegate_) { delegate_->OnImageFetched(page_url, &bitmap); diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc index cc4f3ef..45c5466 100644 --- a/skia/ext/bitmap_platform_device_mac.cc +++ b/skia/ext/bitmap_platform_device_mac.cc @@ -99,7 +99,7 @@ static void LoadTransformToCGContext(CGContextRef context, transformed_matrix.setTranslateY(ty + (SkScalar)height); CGAffineTransform cg_matrix = - gfx::SkMatrixToCGAffineTransform(transformed_matrix); + skia::SkMatrixToCGAffineTransform(transformed_matrix); // Load final transform into context. CGContextConcatCTM(context, cg_matrix); @@ -113,7 +113,7 @@ static void LoadClippingRegionToCGContext(CGContextRef context, // region can be empty, in which case everything will be clipped. SkRect rect; rect.setEmpty(); - CGContextClipToRect(context, gfx::SkRectToCGRect(rect)); + CGContextClipToRect(context, skia::SkRectToCGRect(rect)); } else if (region.isRect()) { // CoreGraphics applies the current transform to clip rects, which is // unwanted. Inverse-transform the rect before sending it to CG. This only @@ -129,7 +129,7 @@ static void LoadClippingRegionToCGContext(CGContextRef context, t.mapRect(&rect); SkIRect irect; rect.round(&irect); - CGContextClipToRect(context, gfx::SkIRectToCGRect(irect)); + CGContextClipToRect(context, skia::SkIRectToCGRect(irect)); } else { // It is complex. SkPath path; diff --git a/skia/ext/bitmap_platform_device_mac_unittest.cc b/skia/ext/bitmap_platform_device_mac_unittest.cc index 7265bc4..0ba6772 100644 --- a/skia/ext/bitmap_platform_device_mac_unittest.cc +++ b/skia/ext/bitmap_platform_device_mac_unittest.cc @@ -38,7 +38,7 @@ TEST_F(BitmapPlatformDeviceMacTest, ClipRectTransformWithTranslate) { bitmap_->setMatrixClip(transform, clip_region, ignore); CGContextRef context = bitmap_->GetBitmapContext(); - SkRect clip_rect = gfx::CGRectToSkRect(CGContextGetClipBoundingBox(context)); + SkRect clip_rect = skia::CGRectToSkRect(CGContextGetClipBoundingBox(context)); transform.mapRect(&clip_rect); EXPECT_EQ(0, clip_rect.fLeft); EXPECT_EQ(0, clip_rect.fTop); @@ -58,7 +58,7 @@ TEST_F(BitmapPlatformDeviceMacTest, ClipRectTransformWithScale) { bitmap_->setMatrixClip(transform, clip_region, unused); CGContextRef context = bitmap_->GetBitmapContext(); - SkRect clip_rect = gfx::CGRectToSkRect(CGContextGetClipBoundingBox(context)); + SkRect clip_rect = skia::CGRectToSkRect(CGContextGetClipBoundingBox(context)); transform.mapRect(&clip_rect); EXPECT_EQ(0, clip_rect.fLeft); EXPECT_EQ(0, clip_rect.fTop); diff --git a/skia/ext/skia_utils_ios.h b/skia/ext/skia_utils_ios.h index 8e1ba9a..0f2c613 100644 --- a/skia/ext/skia_utils_ios.h +++ b/skia/ext/skia_utils_ios.h @@ -21,7 +21,7 @@ class UIImage; class NSData; #endif -namespace gfx { +namespace skia { // Draws a CGImage into an SkBitmap of the given size. SK_API SkBitmap CGImageToSkBitmap(CGImageRef image, @@ -41,6 +41,6 @@ SK_API std::vector<SkBitmap> ImageDataToSkBitmaps(NSData* image_data); // Returns a UIColor for an SKColor. Used by iOS downstream. SK_API UIColor* UIColorFromSkColor(SkColor color); -} // namespace gfx +} // namespace skia #endif // SKIA_EXT_SKIA_UTILS_IOS_H_ diff --git a/skia/ext/skia_utils_ios.mm b/skia/ext/skia_utils_ios.mm index ec76cd5..afa84ab 100644 --- a/skia/ext/skia_utils_ios.mm +++ b/skia/ext/skia_utils_ios.mm @@ -27,7 +27,7 @@ bool EncodesIcoImage(NSData* image_data) { } // namespace -namespace gfx { +namespace skia { SkBitmap CGImageToSkBitmap(CGImageRef image, CGSize size, bool is_opaque) { SkBitmap bitmap; @@ -130,4 +130,4 @@ UIColor* UIColorFromSkColor(SkColor color) { alpha:SkColorGetA(color) / 255.0f]; } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/skia_utils_ios_unittest.mm b/skia/ext/skia_utils_ios_unittest.mm index 0299472..543f301 100644 --- a/skia/ext/skia_utils_ios_unittest.mm +++ b/skia/ext/skia_utils_ios_unittest.mm @@ -129,7 +129,7 @@ NSData* InvalidData(NSUInteger length) { TEST_F(SkiaUtilsIosTest, ImageDataToSkBitmaps) { std::vector<SkBitmap> bitmaps( - gfx::ImageDataToSkBitmaps(StringToNSData(kIcoEncodedData))); + skia::ImageDataToSkBitmaps(StringToNSData(kIcoEncodedData))); EXPECT_EQ(2UL, bitmaps.size()); EXPECT_EQ(32, bitmaps[0].width()); @@ -139,20 +139,20 @@ TEST_F(SkiaUtilsIosTest, ImageDataToSkBitmaps) { } TEST_F(SkiaUtilsIosTest, InvalidDataFailure) { - std::vector<SkBitmap> bitmaps1(gfx::ImageDataToSkBitmaps(InvalidData(1))); + std::vector<SkBitmap> bitmaps1(skia::ImageDataToSkBitmaps(InvalidData(1))); EXPECT_EQ(0UL, bitmaps1.size()); - std::vector<SkBitmap> bitmaps2(gfx::ImageDataToSkBitmaps(InvalidData(10))); + std::vector<SkBitmap> bitmaps2(skia::ImageDataToSkBitmaps(InvalidData(10))); EXPECT_EQ(0UL, bitmaps2.size()); - std::vector<SkBitmap> bitmaps3(gfx::ImageDataToSkBitmaps(InvalidData(100))); + std::vector<SkBitmap> bitmaps3(skia::ImageDataToSkBitmaps(InvalidData(100))); EXPECT_EQ(0UL, bitmaps3.size()); - std::vector<SkBitmap> bitmaps4(gfx::ImageDataToSkBitmaps(InvalidData(1000))); + std::vector<SkBitmap> bitmaps4(skia::ImageDataToSkBitmaps(InvalidData(1000))); EXPECT_EQ(0UL, bitmaps4.size()); - std::vector<SkBitmap> bitmaps5(gfx::ImageDataToSkBitmaps(InvalidData(5000))); + std::vector<SkBitmap> bitmaps5(skia::ImageDataToSkBitmaps(InvalidData(5000))); EXPECT_EQ(0UL, bitmaps5.size()); } TEST_F(SkiaUtilsIosTest, EmptyDataFailure) { - std::vector<SkBitmap> bitmaps(gfx::ImageDataToSkBitmaps([NSData data])); + std::vector<SkBitmap> bitmaps(skia::ImageDataToSkBitmaps([NSData data])); EXPECT_EQ(0UL, bitmaps.size()); } @@ -742,7 +742,7 @@ const char kIco88x88EncodedData[] = TEST_F(SkiaUtilsIosTest, Image88x88OrLarger) { std::vector<SkBitmap> bitmaps( - gfx::ImageDataToSkBitmaps(StringToNSData(kIco88x88EncodedData))); + skia::ImageDataToSkBitmaps(StringToNSData(kIco88x88EncodedData))); if (base::ios::IsRunningOnOrLater(8, 1, 1)) EXPECT_EQ(0UL, bitmaps.size()); else @@ -751,7 +751,7 @@ TEST_F(SkiaUtilsIosTest, Image88x88OrLarger) { TEST_F(SkiaUtilsIosTest, UIColorFromSkColor) { SkColor color = SkColorSetARGB(50, 100, 150, 200); - UIColor* ios_color = gfx::UIColorFromSkColor(color); + UIColor* ios_color = skia::UIColorFromSkColor(color); CGFloat red, green, blue, alpha; [ios_color getRed:&red green:&green blue:&blue alpha:&alpha]; EXPECT_EQ(50, static_cast<int>(alpha * 255 + 0.5f)); diff --git a/skia/ext/skia_utils_mac.h b/skia/ext/skia_utils_mac.h index e99913f..d15fa56 100644 --- a/skia/ext/skia_utils_mac.h +++ b/skia/ext/skia_utils_mac.h @@ -35,19 +35,7 @@ class NSImageRep; class NSColor; #endif -namespace gfx { - -// Converts a Skia point to a CoreGraphics CGPoint. -// Both use same in-memory format. -inline const CGPoint& SkPointToCGPoint(const SkPoint& point) { - return reinterpret_cast<const CGPoint&>(point); -} - -// Converts a CoreGraphics point to a Skia CGPoint. -// Both use same in-memory format. -inline const SkPoint& CGPointToSkPoint(const CGPoint& point) { - return reinterpret_cast<const SkPoint&>(point); -} +namespace skia { // Matrix converters. SK_API CGAffineTransform SkMatrixToCGAffineTransform(const SkMatrix& matrix); @@ -148,6 +136,6 @@ class SK_API SkiaBitLocker { }; -} // namespace gfx +} // namespace skia #endif // SKIA_EXT_SKIA_UTILS_MAC_H_ diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm index 32466f1..b65ef99 100644 --- a/skia/ext/skia_utils_mac.mm +++ b/skia/ext/skia_utils_mac.mm @@ -85,7 +85,7 @@ SkBitmap NSImageOrNSImageRepToSkBitmapWithColorSpace( } // namespace -namespace gfx { +namespace skia { CGAffineTransform SkMatrixToCGAffineTransform(const SkMatrix& matrix) { // CGAffineTransforms don't support perspective transforms, so make sure @@ -466,4 +466,4 @@ bool SkiaBitLocker::hasEmptyClipRegion() const { return canvas_->isClipEmpty(); } -} // namespace gfx +} // namespace skia diff --git a/skia/ext/skia_utils_mac_unittest.mm b/skia/ext/skia_utils_mac_unittest.mm index 1fdf774..9e45056 100644 --- a/skia/ext/skia_utils_mac_unittest.mm +++ b/skia/ext/skia_utils_mac_unittest.mm @@ -155,7 +155,7 @@ void SkiaUtilsMacTest::RunBitLockerTest(BitLockerTest test) { canvas.clipRect(clipRect); } { - gfx::SkiaBitLocker bitLocker(&canvas); + skia::SkiaBitLocker bitLocker(&canvas); CGContextRef cgContext = bitLocker.cgContext(); CGColorRef testColor = CGColorGetConstantColor(kCGColorWhite); CGContextSetFillColorWithColor(cgContext, testColor); @@ -183,7 +183,7 @@ void SkiaUtilsMacTest::ShapeHelper(int width, int height, SkBitmap thing(CreateSkBitmap(width, height, isred, tfbit)); // Confirm size - NSImage* image = gfx::SkBitmapToNSImage(thing); + NSImage* image = skia::SkBitmapToNSImage(thing); EXPECT_DOUBLE_EQ([image size].width, (double)width); EXPECT_DOUBLE_EQ([image size].height, (double)height); @@ -212,7 +212,7 @@ TEST_F(SkiaUtilsMacTest, BitmapToNSBitmapImageRep_BlueRectangle20x30) { int height = 30; SkBitmap bitmap(CreateSkBitmap(width, height, false, true)); - NSBitmapImageRep* imageRep = gfx::SkBitmapToNSBitmapImageRep(bitmap); + NSBitmapImageRep* imageRep = skia::SkBitmapToNSBitmapImageRep(bitmap); EXPECT_DOUBLE_EQ(width, [imageRep size].width); EXPECT_DOUBLE_EQ(height, [imageRep size].height); @@ -228,7 +228,7 @@ TEST_F(SkiaUtilsMacTest, NSImageRepToSkBitmap) { NSBitmapImageRep* imageRep = base::mac::ObjCCastStrict<NSBitmapImageRep>( [[image representations] lastObject]); NSColorSpace* colorSpace = [NSColorSpace genericRGBColorSpace]; - SkBitmap bitmap(gfx::NSImageRepToSkBitmapWithColorSpace( + SkBitmap bitmap(skia::NSImageRepToSkBitmapWithColorSpace( imageRep, [image size], false, [colorSpace CGColorSpace])); TestSkBitmap(bitmap); } diff --git a/third_party/WebKit/Source/platform/mac/LocalCurrentGraphicsContext.h b/third_party/WebKit/Source/platform/mac/LocalCurrentGraphicsContext.h index 37616ec..9acd2a3 100644 --- a/third_party/WebKit/Source/platform/mac/LocalCurrentGraphicsContext.h +++ b/third_party/WebKit/Source/platform/mac/LocalCurrentGraphicsContext.h @@ -47,7 +47,7 @@ private: NSGraphicsContext* m_savedNSGraphicsContext; bool m_didSetGraphicsContext; IntRect m_inflatedDirtyRect; - gfx::SkiaBitLocker m_skiaBitLocker; + skia::SkiaBitLocker m_skiaBitLocker; }; } diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm index 7004667..39589d0 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm +++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm @@ -103,7 +103,7 @@ bool ScrollbarThemeMacNonOverlayAPI::paint(const ScrollbarThemeClient& scrollbar trackInfo.trackInfo.scrollbar.pressState = scrollbarPartToHIPressedState(scrollbar.pressedPart()); SkCanvas* canvas = context.canvas(); - CGAffineTransform currentCTM = gfx::SkMatrixToCGAffineTransform(canvas->getTotalMatrix()); + CGAffineTransform currentCTM = skia::SkMatrixToCGAffineTransform(canvas->getTotalMatrix()); // The Aqua scrollbar is buggy when rotated and scaled. We will just draw into a bitmap if we detect a scale or rotation. bool canDrawDirectly = currentCTM.a == 1.0f && currentCTM.b == 0.0f && currentCTM.c == 0.0f && (currentCTM.d == 1.0f || currentCTM.d == -1.0f); @@ -126,7 +126,7 @@ bool ScrollbarThemeMacNonOverlayAPI::paint(const ScrollbarThemeClient& scrollbar } // Draw the track and its thumb. - gfx::SkiaBitLocker bitLocker( + skia::SkiaBitLocker bitLocker( drawingCanvas, ThemeMac::inflateRectForAA(scrollbar.frameRect()), canDrawDirectly ? context.deviceScaleFactor() : 1.0f); diff --git a/ui/app_list/cocoa/app_list_pager_view.mm b/ui/app_list/cocoa/app_list_pager_view.mm index abd4a4d..82e33f6 100644 --- a/ui/app_list/cocoa/app_list_pager_view.mm +++ b/ui/app_list/cocoa/app_list_pager_view.mm @@ -147,7 +147,7 @@ const CGFloat kButtonStripPadding = 20; app_list::kPagerHoverColor : app_list::kPagerNormalColor; - [gfx::SkColorToSRGBNSColor(backgroundColor) set]; + [skia::SkColorToSRGBNSColor(backgroundColor) set]; NSRectFill(frame); if (![[self target] conformsToProtocol:@protocol(AppListPagerDelegate)]) @@ -157,7 +157,7 @@ const CGFloat kButtonStripPadding = 20; if (selectedRatio == 0.0) return; - [gfx::SkColorToSRGBNSColor(app_list::kPagerSelectedColor) set]; + [skia::SkColorToSRGBNSColor(app_list::kPagerSelectedColor) set]; if (selectedRatio < 0) frame.origin.x += frame.size.width + frame.size.width * selectedRatio; frame.size.width *= fabs(selectedRatio); diff --git a/ui/app_list/cocoa/app_list_view_controller.mm b/ui/app_list/cocoa/app_list_view_controller.mm index 8f337ce..3ff7a67 100644 --- a/ui/app_list/cocoa/app_list_view_controller.mm +++ b/ui/app_list/cocoa/app_list_view_controller.mm @@ -61,11 +61,11 @@ const NSTimeInterval kResultsAnimationDuration = 0.2; xRadius:kBubbleCornerRadius yRadius:kBubbleCornerRadius] addClip]; - [gfx::SkColorToSRGBNSColor(app_list::kContentsBackgroundColor) set]; + [skia::SkColorToSRGBNSColor(app_list::kContentsBackgroundColor) set]; NSRectFill(boundsRect); - [gfx::SkColorToSRGBNSColor(app_list::kSearchBoxBackground) set]; + [skia::SkColorToSRGBNSColor(app_list::kSearchBoxBackground) set]; NSRectFill(searchAreaRect); - [gfx::SkColorToSRGBNSColor(app_list::kTopSeparatorColor) set]; + [skia::SkColorToSRGBNSColor(app_list::kTopSeparatorColor) set]; NSRectFill(separatorRect); } diff --git a/ui/app_list/cocoa/apps_grid_view_item.mm b/ui/app_list/cocoa/apps_grid_view_item.mm index 992bc9a..03fbb46 100644 --- a/ui/app_list/cocoa/apps_grid_view_item.mm +++ b/ui/app_list/cocoa/apps_grid_view_item.mm @@ -173,7 +173,7 @@ void ItemModelObserverBridge::ItemPercentDownloadedChanged() { if (!selected_) return; - [gfx::SkColorToSRGBNSColor(app_list::kSelectedColor) set]; + [skia::SkColorToSRGBNSColor(app_list::kSelectedColor) set]; NSRectFillUsingOperation(dirtyRect, NSCompositeSourceOver); } @@ -243,7 +243,7 @@ void ItemModelObserverBridge::ItemPercentDownloadedChanged() { .GetPrimaryFont() .GetNativeFont(), NSForegroundColorAttributeName : - gfx::SkColorToSRGBNSColor(app_list::kGridTitleColor) + skia::SkColorToSRGBNSColor(app_list::kGridTitleColor) }; NSString* buttonTitle = base::SysUTF8ToNSString([self model]->GetDisplayName()); diff --git a/ui/app_list/cocoa/apps_search_results_controller.mm b/ui/app_list/cocoa/apps_search_results_controller.mm index 304eb06..41155f2 100644 --- a/ui/app_list/cocoa/apps_search_results_controller.mm +++ b/ui/app_list/cocoa/apps_search_results_controller.mm @@ -137,8 +137,8 @@ const SkColor kSelectedRowColor = SkColorSetRGB(0xE6, 0xE6, 0xE6); [tableView_ setRefusesFirstResponder:YES]; [tableView_ setRowHeight:kPreferredRowHeight]; [tableView_ setGridStyleMask:NSTableViewSolidHorizontalGridLineMask]; - [tableView_ setGridColor: - gfx::SkColorToSRGBNSColor(app_list::kResultBorderColor)]; + [tableView_ + setGridColor:skia::SkColorToSRGBNSColor(app_list::kResultBorderColor)]; [tableView_ setBackgroundColor:[NSColor clearColor]]; [tableView_ setAction:@selector(tableViewClicked:)]; [tableView_ setDelegate:self]; @@ -333,9 +333,9 @@ const SkColor kSelectedRowColor = SkColorSetRGB(0xE6, 0xE6, 0xE6); [[NSMutableParagraphStyle alloc] init]); [paragraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; NSDictionary* defaultAttributes = @{ - NSForegroundColorAttributeName: - gfx::SkColorToSRGBNSColor(app_list::kResultDefaultTextColor), - NSParagraphStyleAttributeName: paragraphStyle + NSForegroundColorAttributeName : + skia::SkColorToSRGBNSColor(app_list::kResultDefaultTextColor), + NSParagraphStyleAttributeName : paragraphStyle }; base::scoped_nsobject<NSMutableAttributedString> text( @@ -361,13 +361,13 @@ const SkColor kSelectedRowColor = SkColorSetRGB(0xE6, 0xE6, 0xE6); if (it->styles & app_list::SearchResult::Tag::DIM) { NSColor* dimmedColor = - gfx::SkColorToSRGBNSColor(app_list::kResultDimmedTextColor); + skia::SkColorToSRGBNSColor(app_list::kResultDimmedTextColor); [text addAttribute:NSForegroundColorAttributeName value:dimmedColor range:it->range.ToNSRange()]; } else if (it->styles & app_list::SearchResult::Tag::URL) { NSColor* urlColor = - gfx::SkColorToSRGBNSColor(app_list::kResultURLTextColor); + skia::SkColorToSRGBNSColor(app_list::kResultURLTextColor); [text addAttribute:NSForegroundColorAttributeName value:urlColor range:it->range.ToNSRange()]; @@ -426,9 +426,9 @@ const SkColor kSelectedRowColor = SkColorSetRGB(0xE6, 0xE6, 0xE6); inView:(NSView*)controlView { if ([self backgroundStyle] != kBackgroundNormal) { if ([self backgroundStyle] == kBackgroundSelected) - [gfx::SkColorToSRGBNSColor(kSelectedRowColor) set]; + [skia::SkColorToSRGBNSColor(kSelectedRowColor) set]; else - [gfx::SkColorToSRGBNSColor(kHighlightedRowColor) set]; + [skia::SkColorToSRGBNSColor(kHighlightedRowColor) set]; // Extend up by one pixel to draw over cell border. NSRect backgroundRect = cellFrame; diff --git a/ui/base/clipboard/clipboard_mac.mm b/ui/base/clipboard/clipboard_mac.mm index 05da58b..eb4fc21 100644 --- a/ui/base/clipboard/clipboard_mac.mm +++ b/ui/base/clipboard/clipboard_mac.mm @@ -329,7 +329,7 @@ SkBitmap ClipboardMac::ReadImage(ClipboardType type) const { SkBitmap bitmap; if (image.get()) { - bitmap = gfx::NSImageToSkBitmapWithColorSpace( + bitmap = skia::NSImageToSkBitmapWithColorSpace( image.get(), /*is_opaque=*/ false, base::mac::GetSystemColorSpace()); } return bitmap; @@ -440,7 +440,7 @@ void ClipboardMac::WriteBookmark(const char* title_data, } void ClipboardMac::WriteBitmap(const SkBitmap& bitmap) { - NSImage* image = gfx::SkBitmapToNSImageWithColorSpace( + NSImage* image = skia::SkBitmapToNSImageWithColorSpace( bitmap, base::mac::GetSystemColorSpace()); // An API to ask the NSImage to write itself to the clipboard comes in 10.6 :( // For now, spit out the image as a TIFF. diff --git a/ui/base/cocoa/controls/blue_label_button.mm b/ui/base/cocoa/controls/blue_label_button.mm index 319fff8..9d9b580 100644 --- a/ui/base/cocoa/controls/blue_label_button.mm +++ b/ui/base/cocoa/controls/blue_label_button.mm @@ -63,7 +63,7 @@ const SkColor kPressOuterRingColor = SkColorSetRGB(0x23, 0x52, 0xa2); base::scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); [shadow setShadowOffset:NSMakeSize(0, -1)]; [shadow setShadowBlurRadius:0]; - [shadow setShadowColor:gfx::SkColorToSRGBNSColor(kTextShadowColor)]; + [shadow setShadowColor:skia::SkColorToSRGBNSColor(kTextShadowColor)]; NSDictionary* buttonTextAttributes = @{ NSParagraphStyleAttributeName : buttonTextParagraphStyle, @@ -112,24 +112,24 @@ const SkColor kPressOuterRingColor = SkColorSetRGB(0x23, 0x52, 0xa2); frame.size.height -= 1; if (hoverState == kHoverStateMouseDown && [self isHighlighted]) { - centerColor = gfx::SkColorToSRGBNSColor(kPressedColor); - innerColor = gfx::SkColorToSRGBNSColor(kPressInnerRingColor); - outerColor = gfx::SkColorToSRGBNSColor(kPressOuterRingColor); + centerColor = skia::SkColorToSRGBNSColor(kPressedColor); + innerColor = skia::SkColorToSRGBNSColor(kPressInnerRingColor); + outerColor = skia::SkColorToSRGBNSColor(kPressOuterRingColor); } else { centerColor = hoverState == kHoverStateMouseOver ? - gfx::SkColorToSRGBNSColor(kHoverColor) : - gfx::SkColorToSRGBNSColor(kDefaultColor); + skia::SkColorToSRGBNSColor(kHoverColor) : + skia::SkColorToSRGBNSColor(kDefaultColor); innerColor = [self showsFirstResponder] ? - gfx::SkColorToSRGBNSColor(kFocusInnerRingColor) : - gfx::SkColorToSRGBNSColor(kInnerRingColor); - outerColor = gfx::SkColorToSRGBNSColor(kOuterRingColor); + skia::SkColorToSRGBNSColor(kFocusInnerRingColor) : + skia::SkColorToSRGBNSColor(kInnerRingColor); + outerColor = skia::SkColorToSRGBNSColor(kOuterRingColor); } { gfx::ScopedNSGraphicsContextSaveGState context; base::scoped_nsobject<NSShadow> shadow([[NSShadow alloc] init]); [shadow setShadowOffset:NSMakeSize(0, -1)]; [shadow setShadowBlurRadius:1.0]; - [shadow setShadowColor:gfx::SkColorToSRGBNSColor(kShadowColor)]; + [shadow setShadowColor:skia::SkColorToSRGBNSColor(kShadowColor)]; [shadow set]; [outerColor set]; diff --git a/ui/gfx/image/image_skia_util_ios.mm b/ui/gfx/image/image_skia_util_ios.mm index 77944ee..605b73b 100644 --- a/ui/gfx/image/image_skia_util_ios.mm +++ b/ui/gfx/image/image_skia_util_ios.mm @@ -31,9 +31,9 @@ gfx::ImageSkiaRep ImageSkiaRepOfScaleFromUIImage(UIImage* image, float scale) { CGSize size = image.size; CGSize desired_size_for_scale = CGSizeMake(size.width * scale, size.height * scale); - SkBitmap bitmap(gfx::CGImageToSkBitmap(image.CGImage, - desired_size_for_scale, - false)); + SkBitmap bitmap(skia::CGImageToSkBitmap(image.CGImage, + desired_size_for_scale, + false)); return gfx::ImageSkiaRep(bitmap, scale); } @@ -49,8 +49,8 @@ UIImage* UIImageFromImageSkiaRep(const gfx::ImageSkiaRep& image_skia_rep) { float scale = image_skia_rep.scale(); base::ScopedCFTypeRef<CGColorSpaceRef> color_space( CGColorSpaceCreateDeviceRGB()); - return gfx::SkBitmapToUIImageWithColorSpace(image_skia_rep.sk_bitmap(), scale, - color_space); + return skia::SkBitmapToUIImageWithColorSpace(image_skia_rep.sk_bitmap(), + scale, color_space); } } // namespace gfx diff --git a/ui/gfx/image/image_skia_util_mac.mm b/ui/gfx/image/image_skia_util_mac.mm index 26c0673..8b19769 100644 --- a/ui/gfx/image/image_skia_util_mac.mm +++ b/ui/gfx/image/image_skia_util_mac.mm @@ -68,7 +68,7 @@ gfx::ImageSkia ImageSkiaFromResizedNSImage(NSImage* image, desired_size_for_scale); // TODO(dcheng): Should this function take a color space argument? - SkBitmap bitmap(gfx::NSImageRepToSkBitmapWithColorSpace(ns_image_rep, + SkBitmap bitmap(skia::NSImageRepToSkBitmapWithColorSpace(ns_image_rep, desired_size_for_scale, false, base::mac::GetGenericRGBColorSpace())); if (bitmap.isNull()) continue; @@ -88,7 +88,7 @@ NSImage* NSImageFromImageSkia(const gfx::ImageSkia& image_skia) { for (std::vector<gfx::ImageSkiaRep>::const_iterator it = image_reps.begin(); it != image_reps.end(); ++it) { [image addRepresentation: - gfx::SkBitmapToNSBitmapImageRep(it->sk_bitmap())]; + skia::SkBitmapToNSBitmapImageRep(it->sk_bitmap())]; } [image setSize:NSMakeSize(image_skia.width(), image_skia.height())]; @@ -106,7 +106,7 @@ NSImage* NSImageFromImageSkiaWithColorSpace(const gfx::ImageSkia& image_skia, for (std::vector<gfx::ImageSkiaRep>::const_iterator it = image_reps.begin(); it != image_reps.end(); ++it) { [image addRepresentation: - gfx::SkBitmapToNSBitmapImageRepWithColorSpace(it->sk_bitmap(), + skia::SkBitmapToNSBitmapImageRepWithColorSpace(it->sk_bitmap(), color_space)]; } diff --git a/ui/gfx/image/image_unittest_util.cc b/ui/gfx/image/image_unittest_util.cc index 551409e..a766037 100644 --- a/ui/gfx/image/image_unittest_util.cc +++ b/ui/gfx/image/image_unittest_util.cc @@ -215,11 +215,11 @@ PlatformImage CreatePlatformImage() { base::ScopedCFTypeRef<CGColorSpaceRef> color_space( CGColorSpaceCreateDeviceRGB()); UIImage* image = - gfx::SkBitmapToUIImageWithColorSpace(bitmap, scale, color_space); + skia::SkBitmapToUIImageWithColorSpace(bitmap, scale, color_space); base::mac::NSObjectRetain(image); return image; #elif defined(OS_MACOSX) - NSImage* image = gfx::SkBitmapToNSImageWithColorSpace( + NSImage* image = skia::SkBitmapToNSImageWithColorSpace( bitmap, base::mac::GetGenericRGBColorSpace()); base::mac::NSObjectRetain(image); return image; diff --git a/ui/gfx/image/image_unittest_util_mac.mm b/ui/gfx/image/image_unittest_util_mac.mm index 4f43717..243e7b3 100644 --- a/ui/gfx/image/image_unittest_util_mac.mm +++ b/ui/gfx/image/image_unittest_util_mac.mm @@ -17,7 +17,7 @@ SkColor GetPlatformImageColor(PlatformImage image, int x, int y) { [image lockFocus]; NSColor* color = NSReadPixel(NSMakePoint(x, y)); [image unlockFocus]; - return NSDeviceColorToSkColor(color); + return skia::NSDeviceColorToSkColor(color); } } // namespace test diff --git a/ui/gfx/render_text_mac.mm b/ui/gfx/render_text_mac.mm index 4e863a6..d9a73fa 100644 --- a/ui/gfx/render_text_mac.mm +++ b/ui/gfx/render_text_mac.mm @@ -313,7 +313,7 @@ base::ScopedCFTypeRef<CFMutableArrayRef> RenderTextMac::ApplyStyles( end = TextIndexToGivenTextIndex(text, style.GetRange().end()); const CFRange range = CFRangeMake(i, end - i); base::ScopedCFTypeRef<CGColorRef> foreground( - CGColorCreateFromSkColor(style.color())); + skia::CGColorCreateFromSkColor(style.color())); CFAttributedStringSetAttribute(attr_string, range, kCTForegroundColorAttributeName, foreground); CFArrayAppendValue(attributes, foreground); @@ -417,7 +417,7 @@ void RenderTextMac::ComputeRuns() { const CGColorRef foreground = base::mac::GetValueFromDictionary<CGColorRef>( attributes, kCTForegroundColorAttributeName); if (foreground) - run->foreground = CGColorRefToSkColor(foreground); + run->foreground = skia::CGColorRefToSkColor(foreground); const CFNumberRef underline = base::mac::GetValueFromDictionary<CFNumberRef>( diff --git a/ui/message_center/cocoa/notification_controller.mm b/ui/message_center/cocoa/notification_controller.mm index c7d25c8..c4020e3 100644 --- a/ui/message_center/cocoa/notification_controller.mm +++ b/ui/message_center/cocoa/notification_controller.mm @@ -39,7 +39,7 @@ NSBezierPath* path = [NSBezierPath bezierPathWithRoundedRect:dirtyRect xRadius:message_center::kProgressBarCornerRadius yRadius:message_center::kProgressBarCornerRadius]; - [gfx::SkColorToCalibratedNSColor(message_center::kProgressBarBackgroundColor) + [skia::SkColorToCalibratedNSColor(message_center::kProgressBarBackgroundColor) set]; [path fill]; @@ -49,7 +49,8 @@ path = [NSBezierPath bezierPathWithRoundedRect:sliceRect xRadius:message_center::kProgressBarCornerRadius yRadius:message_center::kProgressBarCornerRadius]; - [gfx::SkColorToCalibratedNSColor(message_center::kProgressBarSliceColor) set]; + [skia::SkColorToCalibratedNSColor(message_center::kProgressBarSliceColor) + set]; [path fill]; } @@ -77,7 +78,7 @@ // drawRect: needs to fill the button with a background, otherwise we don't get // subpixel antialiasing. - (void)drawRect:(NSRect)dirtyRect { - NSColor* color = gfx::SkColorToCalibratedNSColor( + NSColor* color = skia::SkColorToCalibratedNSColor( message_center::kNotificationBackgroundColor); [color set]; NSRectFill(dirtyRect); @@ -103,7 +104,7 @@ if (!hovered_) return; - [gfx::SkColorToCalibratedNSColor( + [skia::SkColorToCalibratedNSColor( message_center::kHoveredButtonBackgroundColor) set]; NSRectFill(frame); } @@ -140,7 +141,7 @@ NSFontAttributeName : [title attribute:NSFontAttributeName atIndex:0 effectiveRange:NULL], NSForegroundColorAttributeName : - gfx::SkColorToCalibratedNSColor(message_center::kRegularTextColor), + skia::SkColorToCalibratedNSColor(message_center::kRegularTextColor), }; [[title string] drawWithRect:frame options:(NSStringDrawingUsesLineFragmentOrigin | @@ -319,7 +320,7 @@ base::scoped_nsobject<MCNotificationView> rootView( [[MCNotificationView alloc] initWithController:self frame:rootFrame]); [self configureCustomBox:rootView]; - [rootView setFillColor:gfx::SkColorToCalibratedNSColor( + [rootView setFillColor:skia::SkColorToCalibratedNSColor( message_center::kNotificationBackgroundColor)]; [self setView:rootView]; @@ -513,7 +514,7 @@ // Use dim color for the title part. NSColor* titleColor = - gfx::SkColorToCalibratedNSColor(message_center::kRegularTextColor); + skia::SkColorToCalibratedNSColor(message_center::kRegularTextColor); NSRange titleRange = NSMakeRange( 0, std::min(ellidedText.size(), items[i].title.size())); @@ -522,7 +523,7 @@ // Use dim color for the message part if it has not been truncated. if (ellidedText.size() > items[i].title.size() + 1) { NSColor* messageColor = - gfx::SkColorToCalibratedNSColor(message_center::kDimTextColor); + skia::SkColorToCalibratedNSColor(message_center::kDimTextColor); NSRange messageRange = NSMakeRange( items[i].title.size() + 1, ellidedText.size() - items[i].title.size() - 1); @@ -614,7 +615,7 @@ base::scoped_nsobject<NSBox> separator( [[AccessibilityIgnoredBox alloc] initWithFrame:separatorFrame]); [self configureCustomBox:separator]; - [separator setFillColor:gfx::SkColorToCalibratedNSColor( + [separator setFillColor:skia::SkColorToCalibratedNSColor( message_center::kButtonSeparatorColor)]; y += NSHeight(separatorFrame); frame.size.height += NSHeight(separatorFrame); @@ -714,7 +715,7 @@ base::scoped_nsobject<NSBox> imageBox( [[AccessibilityIgnoredBox alloc] initWithFrame:imageFrame]); [self configureCustomBox:imageBox]; - [imageBox setFillColor:gfx::SkColorToCalibratedNSColor( + [imageBox setFillColor:skia::SkColorToCalibratedNSColor( message_center::kIconBackgroundColor)]; [imageBox setAutoresizingMask:NSViewMinYMargin]; @@ -736,7 +737,7 @@ base::scoped_nsobject<NSBox> imageBox( [[AccessibilityIgnoredBox alloc] initWithFrame:imageFrame]); [self configureCustomBox:imageBox]; - [imageBox setFillColor:gfx::SkColorToCalibratedNSColor( + [imageBox setFillColor:skia::SkColorToCalibratedNSColor( message_center::kImageBackgroundColor)]; // Images with non-preferred aspect ratios get a border on all sides. @@ -862,7 +863,7 @@ contentFrame.size.height = 0; title_.reset([self newLabelWithFrame:contentFrame]); [title_ setAutoresizingMask:NSViewMinYMargin]; - [title_ setTextColor:gfx::SkColorToCalibratedNSColor( + [title_ setTextColor:skia::SkColorToCalibratedNSColor( message_center::kRegularTextColor)]; [title_ setFont:[NSFont messageFontOfSize:message_center::kTitleFontSize]]; } @@ -871,7 +872,7 @@ contentFrame.size.height = 0; message_.reset([self newLabelWithFrame:contentFrame]); [message_ setAutoresizingMask:NSViewMinYMargin]; - [message_ setTextColor:gfx::SkColorToCalibratedNSColor( + [message_ setTextColor:skia::SkColorToCalibratedNSColor( message_center::kRegularTextColor)]; [message_ setFont: [NSFont messageFontOfSize:message_center::kMessageFontSize]]; @@ -881,7 +882,7 @@ contentFrame.size.height = 0; contextMessage_.reset([self newLabelWithFrame:contentFrame]); [contextMessage_ setAutoresizingMask:NSViewMinYMargin]; - [contextMessage_ setTextColor:gfx::SkColorToCalibratedNSColor( + [contextMessage_ setTextColor:skia::SkColorToCalibratedNSColor( message_center::kDimTextColor)]; [contextMessage_ setFont: [NSFont messageFontOfSize:message_center::kMessageFontSize]]; @@ -893,7 +894,7 @@ // The labels MUST draw their background so that subpixel antialiasing can // happen on the text. [label setDrawsBackground:YES]; - [label setBackgroundColor:gfx::SkColorToCalibratedNSColor( + [label setBackgroundColor:skia::SkColorToCalibratedNSColor( message_center::kNotificationBackgroundColor)]; [label setEditable:NO]; diff --git a/ui/native_theme/native_theme_mac.mm b/ui/native_theme/native_theme_mac.mm index 8d7be31..edc3029 100644 --- a/ui/native_theme/native_theme_mac.mm +++ b/ui/native_theme/native_theme_mac.mm @@ -96,7 +96,7 @@ SkColor NSSystemColorToSkColor(NSColor* color) { NSColor* device_color = [color colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]]; if (device_color) - return gfx::NSDeviceColorToSkColor(device_color); + return skia::NSDeviceColorToSkColor(device_color); // Sometimes the conversion is not possible, but we can get an approximation // by going through a CGColorRef. Note that simply using NSColor methods for @@ -107,7 +107,7 @@ SkColor NSSystemColorToSkColor(NSColor* color) { CGColorRef cg_color = [color CGColor]; const size_t component_count = CGColorGetNumberOfComponents(cg_color); if (component_count == 4) - return gfx::CGColorRefToSkColor(cg_color); + return skia::CGColorRefToSkColor(cg_color); CHECK(component_count == 1 || component_count == 2); // 1-2 components means a grayscale channel and maybe an alpha channel, which diff --git a/ui/views/cocoa/bridged_content_view.mm b/ui/views/cocoa/bridged_content_view.mm index c30e7c7..80aa1c6 100644 --- a/ui/views/cocoa/bridged_content_view.mm +++ b/ui/views/cocoa/bridged_content_view.mm @@ -313,7 +313,7 @@ bool DispatchEventToMenu(views::Widget* widget, ui::KeyboardCode key_code) { if (drawMenuBackgroundForBlur_) { const CGFloat radius = views::MenuConfig::instance(nullptr).corner_radius; - [gfx::SkColorToSRGBNSColor(0x01000000) set]; + [skia::SkColorToSRGBNSColor(0x01000000) set]; [[NSBezierPath bezierPathWithRoundedRect:[self bounds] xRadius:radius yRadius:radius] fill]; |