Title: [204658] trunk/Source/WebCore
Revision
204658
Author
mmaxfi...@apple.com
Date
2016-08-19 15:13:00 -0700 (Fri, 19 Aug 2016)

Log Message

Addressing post-review comments after r204592
https://bugs.webkit.org/show_bug.cgi?id=160895

Unreviewed.

No new tests because there is no behavior change.

* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::showText):
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawTextAtPoint):
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::drawLayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (204657 => 204658)


--- trunk/Source/WebCore/ChangeLog	2016-08-19 22:09:30 UTC (rev 204657)
+++ trunk/Source/WebCore/ChangeLog	2016-08-19 22:13:00 UTC (rev 204658)
@@ -1,3 +1,19 @@
+2016-08-19  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Addressing post-review comments after r204592
+        https://bugs.webkit.org/show_bug.cgi?id=160895
+
+        Unreviewed.
+
+        No new tests because there is no behavior change.
+
+        * page/cocoa/ResourceUsageOverlayCocoa.mm:
+        (WebCore::showText):
+        * platform/graphics/ca/PlatformCALayer.cpp:
+        (WebCore::PlatformCALayer::drawTextAtPoint):
+        * platform/ios/LegacyTileCache.mm:
+        (WebCore::LegacyTileCache::drawLayer):
+
 2016-08-19  Ryan Haddad  <ryanhad...@apple.com>
 
         Attempt to fix the Windows build after r204652.

Modified: trunk/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm (204657 => 204658)


--- trunk/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm	2016-08-19 22:09:30 UTC (rev 204657)
+++ trunk/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm	2016-08-19 22:13:00 UTC (rev 204658)
@@ -254,7 +254,7 @@
     CGContextSetTextDrawingMode(context, kCGTextFill);
     CGContextSetFillColorWithColor(context, color);
 
-    CGAffineTransform matrix = CGAffineTransformMakeScale(1, -1);
+    auto matrix = CGAffineTransformMakeScale(1, -1);
 #if PLATFORM(IOS)
     CFStringRef fontName = CFSTR("Courier");
     CGFloat fontSize = 10;
@@ -262,14 +262,14 @@
     CFStringRef fontName = CFSTR("Menlo");
     CGFloat fontSize = 11;
 #endif
-    RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithName(fontName, fontSize, &matrix));
+    auto font = adoptCF(CTFontCreateWithName(fontName, fontSize, &matrix));
     CFTypeRef keys[] = { kCTFontAttributeName, kCTForegroundColorFromContextAttributeName };
     CFTypeRef values[] = { font.get(), kCFBooleanTrue };
-    RetainPtr<CFDictionaryRef> attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+    auto attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
     CString cstr = text.ascii();
-    RetainPtr<CFStringRef> string = adoptCF(CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(cstr.data()), cstr.length(), kCFStringEncodingASCII, false, kCFAllocatorNull));
-    RetainPtr<CFAttributedStringRef> attributedString = adoptCF(CFAttributedStringCreate(kCFAllocatorDefault, string.get(), attributes.get()));
-    RetainPtr<CTLineRef> line = adoptCF(CTLineCreateWithAttributedString(attributedString.get()));
+    auto string = adoptCF(CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(cstr.data()), cstr.length(), kCFStringEncodingASCII, false, kCFAllocatorNull));
+    auto attributedString = adoptCF(CFAttributedStringCreate(kCFAllocatorDefault, string.get(), attributes.get()));
+    auto line = adoptCF(CTLineCreateWithAttributedString(attributedString.get()));
     CGContextSetTextPosition(context, x, y);
     CTLineDraw(line.get(), context);
 

Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp (204657 => 204658)


--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp	2016-08-19 22:09:30 UTC (rev 204657)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp	2016-08-19 22:13:00 UTC (rev 204658)
@@ -28,7 +28,6 @@
 
 #include <CoreFoundation/CoreFoundation.h>
 #include <CoreText/CoreText.h>
-
 #include "GraphicsContextCG.h"
 #include "LayerPool.h"
 #include "PlatformCALayerClient.h"
@@ -128,14 +127,14 @@
 // This function is needed to work around a bug in Windows CG <rdar://problem/22703470>
 void PlatformCALayer::drawTextAtPoint(CGContextRef context, CGFloat x, CGFloat y, CGSize scale, CGFloat fontSize, const char* text, size_t length) const
 {
-    CGAffineTransform matrix = CGAffineTransformMakeScale(scale.width, scale.height);
-    RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithName(CFSTR("Helvetica"), fontSize, &matrix));
+    auto matrix = CGAffineTransformMakeScale(scale.width, scale.height);
+    auto font = adoptCF(CTFontCreateWithName(CFSTR("Helvetica"), fontSize, &matrix));
     CFTypeRef keys[] = { kCTFontAttributeName, kCTForegroundColorFromContextAttributeName };
     CFTypeRef values[] = { font.get(), kCFBooleanTrue };
-    RetainPtr<CFDictionaryRef> attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
-    RetainPtr<CFStringRef> string = adoptCF(CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(text), length, kCFStringEncodingUTF8, false, kCFAllocatorNull));
-    RetainPtr<CFAttributedStringRef> attributedString = adoptCF(CFAttributedStringCreate(kCFAllocatorDefault, string.get(), attributes.get()));
-    RetainPtr<CTLineRef> line = adoptCF(CTLineCreateWithAttributedString(attributedString.get()));
+    auto attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+    auto string = adoptCF(CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(text), length, kCFStringEncodingUTF8, false, kCFAllocatorNull));
+    auto attributedString = adoptCF(CFAttributedStringCreate(kCFAllocatorDefault, string.get(), attributes.get()));
+    auto line = adoptCF(CTLineCreateWithAttributedString(attributedString.get()));
     CGContextSetTextPosition(context, x, y);
     CTLineDraw(line.get(), context);
 }

Modified: trunk/Source/WebCore/platform/ios/LegacyTileCache.mm (204657 => 204658)


--- trunk/Source/WebCore/platform/ios/LegacyTileCache.mm	2016-08-19 22:09:30 UTC (rev 204657)
+++ trunk/Source/WebCore/platform/ios/LegacyTileCache.mm	2016-08-19 22:13:00 UTC (rev 204658)
@@ -29,7 +29,6 @@
 #if PLATFORM(IOS)
 
 #include <CoreText/CoreText.h>
-
 #include "FontAntialiasingStateSaver.h"
 #include "LegacyTileGrid.h"
 #include "LegacyTileGridTile.h"
@@ -594,14 +593,14 @@
         else
             CGContextSetRGBFillColor(context, 1, 1, 1, 0.6f);
 
-        CGAffineTransform matrix = CGAffineTransformMakeScale(1, -1);
-        RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithName(CFSTR("Helvetica"), 25, &matrix));
+        auto matrix = CGAffineTransformMakeScale(1, -1);
+        auto font = adoptCF(CTFontCreateWithName(CFSTR("Helvetica"), 25, &matrix));
         CFTypeRef keys[] = { kCTFontAttributeName, kCTForegroundColorFromContextAttributeName };
         CFTypeRef values[] = { font.get(), kCFBooleanTrue };
-        RetainPtr<CFDictionaryRef> attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
-        RetainPtr<CFStringRef> string = adoptCF(CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(text), strlen(text), kCFStringEncodingUTF8, false, kCFAllocatorNull));
-        RetainPtr<CFAttributedStringRef> attributedString = adoptCF(CFAttributedStringCreate(kCFAllocatorDefault, string.get(), attributes.get()));
-        RetainPtr<CTLineRef> line = adoptCF(CTLineCreateWithAttributedString(attributedString.get()));
+        auto attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+        auto string = adoptCF(CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(text), strlen(text), kCFStringEncodingUTF8, false, kCFAllocatorNull));
+        auto attributedString = adoptCF(CFAttributedStringCreate(kCFAllocatorDefault, string.get(), attributes.get()));
+        auto line = adoptCF(CTLineCreateWithAttributedString(attributedString.get()));
         CGContextSetTextPosition(context, labelBounds.origin.x + 3, labelBounds.origin.y + 20);
         CTLineDraw(line.get(), context);
     
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to