diff options
author | Andrei Popescu <andreip@google.com> | 2009-08-19 14:09:30 +0100 |
---|---|---|
committer | Andrei Popescu <andreip@google.com> | 2009-08-19 14:09:30 +0100 |
commit | 058ccc7ba0a4d59b9f6e92808332aa9895425fc7 (patch) | |
tree | 276aad5a2bbc2fd7d65d21bfca42c9de88b3dd20 /WebCore/platform/graphics/mac | |
parent | 2796dd1bf3b4b01e7e1d96ea91bd3a212f647579 (diff) | |
download | external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.zip external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.tar.gz external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.tar.bz2 |
Revert "Merge WebKit r47420"
This reverts commit d227fc870c7a697500a3c900c31baf05fb9a8524.
Diffstat (limited to 'WebCore/platform/graphics/mac')
-rw-r--r-- | WebCore/platform/graphics/mac/FontMacATSUI.mm | 8 | ||||
-rw-r--r-- | WebCore/platform/graphics/mac/GraphicsLayerCA.h | 6 | ||||
-rw-r--r-- | WebCore/platform/graphics/mac/GraphicsLayerCA.mm | 27 | ||||
-rw-r--r-- | WebCore/platform/graphics/mac/SimpleFontDataMac.mm | 4 |
4 files changed, 8 insertions, 37 deletions
diff --git a/WebCore/platform/graphics/mac/FontMacATSUI.mm b/WebCore/platform/graphics/mac/FontMacATSUI.mm index 35c40bf..051abb7 100644 --- a/WebCore/platform/graphics/mac/FontMacATSUI.mm +++ b/WebCore/platform/graphics/mac/FontMacATSUI.mm @@ -504,8 +504,8 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run, const IntPoint& firstGlyphBounds = zeroTrapezoid; } - float beforeWidth = min(FixedToFloat(firstGlyphBounds.lowerLeft.x), FixedToFloat(firstGlyphBounds.upperLeft.x)); - float afterWidth = max(FixedToFloat(firstGlyphBounds.lowerRight.x), FixedToFloat(firstGlyphBounds.upperRight.x)); + float beforeWidth = MIN(FixedToFloat(firstGlyphBounds.lowerLeft.x), FixedToFloat(firstGlyphBounds.upperLeft.x)); + float afterWidth = MAX(FixedToFloat(firstGlyphBounds.lowerRight.x), FixedToFloat(firstGlyphBounds.upperRight.x)); FloatRect rect(point.x() + floorf(beforeWidth), point.y(), roundf(afterWidth) - floorf(beforeWidth), h); @@ -591,8 +591,8 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon if (actualNumBounds != 1) LOG_ERROR("unexpected result from ATSUGetGlyphBounds(): actualNumBounds(%d) != 1", actualNumBounds); - return max(FixedToFloat(firstGlyphBounds.upperRight.x), FixedToFloat(firstGlyphBounds.lowerRight.x)) - - min(FixedToFloat(firstGlyphBounds.upperLeft.x), FixedToFloat(firstGlyphBounds.lowerLeft.x)); + return MAX(FixedToFloat(firstGlyphBounds.upperRight.x), FixedToFloat(firstGlyphBounds.lowerRight.x)) - + MIN(FixedToFloat(firstGlyphBounds.upperLeft.x), FixedToFloat(firstGlyphBounds.lowerLeft.x)); } int Font::offsetForPositionForComplexText(const TextRun& run, int x, bool /*includePartialGlyphs*/) const diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.h b/WebCore/platform/graphics/mac/GraphicsLayerCA.h index d1bdb7e..ebdc6ac 100644 --- a/WebCore/platform/graphics/mac/GraphicsLayerCA.h +++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.h @@ -62,8 +62,6 @@ public: virtual void removeFromParent(); - virtual void setMaskLayer(GraphicsLayer*); - virtual void setPosition(const FloatPoint&); virtual void setAnchorPoint(const FloatPoint3D&); virtual void setSize(const FloatSize&); @@ -174,7 +172,6 @@ private: void updateContentsVideo(); void updateContentsRect(); void updateGeometryOrientation(); - void updateMaskLayer(); void updateLayerAnimations(); @@ -203,8 +200,7 @@ private: ContentsImageChanged = 1 << 17, ContentsVideoChanged = 1 << 18, ContentsRectChanged = 1 << 19, - GeometryOrientationChanged = 1 << 20, - MaskLayerChanged = 1 << 21 + GeometryOrientationChanged = 1 << 20 }; typedef unsigned LayerChangeFlags; void noteLayerPropertyChanged(LayerChangeFlags flags); diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm index abb310a..e5b9035 100644 --- a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm +++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm @@ -331,7 +331,7 @@ static NSDictionary* nullActionsDictionary() return actions; } -PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client) +GraphicsLayer* GraphicsLayer::createGraphicsLayer(GraphicsLayerClient* client) { return new GraphicsLayerCA(client); } @@ -432,15 +432,6 @@ void GraphicsLayerCA::removeFromParent() GraphicsLayer::removeFromParent(); } -void GraphicsLayerCA::setMaskLayer(GraphicsLayer* layer) -{ - if (layer == m_maskLayer) - return; - - GraphicsLayer::setMaskLayer(layer); - noteLayerPropertyChanged(MaskLayerChanged); -} - void GraphicsLayerCA::setPosition(const FloatPoint& point) { if (point == m_position) @@ -742,9 +733,6 @@ void GraphicsLayerCA::recursiveCommitChanges() { commitLayerChanges(); - if (m_maskLayer) - static_cast<GraphicsLayerCA*>(m_maskLayer)->commitLayerChanges(); - const Vector<GraphicsLayer*>& childLayers = children(); size_t numChildren = childLayers.size(); for (size_t i = 0; i < numChildren; ++i) { @@ -824,9 +812,6 @@ void GraphicsLayerCA::commitLayerChanges() if (m_uncommittedChanges & GeometryOrientationChanged) updateGeometryOrientation(); - if (m_uncommittedChanges & MaskLayerChanged) - updateMaskLayer(); - m_uncommittedChanges = NoChange; END_BLOCK_OBJC_EXCEPTIONS } @@ -836,12 +821,10 @@ void GraphicsLayerCA::updateSublayerList() NSMutableArray* newSublayers = nil; if (m_transformLayer) { - // Add the primary layer first. Even if we have negative z-order children, the primary layer always comes behind. + // FIXME: add the primary layer in the correct order with negative z-order children. newSublayers = [[NSMutableArray alloc] initWithObjects:m_layer.get(), nil]; } else if (m_contentsLayer) { // FIXME: add the contents layer in the correct order with negative z-order children. - // This does not cause visible rendering issues because currently contents layers are only used - // for replaced elements that don't have children. newSublayers = [[NSMutableArray alloc] initWithObjects:m_contentsLayer.get(), nil]; } @@ -1111,12 +1094,6 @@ void GraphicsLayerCA::updateGeometryOrientation() #endif } -void GraphicsLayerCA::updateMaskLayer() -{ - CALayer* maskCALayer = m_maskLayer ? m_maskLayer->platformLayer() : 0; - [m_layer.get() setMask:maskCALayer]; -} - void GraphicsLayerCA::updateLayerAnimations() { if (m_transitionPropertiesToRemove.size()) { diff --git a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm index acb97a7..cdde7cf 100644 --- a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm +++ b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm @@ -50,8 +50,6 @@ - (BOOL)_isFakeFixedPitch; @end -using namespace std; - namespace WebCore { const float smallCapsFontSizeMultiplier = 0.7f; @@ -271,7 +269,7 @@ void SimpleFontData::platformInit() // and web pages that foolishly use this metric for width will be laid out // poorly if we return an accurate height. Classic case is Times 13 point, // which has an "x" that is 7x6 pixels. - m_xHeight = max(NSMaxX(xBox), NSMaxY(xBox)); + m_xHeight = MAX(NSMaxX(xBox), NSMaxY(xBox)); } else m_xHeight = [m_platformData.font() xHeight]; } |