diff options
Diffstat (limited to 'Source/WebCore/platform/graphics/mac')
14 files changed, 88 insertions, 59 deletions
diff --git a/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp b/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp index 3553a9780..81cf10486 100644 --- a/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp +++ b/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp @@ -43,7 +43,7 @@ class TextLayout { public: static bool isNeeded(RenderText* text, const Font& font) { - TextRun run = RenderBlock::constructTextRun(text, font, text->characters(), text->textLength(), text->style()); + TextRun run = RenderBlock::constructTextRun(text, font, text, text->style()); return font.codePath(run) == Font::Complex; } @@ -54,13 +54,13 @@ public: { } - float width(unsigned from, unsigned len) + float width(unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts) { - m_controller->advance(from, 0, ByWholeGlyphs); + m_controller->advance(from, 0, ByWholeGlyphs, fallbackFonts); float beforeWidth = m_controller->runWidthSoFar(); if (m_font.wordSpacing() && from && Font::treatAsSpace(m_run[from])) beforeWidth += m_font.wordSpacing(); - m_controller->advance(from + len, 0, ByWholeGlyphs); + m_controller->advance(from + len, 0, ByWholeGlyphs, fallbackFonts); float afterWidth = m_controller->runWidthSoFar(); return afterWidth - beforeWidth; } @@ -68,7 +68,7 @@ public: private: static TextRun constructTextRun(RenderText* text, const Font& font, float xPos) { - TextRun run = RenderBlock::constructTextRun(text, font, text->characters(), text->textLength(), text->style()); + TextRun run = RenderBlock::constructTextRun(text, font, text, text->style()); run.setCharactersLength(text->textLength()); ASSERT(run.charactersLength() >= run.length()); @@ -94,9 +94,9 @@ void Font::deleteLayout(TextLayout* layout) delete layout; } -float Font::width(TextLayout& layout, unsigned from, unsigned len) +float Font::width(TextLayout& layout, unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts) { - return layout.width(from, len); + return layout.width(from, len, fallbackFonts); } static inline CGFloat roundCGFloat(CGFloat f) @@ -142,7 +142,11 @@ ComplexTextController::ComplexTextController(const Font* font, const TextRun& ru m_expansionPerOpportunity = 0; else { bool isAfterExpansion = m_afterExpansion; - unsigned expansionOpportunityCount = Font::expansionOpportunityCount(m_run.characters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion); + unsigned expansionOpportunityCount; + if (m_run.is8Bit()) + expansionOpportunityCount = Font::expansionOpportunityCount(m_run.characters8(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion); + else + expansionOpportunityCount = Font::expansionOpportunityCount(m_run.characters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion); if (isAfterExpansion && !m_run.allowsTrailingExpansion()) expansionOpportunityCount--; @@ -284,7 +288,14 @@ void ComplexTextController::collectComplexTextRuns() return; // We break up glyph run generation for the string by FontData. - const UChar* cp = m_run.characters16(); + const UChar* cp; + + if (m_run.is8Bit()) { + String stringFor8BitRun = String::make16BitFrom8BitSource(m_run.characters8(), m_run.length()); + cp = stringFor8BitRun.characters16(); + m_stringsFor8BitRuns.append(stringFor8BitRun); + } else + cp = m_run.characters16(); if (m_font.isSmallCaps()) m_smallCapsBuffer.resize(m_end); @@ -449,7 +460,7 @@ unsigned ComplexTextController::incrementCurrentRun(unsigned& leftmostGlyph) return indexOfCurrentRun(leftmostGlyph); } -void ComplexTextController::advance(unsigned offset, GlyphBuffer* glyphBuffer, GlyphIterationStyle iterationStyle) +void ComplexTextController::advance(unsigned offset, GlyphBuffer* glyphBuffer, GlyphIterationStyle iterationStyle, HashSet<const SimpleFontData*>* fallbackFonts) { if (static_cast<int>(offset) > m_end) offset = m_end; @@ -474,6 +485,8 @@ void ComplexTextController::advance(unsigned offset, GlyphBuffer* glyphBuffer, G size_t glyphCount = complexTextRun.glyphCount(); unsigned g = ltr ? m_glyphInCurrentRun : glyphCount - 1 - m_glyphInCurrentRun; unsigned k = leftmostGlyph + g; + if (fallbackFonts && complexTextRun.fontData() != m_font.primaryFont()) + fallbackFonts->add(complexTextRun.fontData()); while (m_glyphInCurrentRun < glyphCount) { unsigned glyphStartOffset = complexTextRun.indexAt(g); diff --git a/Source/WebCore/platform/graphics/mac/ComplexTextController.h b/Source/WebCore/platform/graphics/mac/ComplexTextController.h index b3165c279..25c946ee3 100644 --- a/Source/WebCore/platform/graphics/mac/ComplexTextController.h +++ b/Source/WebCore/platform/graphics/mac/ComplexTextController.h @@ -31,6 +31,7 @@ #include <wtf/RefCounted.h> #include <wtf/RetainPtr.h> #include <wtf/Vector.h> +#include <wtf/text/WTFString.h> #include <wtf/unicode/Unicode.h> typedef unsigned short CGGlyph; @@ -53,7 +54,7 @@ public: ComplexTextController(const Font*, const TextRun&, bool mayUseNaturalWritingDirection = false, HashSet<const SimpleFontData*>* fallbackFonts = 0, bool forTextEmphasis = false); // Advance and emit glyphs up to the specified character. - void advance(unsigned to, GlyphBuffer* = 0, GlyphIterationStyle = IncludePartialGlyphs); + void advance(unsigned to, GlyphBuffer* = 0, GlyphIterationStyle = IncludePartialGlyphs, HashSet<const SimpleFontData*>* fallbackFonts = 0); // Compute the character offset for a given x coordinate. int offsetForPosition(float x, bool includePartialGlyphs); @@ -143,6 +144,7 @@ private: bool m_mayUseNaturalWritingDirection; bool m_forTextEmphasis; + Vector<String> m_stringsFor8BitRuns; Vector<UChar, 256> m_smallCapsBuffer; // Retain lines rather than their runs for better performance. diff --git a/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm b/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm index 2440fd48e..f7d03110b 100644 --- a/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm +++ b/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm @@ -282,13 +282,13 @@ void ComplexTextController::collectComplexTextRunsForCharacters(const UChar* cp, m_complexTextRuns.append(ComplexTextRun::create(m_font.primaryFont(), cp, stringLocation + runRange.location, runRange.length, m_run.ltr())); continue; } - runFontData = fontCache()->getCachedFontData(m_font.fontDescription(), fontName.get(), false, FontCache::DoNotRetain); + runFontData = fontCache()->getCachedFontData(m_font.fontDescription(), fontName.get(), false, FontCache::DoNotRetain).get(); #if !PLATFORM(WX) // Core Text may have used a font that is not known to NSFontManager. In that case, fall back on // using the font as returned, even though it may not have the best NSFontRenderingMode. if (!runFontData) { FontPlatformData runFontPlatformData((NSFont *)runFont, CTFontGetSize(runFont), m_font.fontDescription().usePrinterFont()); - runFontData = fontCache()->getCachedFontData(&runFontPlatformData, FontCache::DoNotRetain); + runFontData = fontCache()->getCachedFontData(&runFontPlatformData, FontCache::DoNotRetain).get(); } #else // just assert for now, until we can devise a better fix that works with wx. diff --git a/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.cpp b/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.cpp index dfdd8de22..e5c1ad364 100644 --- a/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.cpp +++ b/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.cpp @@ -45,7 +45,7 @@ static CVReturn displayLinkCallback(CVDisplayLinkRef, const CVTimeStamp* now, co return kCVReturnSuccess; } - + DisplayRefreshMonitor::~DisplayRefreshMonitor() { if (m_displayLink) { @@ -61,7 +61,7 @@ bool DisplayRefreshMonitor::requestRefreshCallback() { if (!m_active) return false; - + if (!m_displayLink) { m_active = false; CVReturn error = CVDisplayLinkCreateWithCGDisplay(m_displayID, &m_displayLink); @@ -78,7 +78,7 @@ bool DisplayRefreshMonitor::requestRefreshCallback() m_active = true; } - + MutexLocker lock(m_mutex); m_scheduled = true; return true; @@ -92,9 +92,11 @@ void DisplayRefreshMonitor::displayLinkFired(double nowSeconds, double outputTim m_previousFrameDone = false; - double webKitNow = currentTime(); - m_timestamp = webKitNow - nowSeconds + outputTimeSeconds; - + double webKitMonotonicNow = monotonicallyIncreasingTime(); + double timeUntilOutput = outputTimeSeconds - nowSeconds; + // FIXME: Should this be using webKitMonotonicNow? + m_monotonicAnimationStartTime = webKitMonotonicNow + timeUntilOutput; + callOnMainThread(handleDisplayRefreshedNotificationOnMainThread, this); } diff --git a/Source/WebCore/platform/graphics/mac/FontCacheMac.mm b/Source/WebCore/platform/graphics/mac/FontCacheMac.mm index 9b2555823..d1dc8162a 100644 --- a/Source/WebCore/platform/graphics/mac/FontCacheMac.mm +++ b/Source/WebCore/platform/graphics/mac/FontCacheMac.mm @@ -99,7 +99,7 @@ static inline bool isAppKitFontWeightBold(NSInteger appKitFontWeight) return appKitFontWeight >= 7; } -const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length) +PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length) { UChar32 character; U16_GET(characters, 0, 0, length, character); @@ -172,12 +172,12 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons return getCachedFontData(&alternateFont, DoNotRetain); } -SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font) +PassRefPtr<SimpleFontData> FontCache::getSimilarFontPlatformData(const Font& font) { // Attempt to find an appropriate font using a match based on // the presence of keywords in the the requested names. For example, we'll // match any name that contains "Arabic" to Geeza Pro. - SimpleFontData* simpleFontData = 0; + RefPtr<SimpleFontData> simpleFontData; const FontFamily* currFamily = &font.fontDescription().family(); while (currFamily && !simpleFontData) { if (currFamily->family().length()) { @@ -190,18 +190,18 @@ SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font) currFamily = currFamily->next(); } - return simpleFontData; + return simpleFontData.release(); } -SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription, ShouldRetain shouldRetain) +PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& fontDescription, ShouldRetain shouldRetain) { DEFINE_STATIC_LOCAL(AtomicString, timesStr, ("Times")); // FIXME: Would be even better to somehow get the user's default font here. For now we'll pick // the default that the user would get without changing any prefs. - SimpleFontData* simpleFontData = getCachedFontData(fontDescription, timesStr, false, shouldRetain); + RefPtr<SimpleFontData> simpleFontData = getCachedFontData(fontDescription, timesStr, false, shouldRetain); if (simpleFontData) - return simpleFontData; + return simpleFontData.release(); // The Times fallback will almost always work, but in the highly unusual case where // the user doesn't have it, we fall back on Lucida Grande because that's diff --git a/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp b/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp index b7acd83bc..da80c2bde 100644 --- a/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp +++ b/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp @@ -91,8 +91,7 @@ float Font::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int if (run.rtl()) { initialAdvance = controller.totalWidth() + controller.finalRoundingWidth() - afterWidth; - for (int i = 0, end = glyphBuffer.size() - 1; i < glyphBuffer.size() / 2; ++i, --end) - glyphBuffer.swap(i, end); + glyphBuffer.reverse(0, glyphBuffer.size()); } else initialAdvance = beforeWidth; @@ -189,21 +188,21 @@ const SimpleFontData* Font::fontDataForCombiningCharacterSequence(const UChar* c if (simpleFontData->platformData().orientation() == Vertical) { if (isCJKIdeographOrSymbol(baseCharacter) && !simpleFontData->hasVerticalGlyphs()) { variant = BrokenIdeographVariant; - simpleFontData = simpleFontData->brokenIdeographFontData(); + simpleFontData = simpleFontData->brokenIdeographFontData().get(); } else if (m_fontDescription.textOrientation() == TextOrientationVerticalRight) { - SimpleFontData* verticalRightFontData = simpleFontData->verticalRightOrientationFontData(); + SimpleFontData* verticalRightFontData = simpleFontData->verticalRightOrientationFontData().get(); Glyph verticalRightGlyph = verticalRightFontData->glyphForCharacter(baseCharacter); if (verticalRightGlyph == baseCharacterGlyphData.glyph) simpleFontData = verticalRightFontData; } else { - SimpleFontData* uprightFontData = simpleFontData->uprightOrientationFontData(); + SimpleFontData* uprightFontData = simpleFontData->uprightOrientationFontData().get(); Glyph uprightGlyph = uprightFontData->glyphForCharacter(baseCharacter); if (uprightGlyph != baseCharacterGlyphData.glyph) simpleFontData = uprightFontData; } } } else { - if (const SimpleFontData* variantFontData = simpleFontData->variantFontData(m_fontDescription, variant)) + if (const SimpleFontData* variantFontData = simpleFontData->variantFontData(m_fontDescription, variant).get()) simpleFontData = variantFontData; } diff --git a/Source/WebCore/platform/graphics/mac/FontMac.mm b/Source/WebCore/platform/graphics/mac/FontMac.mm index 608123cbd..b515f81d5 100644 --- a/Source/WebCore/platform/graphics/mac/FontMac.mm +++ b/Source/WebCore/platform/graphics/mac/FontMac.mm @@ -241,15 +241,15 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons float shadowTextX = point.x() + shadowOffset.width(); // If shadows are ignoring transforms, then we haven't applied the Y coordinate flip yet, so down is negative. float shadowTextY = point.y() + shadowOffset.height() * (context->shadowsIgnoreTransforms() ? -1 : 1); - showGlyphsWithAdvances(FloatPoint(shadowTextX, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs); + showGlyphsWithAdvances(FloatPoint(shadowTextX, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs); if (syntheticBoldOffset) - showGlyphsWithAdvances(FloatPoint(shadowTextX + syntheticBoldOffset, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs); + showGlyphsWithAdvances(FloatPoint(shadowTextX + syntheticBoldOffset, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs); context->setFillColor(fillColor, fillColorSpace); } - showGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs); + showGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs); if (syntheticBoldOffset) - showGlyphsWithAdvances(FloatPoint(point.x() + syntheticBoldOffset, point.y()), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs); + showGlyphsWithAdvances(FloatPoint(point.x() + syntheticBoldOffset, point.y()), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs); if (hasSimpleShadow) context->setShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace); diff --git a/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm b/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm index 68f4f2437..82538779c 100644 --- a/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm +++ b/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm @@ -277,12 +277,6 @@ void GraphicsContext3D::setErrorMessageCallback(PassOwnPtr<ErrorMessageCallback> { } -void GraphicsContext3D::releaseShaderCompiler() -{ - makeContextCurrent(); - notImplemented(); -} - } #endif // USE(3D_GRAPHICS) diff --git a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h b/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h index 436160718..3ee1a4c29 100644 --- a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h +++ b/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h @@ -76,6 +76,10 @@ private: static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); static void getSupportedTypes(HashSet<String>& types); static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs, const KURL&); +#if ENABLE(ENCRYPTED_MEDIA) + static MediaPlayer::SupportsType extendedSupportsType(const String& type, const String& codecs, const String& keySystem, const KURL&); +#endif + static void getSitesInMediaCache(Vector<String>&); static void clearMediaCache(); static void clearMediaCacheForSite(const String&); diff --git a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm b/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm index 2e849af61..c03eda9e4 100644 --- a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm +++ b/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm @@ -47,7 +47,7 @@ #import <wtf/UnusedParam.h> #if USE(ACCELERATED_COMPOSITING) -#include "GraphicsLayer.h" +#include "PlatformLayer.h" #endif #if DRAW_FRAME_RATE @@ -190,7 +190,11 @@ PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateQTKit::create(MediaPla void MediaPlayerPrivateQTKit::registerMediaEngine(MediaEngineRegistrar registrar) { if (isAvailable()) +#if ENABLE(ENCRYPTED_MEDIA) + registrar(create, getSupportedTypes, extendedSupportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite); +#else registrar(create, getSupportedTypes, supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite); +#endif } MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit(MediaPlayer* player) @@ -1518,6 +1522,17 @@ MediaPlayer::SupportsType MediaPlayerPrivateQTKit::supportsType(const String& ty return MediaPlayer::IsNotSupported; } +#if ENABLE(ENCRYPTED_MEDIA) +MediaPlayer::SupportsType MediaPlayerPrivateQTKit::extendedSupportsType(const String& type, const String& codecs, const String& keySystem, const KURL& url) +{ + // QTKit does not support any encrytped media, so return IsNotSupported if the keySystem is non-NULL: + if (!keySystem.isNull() || !keySystem.isEmpty()) + return MediaPlayer::IsNotSupported; + + return supportsType(type, codecs, url);; +} +#endif + bool MediaPlayerPrivateQTKit::isAvailable() { // On 10.5 and higher, QuickTime will always be new enough for <video> and <audio> support, so we just check that the framework can be loaded. diff --git a/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp b/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp index 05193742c..0b713347f 100644 --- a/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp +++ b/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp @@ -43,7 +43,7 @@ CFDictionaryRef SimpleFontData::getCFStringAttributes(TypesettingFeatures typese { unsigned key = typesettingFeatures + 1; HashMap<unsigned, RetainPtr<CFDictionaryRef> >::AddResult addResult = m_CFStringAttributes.add(key, RetainPtr<CFDictionaryRef>()); - RetainPtr<CFDictionaryRef>& attributesDictionary = addResult.iterator->second; + RetainPtr<CFDictionaryRef>& attributesDictionary = addResult.iterator->value; if (!addResult.isNewEntry) return attributesDictionary.get(); diff --git a/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm b/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm index 66fe90a59..f8bb43ba7 100644 --- a/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm +++ b/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm @@ -308,19 +308,19 @@ void SimpleFontData::platformDestroy() if (!isCustomFont() && m_derivedFontData) { // These come from the cache. if (m_derivedFontData->smallCaps) - fontCache()->releaseFontData(m_derivedFontData->smallCaps.leakPtr()); + fontCache()->releaseFontData(m_derivedFontData->smallCaps.get()); if (m_derivedFontData->emphasisMark) - fontCache()->releaseFontData(m_derivedFontData->emphasisMark.leakPtr()); + fontCache()->releaseFontData(m_derivedFontData->emphasisMark.get()); } } -PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const +PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const { if (isCustomFont()) { FontPlatformData scaledFontData(m_platformData); scaledFontData.m_size = scaledFontData.m_size * scaleFactor; - return adoptPtr(new SimpleFontData(scaledFontData, true, false)); + return SimpleFontData::create(scaledFontData, true, false); } BEGIN_BLOCK_OBJC_EXCEPTIONS; @@ -345,31 +345,31 @@ PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescri scaledFontData.m_syntheticOblique = (fontTraits & NSItalicFontMask) && !(scaledFontTraits & NSItalicFontMask); // SimpleFontData::platformDestroy() takes care of not deleting the cached font data twice. - return adoptPtr(fontCache()->getCachedFontData(&scaledFontData)); + return fontCache()->getCachedFontData(&scaledFontData); } END_BLOCK_OBJC_EXCEPTIONS; - return nullptr; + return 0; } -SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const +PassRefPtr<SimpleFontData> SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const { if (!m_derivedFontData) m_derivedFontData = DerivedFontData::create(isCustomFont()); if (!m_derivedFontData->smallCaps) m_derivedFontData->smallCaps = createScaledFontData(fontDescription, smallCapsFontSizeMultiplier); - return m_derivedFontData->smallCaps.get(); + return m_derivedFontData->smallCaps; } -SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& fontDescription) const +PassRefPtr<SimpleFontData> SimpleFontData::emphasisMarkFontData(const FontDescription& fontDescription) const { if (!m_derivedFontData) m_derivedFontData = DerivedFontData::create(isCustomFont()); if (!m_derivedFontData->emphasisMark) m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, .5f); - return m_derivedFontData->emphasisMark.get(); + return m_derivedFontData->emphasisMark; } bool SimpleFontData::containsCharacters(const UChar* characters, int length) const @@ -461,7 +461,7 @@ bool SimpleFontData::canRenderCombiningCharacterSequence(const UChar* characters WTF::HashMap<String, bool>::AddResult addResult = m_combiningCharacterSequenceSupport->add(String(characters, length), false); if (!addResult.isNewEntry) - return addResult.iterator->second; + return addResult.iterator->value; RetainPtr<CGFontRef> cgFont(AdoptCF, CTFontCopyGraphicsFont(platformData().ctFont(), 0)); @@ -481,7 +481,7 @@ bool SimpleFontData::canRenderCombiningCharacterSequence(const UChar* characters return false; } - addResult.iterator->second = true; + addResult.iterator->value = true; return true; } diff --git a/Source/WebCore/platform/graphics/mac/WebLayer.mm b/Source/WebCore/platform/graphics/mac/WebLayer.mm index d783e494a..f89fec7f8 100644 --- a/Source/WebCore/platform/graphics/mac/WebLayer.mm +++ b/Source/WebCore/platform/graphics/mac/WebLayer.mm @@ -109,7 +109,7 @@ void drawLayerContents(CGContextRef context, CALayer *layer, WebCore::PlatformCA // Re-fetch the layer owner, since <rdar://problem/9125151> indicates that it might have been destroyed during painting. layerContents = platformLayer->owner(); ASSERT(layerContents); - if (platformLayer->layerType() != PlatformCALayer::LayerTypeTileCacheLayer && layerContents && layerContents->platformCALayerShowRepaintCounter()) { + if (!platformLayer->usesTileCacheLayer() && layerContents && layerContents->platformCALayerShowRepaintCounter(platformLayer)) { bool isTiledLayer = [layer isKindOfClass:[CATiledLayer class]]; char text[16]; // that's a lot of repaints @@ -178,7 +178,7 @@ void drawLayerContents(CGContextRef context, CALayer *layer, WebCore::PlatformCA [super setNeedsDisplayInRect:dirtyRect]; - if (layerOwner->platformCALayerShowRepaintCounter()) { + if (layerOwner->platformCALayerShowRepaintCounter(platformLayer)) { CGRect bounds = [self bounds]; CGRect indicatorRect = CGRectMake(bounds.origin.x, bounds.origin.y, 52, 27); if (layerOwner->platformCALayerContentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesBottomUp) diff --git a/Source/WebCore/platform/graphics/mac/WebTiledLayer.mm b/Source/WebCore/platform/graphics/mac/WebTiledLayer.mm index 9736e74dc..65fa7d2ee 100644 --- a/Source/WebCore/platform/graphics/mac/WebTiledLayer.mm +++ b/Source/WebCore/platform/graphics/mac/WebTiledLayer.mm @@ -84,7 +84,7 @@ using namespace WebCore; [super setNeedsDisplayInRect:dirtyRect]; - if (layerOwner->platformCALayerShowRepaintCounter()) { + if (layerOwner->platformCALayerShowRepaintCounter(platformLayer)) { CGRect bounds = [self bounds]; CGRect indicatorRect = CGRectMake(bounds.origin.x, bounds.origin.y, 52, 27); if (layerOwner->platformCALayerContentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesBottomUp) |