summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/base/clipboard/clipboard_mac.mm10
-rw-r--r--ui/base/resource/resource_bundle_ios.mm19
-rw-r--r--ui/gfx/blit.cc6
-rw-r--r--ui/gfx/color_profile_mac.cc2
-rw-r--r--ui/gfx/image/image_ios.mm21
-rw-r--r--ui/gfx/image/image_skia_util_ios.mm2
-rw-r--r--ui/gfx/image/image_unittest_util.cc2
-rw-r--r--ui/gfx/image/image_unittest_util_ios.mm19
-rw-r--r--ui/gfx/render_text_mac.cc26
-rw-r--r--ui/gfx/render_text_mac.h4
-rw-r--r--ui/shell_dialogs/select_file_dialog_mac.mm11
-rw-r--r--ui/snapshot/snapshot_mac.mm8
-rw-r--r--ui/surface/accelerated_surface_mac.cc4
-rw-r--r--ui/surface/accelerated_surface_mac.h2
14 files changed, 71 insertions, 65 deletions
diff --git a/ui/base/clipboard/clipboard_mac.mm b/ui/base/clipboard/clipboard_mac.mm
index 759e5a0..bb5bfae 100644
--- a/ui/base/clipboard/clipboard_mac.mm
+++ b/ui/base/clipboard/clipboard_mac.mm
@@ -159,21 +159,21 @@ void Clipboard::WriteBitmap(const char* pixel_data, const char* size_data) {
const gfx::Size* size = reinterpret_cast<const gfx::Size*>(size_data);
// Safe because the image goes away before the call returns.
- base::mac::ScopedCFTypeRef<CFDataRef> data(
+ base::ScopedCFTypeRef<CFDataRef> data(
CFDataCreateWithBytesNoCopy(kCFAllocatorDefault,
reinterpret_cast<const UInt8*>(pixel_data),
- size->width()*size->height()*4,
+ size->width() * size->height() * 4,
kCFAllocatorNull));
- base::mac::ScopedCFTypeRef<CGDataProviderRef> data_provider(
+ base::ScopedCFTypeRef<CGDataProviderRef> data_provider(
CGDataProviderCreateWithCFData(data));
- base::mac::ScopedCFTypeRef<CGImageRef> cgimage(
+ base::ScopedCFTypeRef<CGImageRef> cgimage(
CGImageCreate(size->width(),
size->height(),
8,
32,
- size->width()*4,
+ size->width() * 4,
base::mac::GetSRGBColorSpace(), // TODO(avi): do better
kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host,
data_provider,
diff --git a/ui/base/resource/resource_bundle_ios.mm b/ui/base/resource/resource_bundle_ios.mm
index f4919d7..d9f1fb5 100644
--- a/ui/base/resource/resource_bundle_ios.mm
+++ b/ui/base/resource/resource_bundle_ios.mm
@@ -135,15 +135,16 @@ gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) {
CGSize source_size = [ui_image size];
CGSize target_size = CGSizeMake(source_size.width * target_scale,
source_size.height * target_scale);
- base::mac::ScopedCFTypeRef<CGColorSpaceRef> color_space(
+ base::ScopedCFTypeRef<CGColorSpaceRef> color_space(
CGColorSpaceCreateDeviceRGB());
- base::mac::ScopedCFTypeRef<CGContextRef> context(
- CGBitmapContextCreate(
- NULL,
- target_size.width, target_size.height,
- 8, target_size.width * 4,
- color_space,
- kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
+ base::ScopedCFTypeRef<CGContextRef> context(CGBitmapContextCreate(
+ NULL,
+ target_size.width,
+ target_size.height,
+ 8,
+ target_size.width * 4,
+ color_space,
+ kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
CGRect target_rect = CGRectMake(0, 0,
target_size.width, target_size.height);
@@ -158,7 +159,7 @@ gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) {
CGContextFillRect(context, target_rect);
}
- base::mac::ScopedCFTypeRef<CGImageRef> cg_image(
+ base::ScopedCFTypeRef<CGImageRef> cg_image(
CGBitmapContextCreateImage(context));
ui_image.reset([[UIImage alloc] initWithCGImage:cg_image
scale:target_scale
diff --git a/ui/gfx/blit.cc b/ui/gfx/blit.cc
index 9bb7e4a..a0bae8a 100644
--- a/ui/gfx/blit.cc
+++ b/ui/gfx/blit.cc
@@ -71,9 +71,9 @@ void BlitContextToContext(NativeDrawingContext dst_context,
: transform.ty;
src_rect.Offset(transform.tx, delta_y);
- base::mac::ScopedCFTypeRef<CGImageRef>
- src_image(CGBitmapContextCreateImage(src_context));
- base::mac::ScopedCFTypeRef<CGImageRef> src_sub_image(
+ base::ScopedCFTypeRef<CGImageRef> src_image(
+ CGBitmapContextCreateImage(src_context));
+ base::ScopedCFTypeRef<CGImageRef> src_sub_image(
CGImageCreateWithImageInRect(src_image, src_rect.ToCGRect()));
CGContextDrawImage(dst_context, dst_rect.ToCGRect(), src_sub_image);
#elif defined(OS_ANDROID)
diff --git a/ui/gfx/color_profile_mac.cc b/ui/gfx/color_profile_mac.cc
index c313745..2c7f686 100644
--- a/ui/gfx/color_profile_mac.cc
+++ b/ui/gfx/color_profile_mac.cc
@@ -10,7 +10,7 @@ namespace gfx {
void ReadColorProfile(std::vector<char>* profile) {
CGColorSpaceRef monitor_color_space(base::mac::GetSystemColorSpace());
- base::mac::ScopedCFTypeRef<CFDataRef> icc_profile(
+ base::ScopedCFTypeRef<CFDataRef> icc_profile(
CGColorSpaceCopyICCProfile(monitor_color_space));
if (icc_profile) {
size_t length = CFDataGetLength(icc_profile);
diff --git a/ui/gfx/image/image_ios.mm b/ui/gfx/image/image_ios.mm
index 1e21bd8..e2ff8dc 100644
--- a/ui/gfx/image/image_ios.mm
+++ b/ui/gfx/image/image_ios.mm
@@ -27,20 +27,19 @@ namespace {
// Caller takes ownership of returned UIImage.
UIImage* CreateErrorUIImage(float scale) {
LOG(ERROR) << "Unable to decode PNG into UIImage.";
- base::mac::ScopedCFTypeRef<CGColorSpaceRef> color_space(
+ base::ScopedCFTypeRef<CGColorSpaceRef> color_space(
CGColorSpaceCreateDeviceRGB());
- base::mac::ScopedCFTypeRef<CGContextRef> context(
- CGBitmapContextCreate(NULL, // Allow CG to allocate memory.
- 16, // width
- 16, // height
- 8, // bitsPerComponent
- 0, // CG will calculate by default.
- color_space,
- kCGImageAlphaPremultipliedFirst |
- kCGBitmapByteOrder32Host));
+ base::ScopedCFTypeRef<CGContextRef> context(CGBitmapContextCreate(
+ NULL, // Allow CG to allocate memory.
+ 16, // width
+ 16, // height
+ 8, // bitsPerComponent
+ 0, // CG will calculate by default.
+ color_space,
+ kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1.0);
CGContextFillRect(context, CGRectMake(0.0, 0.0, 16, 16));
- base::mac::ScopedCFTypeRef<CGImageRef> cg_image(
+ base::ScopedCFTypeRef<CGImageRef> cg_image(
CGBitmapContextCreateImage(context));
return [[UIImage imageWithCGImage:cg_image.get()
scale:scale
diff --git a/ui/gfx/image/image_skia_util_ios.mm b/ui/gfx/image/image_skia_util_ios.mm
index 2d4afed..0ff8978 100644
--- a/ui/gfx/image/image_skia_util_ios.mm
+++ b/ui/gfx/image/image_skia_util_ios.mm
@@ -49,7 +49,7 @@ UIImage* UIImageFromImageSkiaRep(const gfx::ImageSkiaRep& image_skia_rep) {
return nil;
float scale = ui::GetScaleFactorScale(image_skia_rep.scale_factor());
- base::mac::ScopedCFTypeRef<CGColorSpaceRef> color_space(
+ base::ScopedCFTypeRef<CGColorSpaceRef> color_space(
CGColorSpaceCreateDeviceRGB());
return gfx::SkBitmapToUIImageWithColorSpace(image_skia_rep.sk_bitmap(), scale,
color_space);
diff --git a/ui/gfx/image/image_unittest_util.cc b/ui/gfx/image/image_unittest_util.cc
index b011413..ef59eb6 100644
--- a/ui/gfx/image/image_unittest_util.cc
+++ b/ui/gfx/image/image_unittest_util.cc
@@ -186,7 +186,7 @@ PlatformImage CreatePlatformImage() {
ui::ScaleFactor scale_factor = ui::GetMaxScaleFactor();
float scale = ui::GetScaleFactorScale(scale_factor);
- base::mac::ScopedCFTypeRef<CGColorSpaceRef> color_space(
+ base::ScopedCFTypeRef<CGColorSpaceRef> color_space(
CGColorSpaceCreateDeviceRGB());
UIImage* image =
gfx::SkBitmapToUIImageWithColorSpace(bitmap, scale, color_space);
diff --git a/ui/gfx/image/image_unittest_util_ios.mm b/ui/gfx/image/image_unittest_util_ios.mm
index f2d200d..5626617 100644
--- a/ui/gfx/image/image_unittest_util_ios.mm
+++ b/ui/gfx/image/image_unittest_util_ios.mm
@@ -14,19 +14,20 @@ namespace test {
SkColor GetPlatformImageColor(PlatformImage image, int x, int y) {
// Start by extracting the target pixel into a 1x1 CGImage.
- base::mac::ScopedCFTypeRef<CGImageRef> pixel_image(
+ base::ScopedCFTypeRef<CGImageRef> pixel_image(
CGImageCreateWithImageInRect(image.CGImage, CGRectMake(x, y, 1, 1)));
// Draw that pixel into a 1x1 bitmap context.
- base::mac::ScopedCFTypeRef<CGColorSpaceRef> color_space(
+ base::ScopedCFTypeRef<CGColorSpaceRef> color_space(
CGColorSpaceCreateDeviceRGB());
- base::mac::ScopedCFTypeRef<CGContextRef> bitmap_context(
- CGBitmapContextCreate(/*data=*/ NULL,
- /*width=*/ 1, /*height=*/ 1,
- /*bitsPerComponent=*/ 8, /*bytesPerRow=*/ 4,
- color_space,
- kCGImageAlphaPremultipliedFirst |
- kCGBitmapByteOrder32Host));
+ base::ScopedCFTypeRef<CGContextRef> bitmap_context(CGBitmapContextCreate(
+ /*data=*/ NULL,
+ /*width=*/ 1,
+ /*height=*/ 1,
+ /*bitsPerComponent=*/ 8,
+ /*bytesPerRow=*/ 4,
+ color_space,
+ kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
CGContextDrawImage(bitmap_context, CGRectMake(0, 0, 1, 1), pixel_image);
// The CGBitmapContext has the same memory layout as SkColor, so we can just
diff --git a/ui/gfx/render_text_mac.cc b/ui/gfx/render_text_mac.cc
index 67a547d..f6a1b78 100644
--- a/ui/gfx/render_text_mac.cc
+++ b/ui/gfx/render_text_mac.cc
@@ -107,22 +107,26 @@ void RenderTextMac::EnsureLayout() {
runs_valid_ = false;
const Font& font = GetFont();
- base::mac::ScopedCFTypeRef<CFStringRef> font_name_cf_string(
+ base::ScopedCFTypeRef<CFStringRef> font_name_cf_string(
base::SysUTF8ToCFStringRef(font.GetFontName()));
- base::mac::ScopedCFTypeRef<CTFontRef> ct_font(
+ base::ScopedCFTypeRef<CTFontRef> ct_font(
CTFontCreateWithName(font_name_cf_string, font.GetFontSize(), NULL));
const void* keys[] = { kCTFontAttributeName };
const void* values[] = { ct_font };
- base::mac::ScopedCFTypeRef<CFDictionaryRef> attributes(
- CFDictionaryCreate(NULL, keys, values, arraysize(keys), NULL,
+ base::ScopedCFTypeRef<CFDictionaryRef> attributes(
+ CFDictionaryCreate(NULL,
+ keys,
+ values,
+ arraysize(keys),
+ NULL,
&kCFTypeDictionaryValueCallBacks));
- base::mac::ScopedCFTypeRef<CFStringRef> cf_text(
+ base::ScopedCFTypeRef<CFStringRef> cf_text(
base::SysUTF16ToCFStringRef(text()));
- base::mac::ScopedCFTypeRef<CFAttributedStringRef> attr_text(
+ base::ScopedCFTypeRef<CFAttributedStringRef> attr_text(
CFAttributedStringCreate(NULL, cf_text, attributes));
- base::mac::ScopedCFTypeRef<CFMutableAttributedStringRef> attr_text_mutable(
+ base::ScopedCFTypeRef<CFMutableAttributedStringRef> attr_text_mutable(
CFAttributedStringCreateMutableCopy(NULL, 0, attr_text));
// TODO(asvitkine|msw): Respect GetTextDirection(), which may not match the
@@ -193,7 +197,7 @@ void RenderTextMac::ApplyStyles(CFMutableAttributedStringRef attr_string,
for (size_t i = 0, end = 0; i < layout_text_length; i = end) {
end = TextIndexToLayoutIndex(style.GetRange().end());
const CFRange range = CFRangeMake(i, end - i);
- base::mac::ScopedCFTypeRef<CGColorRef> foreground(
+ base::ScopedCFTypeRef<CGColorRef> foreground(
gfx::CGColorCreateFromSkColor(style.color()));
CFAttributedStringSetAttribute(attr_string, range,
kCTForegroundColorAttributeName, foreground);
@@ -201,7 +205,7 @@ void RenderTextMac::ApplyStyles(CFMutableAttributedStringRef attr_string,
if (style.style(UNDERLINE)) {
CTUnderlineStyle value = kCTUnderlineStyleSingle;
- base::mac::ScopedCFTypeRef<CFNumberRef> underline_value(
+ base::ScopedCFTypeRef<CFNumberRef> underline_value(
CFNumberCreate(NULL, kCFNumberSInt32Type, &value));
CFAttributedStringSetAttribute(attr_string, range,
kCTUnderlineStyleAttributeName,
@@ -212,7 +216,7 @@ void RenderTextMac::ApplyStyles(CFMutableAttributedStringRef attr_string,
const int traits = (style.style(BOLD) ? kCTFontBoldTrait : 0) |
(style.style(ITALIC) ? kCTFontItalicTrait : 0);
if (traits != 0) {
- base::mac::ScopedCFTypeRef<CTFontRef> styled_font(
+ base::ScopedCFTypeRef<CTFontRef> styled_font(
CTFontCreateCopyWithSymbolicTraits(font, 0.0, NULL, traits, traits));
// TODO(asvitkine): Handle |styled_font| == NULL case better.
if (styled_font) {
@@ -293,7 +297,7 @@ void RenderTextMac::ComputeRuns() {
CTFontRef ct_font =
base::mac::GetValueFromDictionary<CTFontRef>(attributes,
kCTFontAttributeName);
- base::mac::ScopedCFTypeRef<CFStringRef> font_name_ref(
+ base::ScopedCFTypeRef<CFStringRef> font_name_ref(
CTFontCopyFamilyName(ct_font));
run->font_name = base::SysCFStringRefToUTF8(font_name_ref);
run->text_size = CTFontGetSize(ct_font);
diff --git a/ui/gfx/render_text_mac.h b/ui/gfx/render_text_mac.h
index b89737b..345fef0 100644
--- a/ui/gfx/render_text_mac.h
+++ b/ui/gfx/render_text_mac.h
@@ -74,11 +74,11 @@ class RenderTextMac : public RenderText {
void ComputeRuns();
// The Core Text line of text. Created by |EnsureLayout()|.
- base::mac::ScopedCFTypeRef<CTLineRef> line_;
+ base::ScopedCFTypeRef<CTLineRef> line_;
// Array to hold CFAttributedString attributes that allows Core Text to hold
// weak references to them without leaking.
- base::mac::ScopedCFTypeRef<CFMutableArrayRef> attributes_;
+ base::ScopedCFTypeRef<CFMutableArrayRef> attributes_;
// Visual dimensions of the text. Computed by |EnsureLayout()|.
Size string_size_;
diff --git a/ui/shell_dialogs/select_file_dialog_mac.mm b/ui/shell_dialogs/select_file_dialog_mac.mm
index 8c1ffa3..8893762 100644
--- a/ui/shell_dialogs/select_file_dialog_mac.mm
+++ b/ui/shell_dialogs/select_file_dialog_mac.mm
@@ -29,8 +29,7 @@ namespace {
const int kFileTypePopupTag = 1234;
CFStringRef CreateUTIFromExtension(const base::FilePath::StringType& ext) {
- base::mac::ScopedCFTypeRef<CFStringRef> ext_cf(
- base::SysUTF8ToCFStringRef(ext));
+ base::ScopedCFTypeRef<CFStringRef> ext_cf(base::SysUTF8ToCFStringRef(ext));
return UTTypeCreatePreferredIdentifierForTag(
kUTTagClassFilenameExtension, ext_cf.get(), NULL);
}
@@ -226,7 +225,7 @@ void SelectFileDialogImpl::SelectFileImpl(
const std::vector<base::FilePath::StringType>& ext_list =
file_types->extensions[i];
for (size_t j = 0; j < ext_list.size(); ++j) {
- base::mac::ScopedCFTypeRef<CFStringRef> uti(
+ base::ScopedCFTypeRef<CFStringRef> uti(
CreateUTIFromExtension(ext_list[j]));
[file_type_set addObject:base::mac::CFToNSCast(uti.get())];
@@ -234,7 +233,7 @@ void SelectFileDialogImpl::SelectFileImpl(
// back to the original extension correctly. This occurs with dynamic
// UTIs on 10.7 and 10.8.
// See http://crbug.com/148840, http://openradar.me/12316273
- base::mac::ScopedCFTypeRef<CFStringRef> ext_cf(
+ base::ScopedCFTypeRef<CFStringRef> ext_cf(
base::SysUTF8ToCFStringRef(ext_list[j]));
[file_type_set addObject:base::mac::CFToNSCast(ext_cf.get())];
}
@@ -340,9 +339,9 @@ NSView* SelectFileDialogImpl::GetAccessoryView(const FileTypeInfo* file_types,
const std::vector<base::FilePath::StringType>& ext_list =
file_types->extensions[type];
DCHECK(!ext_list.empty());
- base::mac::ScopedCFTypeRef<CFStringRef> uti(
+ base::ScopedCFTypeRef<CFStringRef> uti(
CreateUTIFromExtension(ext_list[0]));
- base::mac::ScopedCFTypeRef<CFStringRef> description(
+ base::ScopedCFTypeRef<CFStringRef> description(
UTTypeCopyDescription(uti.get()));
type_description =
diff --git a/ui/snapshot/snapshot_mac.mm b/ui/snapshot/snapshot_mac.mm
index 5833704..5a0c6d6 100644
--- a/ui/snapshot/snapshot_mac.mm
+++ b/ui/snapshot/snapshot_mac.mm
@@ -41,9 +41,11 @@ bool GrabViewSnapshot(gfx::NativeView view,
png_representation->clear();
- base::mac::ScopedCFTypeRef<CGImageRef> windowSnapshot(CGWindowListCreateImage(
- screen_snapshot_bounds.ToCGRect(), kCGWindowListOptionIncludingWindow,
- [window windowNumber], kCGWindowImageBoundsIgnoreFraming));
+ base::ScopedCFTypeRef<CGImageRef> windowSnapshot(
+ CGWindowListCreateImage(screen_snapshot_bounds.ToCGRect(),
+ kCGWindowListOptionIncludingWindow,
+ [window windowNumber],
+ kCGWindowImageBoundsIgnoreFraming));
if (CGImageGetWidth(windowSnapshot) <= 0)
return false;
diff --git a/ui/surface/accelerated_surface_mac.cc b/ui/surface/accelerated_surface_mac.cc
index ce80eb0..5c63de7 100644
--- a/ui/surface/accelerated_surface_mac.cc
+++ b/ui/surface/accelerated_surface_mac.cc
@@ -116,7 +116,7 @@ static void AddBooleanValue(CFMutableDictionaryRef dictionary,
static void AddIntegerValue(CFMutableDictionaryRef dictionary,
const CFStringRef key,
int32 value) {
- base::mac::ScopedCFTypeRef<CFNumberRef> number(
+ base::ScopedCFTypeRef<CFNumberRef> number(
CFNumberCreate(NULL, kCFNumberSInt32Type, &value));
CFDictionaryAddValue(dictionary, key, number.get());
}
@@ -215,7 +215,7 @@ uint32 AcceleratedSurface::SetSurfaceSize(const gfx::Size& size) {
// Allocate a new IOSurface, which is the GPU resource that can be
// shared across processes.
- base::mac::ScopedCFTypeRef<CFMutableDictionaryRef> properties;
+ base::ScopedCFTypeRef<CFMutableDictionaryRef> properties;
properties.reset(CFDictionaryCreateMutable(kCFAllocatorDefault,
0,
&kCFTypeDictionaryKeyCallBacks,
diff --git a/ui/surface/accelerated_surface_mac.h b/ui/surface/accelerated_surface_mac.h
index e070287..0fbcbdb 100644
--- a/ui/surface/accelerated_surface_mac.h
+++ b/ui/surface/accelerated_surface_mac.h
@@ -118,7 +118,7 @@ class SURFACE_EXPORT AcceleratedSurface {
// to the shared region (IOSurface).
scoped_refptr<gfx::GLSurface> gl_surface_;
scoped_refptr<gfx::GLContext> gl_context_;
- base::mac::ScopedCFTypeRef<CFTypeRef> io_surface_;
+ base::ScopedCFTypeRef<CFTypeRef> io_surface_;
// The id of |io_surface_| or 0 if that's NULL.
uint32 io_surface_id_;