Diff
Modified: trunk/Source/WebCore/ChangeLog (149346 => 149347)
--- trunk/Source/WebCore/ChangeLog 2013-04-30 01:47:26 UTC (rev 149346)
+++ trunk/Source/WebCore/ChangeLog 2013-04-30 01:59:59 UTC (rev 149347)
@@ -1,3 +1,18 @@
+2013-04-29 Alberto Garcia <[email protected]>
+
+ Remove all remaining Skia code
+ https://bugs.webkit.org/show_bug.cgi?id=115263
+
+ Reviewed by Benjamin Poulain.
+
+ * html/HTMLCanvasElement.cpp:
+ (WebCore): Remove the MaxSkiaDim constant, which was a leftover
+ from r149193.
+ * platform/graphics/harfbuzz/FontHarfBuzz.cpp: Removed.
+ * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp: Removed.
+ * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h: Removed.
+ * platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp: Removed.
+
2013-04-29 Anders Carlsson <[email protected]>
Fix build.
Modified: trunk/Source/WebCore/html/HTMLCanvasElement.cpp (149346 => 149347)
--- trunk/Source/WebCore/html/HTMLCanvasElement.cpp 2013-04-30 01:47:26 UTC (rev 149346)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.cpp 2013-04-30 01:59:59 UTC (rev 149347)
@@ -71,9 +71,6 @@
// in exchange for a smaller maximum canvas size.
static const float MaxCanvasArea = 32768 * 8192; // Maximum canvas area in CSS pixels
-//In Skia, we will also limit width/height to 32767.
-static const float MaxSkiaDim = 32767.0F; // Maximum width/height in CSS pixels.
-
HTMLCanvasElement::HTMLCanvasElement(const QualifiedName& tagName, Document* document)
: HTMLElement(tagName, document)
, m_size(DefaultWidth, DefaultHeight)
Deleted: trunk/Source/WebCore/platform/graphics/harfbuzz/FontHarfBuzz.cpp (149346 => 149347)
--- trunk/Source/WebCore/platform/graphics/harfbuzz/FontHarfBuzz.cpp 2013-04-30 01:47:26 UTC (rev 149346)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/FontHarfBuzz.cpp 2013-04-30 01:59:59 UTC (rev 149347)
@@ -1,222 +0,0 @@
-/*
- * Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Font.h"
-
-#include "FloatRect.h"
-#include "GlyphBuffer.h"
-#include "GraphicsContext.h"
-#include "HarfBuzzShaper.h"
-#include "NotImplemented.h"
-#include "PlatformContextSkia.h"
-#include "SimpleFontData.h"
-
-#include "SkCanvas.h"
-#include "SkPaint.h"
-#include "SkTemplates.h"
-#include "SkTypeface.h"
-#include "SkUtils.h"
-
-#include <wtf/unicode/Unicode.h>
-
-namespace WebCore {
-
-bool Font::canReturnFallbackFontsForComplexText()
-{
- return false;
-}
-
-bool Font::canExpandAroundIdeographsInComplexText()
-{
- return false;
-}
-
-void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
- const GlyphBuffer& glyphBuffer, int from, int numGlyphs,
- const FloatPoint& point) const {
- SkASSERT(sizeof(GlyphBufferGlyph) == sizeof(uint16_t)); // compile-time assert
-
- const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from);
- SkScalar x = SkFloatToScalar(point.x());
- SkScalar y = SkFloatToScalar(point.y());
-
- // FIXME: text rendering speed:
- // Android has code in their WebCore fork to special case when the
- // GlyphBuffer has no advances other than the defaults. In that case the
- // text drawing can proceed faster. However, it's unclear when those
- // patches may be upstreamed to WebKit so we always use the slower path
- // here.
- const GlyphBufferAdvance* adv = glyphBuffer.advances(from);
- SkAutoSTMalloc<32, SkPoint> storage(numGlyphs), storage2(numGlyphs), storage3(numGlyphs);
- SkPoint* pos = storage.get();
- SkPoint* vPosBegin = storage2.get();
- SkPoint* vPosEnd = storage3.get();
-
- bool isVertical = font->platformData().orientation() == Vertical;
- for (int i = 0; i < numGlyphs; i++) {
- SkScalar myWidth = SkFloatToScalar(adv[i].width());
- pos[i].set(x, y);
- if (isVertical) {
- vPosBegin[i].set(x + myWidth, y);
- vPosEnd[i].set(x + myWidth, y - myWidth);
- }
- x += myWidth;
- y += SkFloatToScalar(adv[i].height());
- }
-
- PlatformContextSkia* platformContext = gc->platformContext();
- TextDrawingModeFlags textMode = gc->platformContext()->getTextDrawingMode();
-
- // We draw text up to two times (once for fill, once for stroke).
- if (textMode & TextModeFill) {
- SkPaint paint;
- gc->platformContext()->setupPaintForFilling(&paint);
- font->platformData().setupPaint(&paint);
- gc->platformContext()->adjustTextRenderMode(&paint);
- paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-
- if (isVertical) {
- SkPath path;
- for (int i = 0; i < numGlyphs; ++i) {
- path.reset();
- path.moveTo(vPosBegin[i]);
- path.lineTo(vPosEnd[i]);
- platformContext->drawTextOnPath(glyphs + i, 2, path, 0, paint);
- }
- } else
- platformContext->drawPosText(glyphs, numGlyphs << 1, pos, paint);
- }
-
- if ((textMode & TextModeStroke)
- && gc->platformContext()->getStrokeStyle() != NoStroke
- && gc->platformContext()->getStrokeThickness() > 0) {
-
- SkPaint paint;
- gc->platformContext()->setupPaintForStroking(&paint, 0, 0);
- font->platformData().setupPaint(&paint);
- gc->platformContext()->adjustTextRenderMode(&paint);
- paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-
- if (textMode & TextModeFill) {
- // If we also filled, we don't want to draw shadows twice.
- // See comment in FontChromiumWin.cpp::paintSkiaText() for more details.
- // Since we use the looper for shadows, we remove it (if any) now.
- paint.setLooper(0);
- }
-
- if (isVertical) {
- SkPath path;
- for (int i = 0; i < numGlyphs; ++i) {
- path.reset();
- path.moveTo(vPosBegin[i]);
- path.lineTo(vPosEnd[i]);
- platformContext->drawTextOnPath(glyphs + i, 2, path, 0, paint);
- }
- } else
- platformContext->drawPosText(glyphs, numGlyphs << 1, pos, paint);
- }
-}
-
-static void setupForTextPainting(SkPaint* paint, SkColor color)
-{
- paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding);
- paint->setColor(color);
-}
-
-void Font::drawComplexText(GraphicsContext* gc, const TextRun& run,
- const FloatPoint& point, int from, int to) const
-{
- if (!run.length())
- return;
-
- TextDrawingModeFlags textMode = gc->platformContext()->getTextDrawingMode();
- bool fill = textMode & TextModeFill;
- bool stroke = (textMode & TextModeStroke)
- && gc->platformContext()->getStrokeStyle() != NoStroke
- && gc->platformContext()->getStrokeThickness() > 0;
-
- if (!fill && !stroke)
- return;
-
- SkPaint strokePaint, fillPaint;
- if (fill) {
- gc->platformContext()->setupPaintForFilling(&fillPaint);
- setupForTextPainting(&fillPaint, gc->fillColor().rgb());
- }
- if (stroke) {
- gc->platformContext()->setupPaintForStroking(&strokePaint, 0, 0);
- setupForTextPainting(&strokePaint, gc->strokeColor().rgb());
- }
-
- GlyphBuffer glyphBuffer;
- HarfBuzzShaper shaper(this, run);
- shaper.setDrawRange(from, to);
- if (!shaper.shape(&glyphBuffer))
- return;
- FloatPoint adjustedPoint = shaper.adjustStartPoint(point);
- drawGlyphBuffer(gc, run, glyphBuffer, adjustedPoint);
-}
-
-void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const
-{
- notImplemented();
-}
-
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow* /* glyphOverflow */) const
-{
- HarfBuzzShaper shaper(this, run);
- if (!shaper.shape())
- return 0;
- return shaper.totalWidth();
-}
-
-// Return the code point index for the given |x| offset into the text run.
-int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat,
- bool includePartialGlyphs) const
-{
- HarfBuzzShaper shaper(this, run);
- if (!shaper.shape())
- return 0;
- return shaper.offsetForPosition(xFloat);
-}
-
-// Return the rectangle for selecting the given range of code-points in the TextRun.
-FloatRect Font::selectionRectForComplexText(const TextRun& run,
- const FloatPoint& point, int height,
- int from, int to) const
-{
- HarfBuzzShaper shaper(this, run);
- if (!shaper.shape())
- return FloatRect();
- return shaper.selectionRect(point, height, from, to);
-}
-
-} // namespace WebCore
Deleted: trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp (149346 => 149347)
--- trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp 2013-04-30 01:47:26 UTC (rev 149346)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp 2013-04-30 01:59:59 UTC (rev 149347)
@@ -1,333 +0,0 @@
-/*
- * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "FontPlatformDataHarfBuzz.h"
-
-#include "FontCache.h"
-#include "HarfBuzzFace.h"
-#include "NotImplemented.h"
-#include "SkAdvancedTypefaceMetrics.h"
-#include "SkPaint.h"
-#include "SkTypeface.h"
-
-#include <public/linux/WebFontInfo.h>
-#include <public/linux/WebFontRenderStyle.h>
-#include <public/linux/WebSandboxSupport.h>
-#include <public/Platform.h>
-#include <wtf/text/StringImpl.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-static SkPaint::Hinting skiaHinting = SkPaint::kNormal_Hinting;
-static bool useSkiaAutoHint = true;
-static bool useSkiaBitmaps = true;
-static bool useSkiaAntiAlias = true;
-static bool useSkiaSubpixelRendering = false;
-static bool useSkiaSubpixelPositioning = false;
-
-void FontPlatformData::setHinting(SkPaint::Hinting hinting)
-{
- skiaHinting = hinting;
-}
-
-void FontPlatformData::setAutoHint(bool useAutoHint)
-{
- useSkiaAutoHint = useAutoHint;
-}
-
-void FontPlatformData::setUseBitmaps(bool useBitmaps)
-{
- useSkiaBitmaps = useBitmaps;
-}
-
-void FontPlatformData::setAntiAlias(bool useAntiAlias)
-{
- useSkiaAntiAlias = useAntiAlias;
-}
-
-void FontPlatformData::setSubpixelRendering(bool useSubpixelRendering)
-{
- useSkiaSubpixelRendering = useSubpixelRendering;
-}
-
-void FontPlatformData::setSubpixelPositioning(bool useSubpixelPositioning)
-{
- useSkiaSubpixelPositioning = useSubpixelPositioning;
-}
-
-FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType)
- : m_typeface(hashTableDeletedFontValue())
- , m_textSize(0)
- , m_emSizeInFontUnits(0)
- , m_fakeBold(false)
- , m_fakeItalic(false)
- , m_orientation(Horizontal)
-{
-}
-
-FontPlatformData::FontPlatformData()
- : m_typeface(0)
- , m_textSize(0)
- , m_emSizeInFontUnits(0)
- , m_fakeBold(false)
- , m_fakeItalic(false)
- , m_orientation(Horizontal)
-{
-}
-
-FontPlatformData::FontPlatformData(float textSize, bool fakeBold, bool fakeItalic)
- : m_typeface(0)
- , m_textSize(textSize)
- , m_emSizeInFontUnits(0)
- , m_fakeBold(fakeBold)
- , m_fakeItalic(fakeItalic)
- , m_orientation(Horizontal)
-{
-}
-
-FontPlatformData::FontPlatformData(const FontPlatformData& src)
- : m_typeface(src.m_typeface)
- , m_family(src.m_family)
- , m_textSize(src.m_textSize)
- , m_emSizeInFontUnits(src.m_emSizeInFontUnits)
- , m_fakeBold(src.m_fakeBold)
- , m_fakeItalic(src.m_fakeItalic)
- , m_orientation(src.m_orientation)
- , m_style(src.m_style)
- , m_harfBuzzFace(src.m_harfBuzzFace)
-{
- SkSafeRef(m_typeface);
-}
-
-FontPlatformData::FontPlatformData(SkTypeface* tf, const char* family, float textSize, bool fakeBold, bool fakeItalic, FontOrientation orientation)
- : m_typeface(tf)
- , m_family(family)
- , m_textSize(textSize)
- , m_emSizeInFontUnits(0)
- , m_fakeBold(fakeBold)
- , m_fakeItalic(fakeItalic)
- , m_orientation(orientation)
-{
- SkSafeRef(m_typeface);
- querySystemForRenderStyle();
-}
-
-FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize)
- : m_typeface(src.m_typeface)
- , m_family(src.m_family)
- , m_textSize(textSize)
- , m_emSizeInFontUnits(src.m_emSizeInFontUnits)
- , m_fakeBold(src.m_fakeBold)
- , m_fakeItalic(src.m_fakeItalic)
- , m_orientation(src.m_orientation)
- , m_harfBuzzFace(src.m_harfBuzzFace)
-{
- SkSafeRef(m_typeface);
- querySystemForRenderStyle();
-}
-
-FontPlatformData::~FontPlatformData()
-{
- SkSafeUnref(m_typeface);
-}
-
-int FontPlatformData::emSizeInFontUnits() const
-{
- if (m_emSizeInFontUnits)
- return m_emSizeInFontUnits;
-
- m_emSizeInFontUnits = m_typeface->getUnitsPerEm();
- return m_emSizeInFontUnits;
-}
-
-FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src)
-{
- SkRefCnt_SafeAssign(m_typeface, src.m_typeface);
-
- m_family = src.m_family;
- m_textSize = src.m_textSize;
- m_fakeBold = src.m_fakeBold;
- m_fakeItalic = src.m_fakeItalic;
- m_harfBuzzFace = src.m_harfBuzzFace;
- m_orientation = src.m_orientation;
- m_style = src.m_style;
- m_emSizeInFontUnits = src.m_emSizeInFontUnits;
-
- return *this;
-}
-
-#ifndef NDEBUG
-String FontPlatformData::description() const
-{
- return String();
-}
-#endif
-
-void FontPlatformData::setupPaint(SkPaint* paint) const
-{
- paint->setAntiAlias(m_style.useAntiAlias);
- paint->setHinting(static_cast<SkPaint::Hinting>(m_style.hintStyle));
- paint->setEmbeddedBitmapText(m_style.useBitmaps);
- paint->setAutohinted(m_style.useAutoHint);
- paint->setSubpixelText(m_style.useSubpixelPositioning);
- if (m_style.useAntiAlias)
- paint->setLCDRenderText(m_style.useSubpixelRendering);
-
- const float ts = m_textSize >= 0 ? m_textSize : 12;
- paint->setTextSize(SkFloatToScalar(ts));
- paint->setTypeface(m_typeface);
- paint->setFakeBoldText(m_fakeBold);
- paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0);
-}
-
-SkFontID FontPlatformData::uniqueID() const
-{
- return m_typeface->uniqueID();
-}
-
-bool FontPlatformData::operator==(const FontPlatformData& a) const
-{
- // If either of the typeface pointers are invalid (either 0 or the
- // special deleted value) then we test for pointer equality. Otherwise, we
- // call SkTypeface::Equal on the valid pointers.
- bool typefacesEqual;
- if (m_typeface == hashTableDeletedFontValue()
- || a.m_typeface == hashTableDeletedFontValue()
- || !m_typeface
- || !a.m_typeface)
- typefacesEqual = m_typeface == a.m_typeface;
- else
- typefacesEqual = SkTypeface::Equal(m_typeface, a.m_typeface);
-
- return typefacesEqual
- && m_textSize == a.m_textSize
- && m_fakeBold == a.m_fakeBold
- && m_fakeItalic == a.m_fakeItalic
- && m_orientation == a.m_orientation
- && m_style == a.m_style;
-}
-
-unsigned FontPlatformData::hash() const
-{
- unsigned h = SkTypeface::UniqueID(m_typeface);
- h ^= 0x01010101 * ((static_cast<int>(m_orientation) << 2) | (static_cast<int>(m_fakeBold) << 1) | static_cast<int>(m_fakeItalic));
-
- // This memcpy is to avoid a reinterpret_cast that breaks strict-aliasing
- // rules. Memcpy is generally optimized enough so that performance doesn't
- // matter here.
- uint32_t textSizeBytes;
- memcpy(&textSizeBytes, &m_textSize, sizeof(uint32_t));
- h ^= textSizeBytes;
-
- return h;
-}
-
-bool FontPlatformData::isFixedPitch() const
-{
- notImplemented();
- return false;
-}
-
-HarfBuzzFace* FontPlatformData::harfBuzzFace() const
-{
- if (!m_harfBuzzFace)
- m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this), uniqueID());
-
- return m_harfBuzzFace.get();
-}
-
-void FontPlatformData::getRenderStyleForStrike(const char* font, int sizeAndStyle)
-{
- WebKit::WebFontRenderStyle style;
-
- if (!font || !*font)
- style.setDefaults(); // It's probably a webfont. Take the system defaults.
- else if (WebKit::Platform::current()->sandboxSupport())
- WebKit::Platform::current()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style);
- else
- WebKit::WebFontInfo::renderStyleForStrike(font, sizeAndStyle, &style);
-
- style.toFontRenderStyle(&m_style);
-}
-
-void FontPlatformData::querySystemForRenderStyle()
-{
- getRenderStyleForStrike(m_family.data(), (((int)m_textSize) << 2) | (m_typeface->style() & 3));
-
- // Fix FontRenderStyle::NoPreference to actual styles.
- if (m_style.useAntiAlias == FontRenderStyle::NoPreference)
- m_style.useAntiAlias = useSkiaAntiAlias;
-
- if (!m_style.useHinting)
- m_style.hintStyle = SkPaint::kNo_Hinting;
- else if (m_style.useHinting == FontRenderStyle::NoPreference)
- m_style.hintStyle = skiaHinting;
-
- if (m_style.useBitmaps == FontRenderStyle::NoPreference)
- m_style.useBitmaps = useSkiaBitmaps;
- if (m_style.useAutoHint == FontRenderStyle::NoPreference)
- m_style.useAutoHint = useSkiaAutoHint;
- if (m_style.useSubpixelPositioning == FontRenderStyle::NoPreference)
- m_style.useSubpixelPositioning = useSkiaSubpixelPositioning;
- if (m_style.useAntiAlias == FontRenderStyle::NoPreference)
- m_style.useAntiAlias = useSkiaAntiAlias;
- if (m_style.useSubpixelRendering == FontRenderStyle::NoPreference)
- m_style.useSubpixelRendering = useSkiaSubpixelRendering;
-}
-
-#if ENABLE(OPENTYPE_VERTICAL)
-static SkFontTableTag reverseByteOrder(uint32_t tableTag)
-{
- return (tableTag >> 24) | ((tableTag >> 8) & 0xff00) | ((tableTag & 0xff00) << 8) | ((tableTag & 0xff) << 24);
-}
-
-PassRefPtr<OpenTypeVerticalData> FontPlatformData::verticalData() const
-{
- return fontCache()->getVerticalData(uniqueID(), *this);
-}
-
-PassRefPtr<SharedBuffer> FontPlatformData::openTypeTable(uint32_t table) const
-{
- RefPtr<SharedBuffer> buffer;
-
- SkFontTableTag tag = reverseByteOrder(table);
- const size_t tableSize = m_typeface->getTableSize(tag);
- if (tableSize) {
- Vector<char> tableBuffer(tableSize);
- m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]);
- buffer = SharedBuffer::adoptVector(tableBuffer);
- }
- return buffer.release();
-}
-#endif
-
-} // namespace WebCore
Deleted: trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h (149346 => 149347)
--- trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h 2013-04-30 01:47:26 UTC (rev 149346)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h 2013-04-30 01:59:59 UTC (rev 149347)
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef FontPlatformDataHarfBuzz_h
-#define FontPlatformDataHarfBuzz_h
-
-#include "FontOrientation.h"
-#include "FontRenderStyle.h"
-#include "OpenTypeVerticalData.h"
-#include "SharedBuffer.h"
-#include "SkPaint.h"
-#include <wtf/Forward.h>
-#include <wtf/RefPtr.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/StringImpl.h>
-
-class SkTypeface;
-typedef uint32_t SkFontID;
-
-namespace WebCore {
-
-class FontDescription;
-class HarfBuzzFace;
-
-// -----------------------------------------------------------------------------
-// FontPlatformData is the handle which WebKit has on a specific face. A face
-// is the tuple of (font, size, ...etc). Here we are just wrapping a Skia
-// SkTypeface pointer and dealing with the reference counting etc.
-// -----------------------------------------------------------------------------
-class FontPlatformData {
-public:
- // Used for deleted values in the font cache's hash tables. The hash table
- // will create us with this structure, and it will compare other values
- // to this "Deleted" one. It expects the Deleted one to be differentiable
- // from the 0 one (created with the empty constructor), so we can't just
- // set everything to 0.
- FontPlatformData(WTF::HashTableDeletedValueType);
- FontPlatformData();
- FontPlatformData(float textSize, bool fakeBold, bool fakeItalic);
- FontPlatformData(const FontPlatformData&);
- FontPlatformData(SkTypeface*, const char* name, float textSize, bool fakeBold, bool fakeItalic, FontOrientation = Horizontal);
- FontPlatformData(const FontPlatformData& src, float textSize);
- ~FontPlatformData();
-
- // -------------------------------------------------------------------------
- // Return true iff this font is monospaced (i.e. every glyph has an equal x
- // advance)
- // -------------------------------------------------------------------------
- bool isFixedPitch() const;
-
- // -------------------------------------------------------------------------
- // Setup a Skia painting context to use this font.
- // -------------------------------------------------------------------------
- void setupPaint(SkPaint*) const;
-
- // -------------------------------------------------------------------------
- // Return Skia's unique id for this font. This encodes both the style and
- // the font's file name so refers to a single face.
- // -------------------------------------------------------------------------
- SkFontID uniqueID() const;
- SkTypeface* typeface() const { return m_typeface; }
-
- unsigned hash() const;
- float size() const { return m_textSize; }
- int emSizeInFontUnits() const;
-
- FontOrientation orientation() const { return m_orientation; }
- void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
- void setFakeBold(bool fakeBold) { m_fakeBold = fakeBold; }
- void setFakeItalic(bool fakeItalic) { m_fakeItalic = fakeItalic; }
- bool operator==(const FontPlatformData&) const;
- FontPlatformData& operator=(const FontPlatformData&);
- bool isHashTableDeletedValue() const { return m_typeface == hashTableDeletedFontValue(); }
-
-#if ENABLE(OPENTYPE_VERTICAL)
- PassRefPtr<OpenTypeVerticalData> verticalData() const;
- PassRefPtr<SharedBuffer> openTypeTable(uint32_t table) const;
-#endif
-
-#ifndef NDEBUG
- String description() const;
-#endif
-
- HarfBuzzFace* harfBuzzFace() const;
-
- // The returned styles are all actual styles without FontRenderStyle::NoPreference.
- const FontRenderStyle& fontRenderStyle() const { return m_style; }
-
- // -------------------------------------------------------------------------
- // Global font preferences...
-
- static void setHinting(SkPaint::Hinting);
- static void setAutoHint(bool);
- static void setUseBitmaps(bool);
- static void setAntiAlias(bool);
- static void setSubpixelRendering(bool);
- static void setSubpixelPositioning(bool);
-
-private:
- void getRenderStyleForStrike(const char*, int);
- void querySystemForRenderStyle();
-
- // FIXME: Could SkAutoUnref be used here?
- SkTypeface* m_typeface;
- CString m_family;
- float m_textSize;
- mutable int m_emSizeInFontUnits;
- bool m_fakeBold;
- bool m_fakeItalic;
- FontOrientation m_orientation;
- FontRenderStyle m_style;
- mutable RefPtr<HarfBuzzFace> m_harfBuzzFace;
-
- SkTypeface* hashTableDeletedFontValue() const { return reinterpret_cast<SkTypeface*>(-1); }
-};
-
-} // namespace WebCore
-
-#endif // ifdef FontPlatformDataHarfBuzz_h
Deleted: trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp (149346 => 149347)
--- trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp 2013-04-30 01:47:26 UTC (rev 149346)
+++ trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp 2013-04-30 01:59:59 UTC (rev 149347)
@@ -1,196 +0,0 @@
-/*
- * Copyright (c) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "HarfBuzzFace.h"
-
-#include "FontPlatformData.h"
-#include "GlyphBuffer.h"
-#include "HarfBuzzShaper.h"
-#include "SimpleFontData.h"
-#include "SkPaint.h"
-#include "SkPath.h"
-#include "SkPoint.h"
-#include "SkRect.h"
-#include "SkTypeface.h"
-#include "SkUtils.h"
-
-#include "hb.h"
-#include <wtf/HashMap.h>
-
-namespace WebCore {
-
-// Our implementation of the callbacks which HarfBuzz requires by using Skia
-// calls. See the HarfBuzz source for references about what these callbacks do.
-
-struct HarfBuzzFontData {
- HarfBuzzFontData(WTF::HashMap<uint32_t, uint16_t>* glyphCacheForFaceCacheEntry)
- : m_glyphCacheForFaceCacheEntry(glyphCacheForFaceCacheEntry)
- { }
- SkPaint m_paint;
- WTF::HashMap<uint32_t, uint16_t>* m_glyphCacheForFaceCacheEntry;
-};
-
-static hb_position_t SkiaScalarToHarfBuzzPosition(SkScalar value)
-{
- return SkScalarToFixed(value);
-}
-
-static void SkiaGetGlyphWidthAndExtents(SkPaint* paint, hb_codepoint_t codepoint, hb_position_t* width, hb_glyph_extents_t* extents)
-{
- ASSERT(codepoint <= 0xFFFF);
- paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-
- SkScalar skWidth;
- SkRect skBounds;
- uint16_t glyph = codepoint;
-
- paint->getTextWidths(&glyph, sizeof(glyph), &skWidth, &skBounds);
- if (width)
- *width = SkiaScalarToHarfBuzzPosition(skWidth);
- if (extents) {
- // Invert y-axis because Skia is y-grows-down but we set up HarfBuzz to be y-grows-up.
- extents->x_bearing = SkiaScalarToHarfBuzzPosition(skBounds.fLeft);
- extents->y_bearing = SkiaScalarToHarfBuzzPosition(-skBounds.fTop);
- extents->width = SkiaScalarToHarfBuzzPosition(skBounds.width());
- extents->height = SkiaScalarToHarfBuzzPosition(-skBounds.height());
- }
-}
-
-static hb_bool_t harfBuzzGetGlyph(hb_font_t* hbFont, void* fontData, hb_codepoint_t unicode, hb_codepoint_t variationSelector, hb_codepoint_t* glyph, void* userData)
-{
- HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(fontData);
-
- WTF::HashMap<uint32_t, uint16_t>::AddResult result = hbFontData->m_glyphCacheForFaceCacheEntry->add(unicode, 0);
- if (result.isNewEntry) {
- SkPaint* paint = &hbFontData->m_paint;
- paint->setTextEncoding(SkPaint::kUTF32_TextEncoding);
- uint16_t glyph16;
- paint->textToGlyphs(&unicode, sizeof(hb_codepoint_t), &glyph16);
- result.iterator->value = glyph16;
- *glyph = glyph16;
- }
- *glyph = result.iterator->value;
- return !!*glyph;
-}
-
-static hb_position_t harfBuzzGetGlyphHorizontalAdvance(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, void* userData)
-{
- HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(fontData);
- hb_position_t advance = 0;
-
- SkiaGetGlyphWidthAndExtents(&hbFontData->m_paint, glyph, &advance, 0);
- return advance;
-}
-
-static hb_bool_t harfBuzzGetGlyphHorizontalOrigin(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, hb_position_t* x, hb_position_t* y, void* userData)
-{
- // Just return true, following the way that HarfBuzz-FreeType
- // implementation does.
- return true;
-}
-
-static hb_bool_t harfBuzzGetGlyphExtents(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, hb_glyph_extents_t* extents, void* userData)
-{
- HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(fontData);
-
- SkiaGetGlyphWidthAndExtents(&hbFontData->m_paint, glyph, 0, extents);
- return true;
-}
-
-static hb_font_funcs_t* harfBuzzSkiaGetFontFuncs()
-{
- static hb_font_funcs_t* harfBuzzSkiaFontFuncs = 0;
-
- // We don't set callback functions which we can't support.
- // HarfBuzz will use the fallback implementation if they aren't set.
- if (!harfBuzzSkiaFontFuncs) {
- harfBuzzSkiaFontFuncs = hb_font_funcs_create();
- hb_font_funcs_set_glyph_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyph, 0, 0);
- hb_font_funcs_set_glyph_h_advance_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyphHorizontalAdvance, 0, 0);
- hb_font_funcs_set_glyph_h_origin_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyphHorizontalOrigin, 0, 0);
- hb_font_funcs_set_glyph_extents_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyphExtents, 0, 0);
- hb_font_funcs_make_immutable(harfBuzzSkiaFontFuncs);
- }
- return harfBuzzSkiaFontFuncs;
-}
-
-static hb_blob_t* harfBuzzSkiaGetTable(hb_face_t* face, hb_tag_t tag, void* userData)
-{
- SkTypeface* typeface = reinterpret_cast<SkTypeface*>(userData);
-
- const size_t tableSize = typeface->getTableSize(tag);
- if (!tableSize)
- return 0;
-
- char* buffer = reinterpret_cast<char*>(fastMalloc(tableSize));
- if (!buffer)
- return 0;
- size_t actualSize = typeface->getTableData(tag, 0, tableSize, buffer);
- if (tableSize != actualSize) {
- fastFree(buffer);
- return 0;
- }
-
- return hb_blob_create(const_cast<char*>(buffer), tableSize, HB_MEMORY_MODE_WRITABLE, buffer, fastFree);
-}
-
-static void destroyHarfBuzzFontData(void* userData)
-{
- HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(userData);
- delete hbFontData;
-}
-
-hb_face_t* HarfBuzzFace::createFace()
-{
- hb_face_t* face = hb_face_create_for_tables(harfBuzzSkiaGetTable, m_platformData->typeface(), 0);
- ASSERT(face);
- return face;
-}
-
-hb_font_t* HarfBuzzFace::createFont()
-{
- HarfBuzzFontData* hbFontData = new HarfBuzzFontData(m_glyphCacheForFaceCacheEntry);
- m_platformData->setupPaint(&hbFontData->m_paint);
- hb_font_t* font = hb_font_create(m_face);
- hb_font_set_funcs(font, harfBuzzSkiaGetFontFuncs(), hbFontData, destroyHarfBuzzFontData);
- float size = m_platformData->size();
- int scale = SkiaScalarToHarfBuzzPosition(size);
- hb_font_set_scale(font, scale, scale);
- hb_font_make_immutable(font);
- return font;
-}
-
-GlyphBufferAdvance HarfBuzzShaper::createGlyphBufferAdvance(float width, float height)
-{
- return GlyphBufferAdvance(width, height);
-}
-
-} // namespace WebCore
Modified: trunk/Tools/ChangeLog (149346 => 149347)
--- trunk/Tools/ChangeLog 2013-04-30 01:47:26 UTC (rev 149346)
+++ trunk/Tools/ChangeLog 2013-04-30 01:59:59 UTC (rev 149347)
@@ -1,3 +1,17 @@
+2013-04-29 Alberto Garcia <[email protected]>
+
+ Remove all remaining Skia code
+ https://bugs.webkit.org/show_bug.cgi?id=115263
+
+ Reviewed by Benjamin Poulain.
+
+ Remove all remaining references to Skia.
+
+ * Scripts/webkitdirs.pm:
+ (blackberryCMakeArguments):
+ * Scripts/webkitpy/common/config/contributionareas.py:
+ * Scripts/webkitpy/common/config/watchlist:
+
2013-04-29 Seokju Kwon <[email protected]>
Get rid of unused options in Tools/Scripts/webkit-build-directory
Modified: trunk/Tools/Scripts/webkitdirs.pm (149346 => 149347)
--- trunk/Tools/Scripts/webkitdirs.pm 2013-04-30 01:47:26 UTC (rev 149346)
+++ trunk/Tools/Scripts/webkitdirs.pm 2013-04-30 01:59:59 UTC (rev 149347)
@@ -1031,8 +1031,6 @@
push @cmakeExtraOptions, "-DENABLE_GLES2=1" unless $ENV{"DISABLE_GLES2"};
my @includeSystemDirectories;
- push @includeSystemDirectories, File::Spec->catdir($stageInc, "grskia", "skia");
- push @includeSystemDirectories, File::Spec->catdir($stageInc, "grskia");
push @includeSystemDirectories, File::Spec->catdir($stageInc, "harfbuzz");
push @includeSystemDirectories, File::Spec->catdir($stageInc, "imf");
# We only use jpeg-turbo for device build
Modified: trunk/Tools/Scripts/webkitpy/common/config/contributionareas.py (149346 => 149347)
--- trunk/Tools/Scripts/webkitpy/common/config/contributionareas.py 2013-04-30 01:47:26 UTC (rev 149346)
+++ trunk/Tools/Scripts/webkitpy/common/config/contributionareas.py 2013-04-30 01:59:59 UTC (rev 149347)
@@ -131,7 +131,6 @@
_Area('Scrollbars', ['scroll']),
_Area('Security'), # Probably need more tokens
# FIXME: 'Shadow DOM'
- _Area('Skia'),
_Area('Soup Network Backend', ['soup']),
# FIXME: 'Spell Checking' just need tokens
_Area('Tables', ['htmltable', 'rendertable']),
Modified: trunk/Tools/Scripts/webkitpy/common/config/watchlist (149346 => 149347)
--- trunk/Tools/Scripts/webkitpy/common/config/watchlist 2013-04-30 01:47:26 UTC (rev 149346)
+++ trunk/Tools/Scripts/webkitpy/common/config/watchlist 2013-04-30 01:59:59 UTC (rev 149347)
@@ -52,10 +52,6 @@
"XSS": {
"filename": r".*XSS",
},
- "SkiaGraphics": {
- "filename": r"Source/WebCore/platform/graphics/skia/"
- r"|Source/WebCore/platform/graphics/filters/skia/",
- },
"FrameLoader": {
"more": r"FrameLoader\.(cpp|h)",
},
@@ -373,7 +369,6 @@
"SVG": ["[email protected]", "[email protected]", "[email protected]", "[email protected]" ],
"SVNScripts": [ "[email protected]" ],
"ScrollingCoordinator": [ "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]" ],
- "SkiaGraphics": [ "[email protected]", "[email protected]" ],
"Selectors": [ "[email protected]" ],
"SoupNetwork": [ "[email protected]", "[email protected]", "[email protected]", "[email protected]" ],
"TextureMapper" : [ "[email protected]", "[email protected]", "[email protected]" ],