diff options
Diffstat (limited to 'Source')
9 files changed, 20 insertions, 97 deletions
diff --git a/Source/JavaScriptCore/wtf/Platform.h b/Source/JavaScriptCore/wtf/Platform.h index 5ac08d1..41850ee 100644 --- a/Source/JavaScriptCore/wtf/Platform.h +++ b/Source/JavaScriptCore/wtf/Platform.h @@ -780,8 +780,6 @@ #define ANDROID_ANIMATED_GIF // apple-touch-icon support in <link> tags #define ANDROID_APPLE_TOUCH_ICON -// track changes to the style that may change what is drawn -#define ANDROID_STYLE_VERSION // This is present in JavaScriptCore/config.h, which Android does not use. #define WTF_CHANGES 1 diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp index b6a1393..96be3fb 100644 --- a/Source/WebCore/dom/Document.cpp +++ b/Source/WebCore/dom/Document.cpp @@ -387,9 +387,6 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML) , m_compatibilityMode(NoQuirksMode) , m_compatibilityModeLocked(false) , m_domTreeVersion(++s_globalTreeVersion) -#ifdef ANDROID_STYLE_VERSION - , m_styleVersion(0) -#endif , m_styleSheets(StyleSheetList::create(this)) , m_readyState(Complete) , m_styleRecalcTimer(this, &Document::styleRecalcTimerFired) diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h index ce82b2e..c4ccb9c 100644 --- a/Source/WebCore/dom/Document.h +++ b/Source/WebCore/dom/Document.h @@ -905,11 +905,6 @@ public: void incDOMTreeVersion() { m_domTreeVersion = ++s_globalTreeVersion; } uint64_t domTreeVersion() const { return m_domTreeVersion; } -#ifdef ANDROID_STYLE_VERSION - void incStyleVersion() { ++m_styleVersion; } - unsigned styleVersion() const { return m_styleVersion; } -#endif - void setDocType(PassRefPtr<DocumentType>); #if ENABLE(XPATH) @@ -1223,9 +1218,6 @@ private: uint64_t m_domTreeVersion; static uint64_t s_globalTreeVersion; -#ifdef ANDROID_STYLE_VERSION - unsigned m_styleVersion; -#endif HashSet<NodeIterator*> m_nodeIterators; HashSet<Range*> m_ranges; diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp index 64d3eed..5fb6cdc 100644 --- a/Source/WebCore/dom/Element.cpp +++ b/Source/WebCore/dom/Element.cpp @@ -1069,21 +1069,6 @@ bool Element::pseudoStyleCacheIsInvalid(const RenderStyle* currentStyle, RenderS return false; } -#ifdef ANDROID_STYLE_VERSION -static bool displayDiff(const RenderStyle* s1, const RenderStyle* s2) -{ - if (!s1 && !s2) - return false; - else if ((!s1 && s2) || (s1 && !s2)) - return true; - - return s1->display() != s2->display() - || s1->left() != s2->left() || s1->top() != s2->top() - || s1->right() != s2->right() || s1->bottom() != s2->bottom() - || s1->width() != s2->width() || s1->height() != s2->height(); -} -#endif - void Element::recalcStyle(StyleChange change) { // Ref currentStyle in case it would otherwise be deleted when setRenderStyle() is called. @@ -1092,11 +1077,6 @@ void Element::recalcStyle(StyleChange change) bool hasDirectAdjacentRules = currentStyle && currentStyle->childrenAffectedByDirectAdjacentRules(); if ((change > NoChange || needsStyleRecalc())) { -#ifdef ANDROID_STYLE_VERSION - RefPtr<RenderStyle> newStyle = document()->styleForElementIgnoringPendingStylesheets(this); - if (displayDiff(currentStyle.get(), newStyle.get())) - document()->incStyleVersion(); -#endif if (hasRareData()) rareData()->resetComputedStyle(); } diff --git a/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp b/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp index 869c7b6..d59674b 100644 --- a/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp @@ -463,8 +463,7 @@ public: private: void setupFontForScriptRun(); - const FontPlatformData* setupComplexFont(FallbackScripts script, - const FontPlatformData& platformData); + const FontPlatformData* setupComplexFont(HB_Script script, const FontPlatformData& platformData); HB_FontRec* allocHarfbuzzFont(); void deleteGlyphArrays(); void createGlyphArrays(int); @@ -660,8 +659,7 @@ void TextRunWalker::setWordAndLetterSpacing(int wordSpacingAdjustment, } const FontPlatformData* TextRunWalker::setupComplexFont( - FallbackScripts script, - const FontPlatformData& platformData) + HB_Script script, const FontPlatformData& platformData) { static FallbackHash fallbackPlatformData; @@ -671,15 +669,19 @@ const FontPlatformData* TextRunWalker::setupComplexFont( // italic, then bold italic. additional fake style bits can be added. int scriptStyleIndex = script; if (platformData.isFakeBold()) - scriptStyleIndex += kFallbackScriptNumber; + scriptStyleIndex += HB_ScriptCount; if (platformData.isFakeItalic()) - scriptStyleIndex += kFallbackScriptNumber << 1; + scriptStyleIndex += HB_ScriptCount << 1; FallbackFontKey key(scriptStyleIndex, platformData.size()); FontPlatformData* newPlatformData = 0; if (!fallbackPlatformData.contains(key)) { - SkTypeface* typeface = SkCreateTypefaceForScript(script); + SkTypeface::Style currentStyle = SkTypeface::kNormal; + if (platformData.typeface()) + currentStyle = platformData.typeface()->style(); + SkTypeface* typeface = SkCreateTypefaceForScript(script, currentStyle, + SkPaint::kElegant_Variant); newPlatformData = new FontPlatformData(platformData, typeface); SkSafeUnref(typeface); fallbackPlatformData.set(key, newPlatformData); @@ -697,61 +699,8 @@ void TextRunWalker::setupFontForScriptRun() const FontData* fontData = m_font->glyphDataForCharacter(m_run[0], false).fontData; const FontPlatformData& platformData = fontData->fontDataForCharacter(' ')->platformData(); - const FontPlatformData* complexPlatformData = &platformData; - - switch (m_item.item.script) { - case HB_Script_Bengali: - complexPlatformData = setupComplexFont(kBengali_FallbackScript, platformData); - break; - case HB_Script_Devanagari: - complexPlatformData = setupComplexFont(kDevanagari_FallbackScript, platformData); - break; - case HB_Script_Hebrew: - switch (platformData.typeface()->style()) { - case SkTypeface::kBold: - case SkTypeface::kBoldItalic: - complexPlatformData = setupComplexFont(kHebrewBold_FallbackScript, platformData); - break; - case SkTypeface::kNormal: - case SkTypeface::kItalic: - default: - complexPlatformData = setupComplexFont(kHebrewRegular_FallbackScript, platformData); - break; - } - break; - case HB_Script_Kannada: - complexPlatformData = setupComplexFont(kKannada_FallbackScript, platformData); - break; - case HB_Script_Malayalam: - complexPlatformData = setupComplexFont(kMalayalam_FallbackScript, platformData); - break; - case HB_Script_Arabic: - complexPlatformData = setupComplexFont(kArabic_FallbackScript, platformData); - break; - case HB_Script_Tamil: - switch (platformData.typeface()->style()) { - case SkTypeface::kBold: - case SkTypeface::kBoldItalic: - complexPlatformData = setupComplexFont(kTamilBold_FallbackScript, platformData); - break; - case SkTypeface::kNormal: - case SkTypeface::kItalic: - default: - complexPlatformData = setupComplexFont(kTamilRegular_FallbackScript, platformData); - break; - } - break; - case HB_Script_Telugu: - complexPlatformData = setupComplexFont(kTelugu_FallbackScript, platformData); - break; - case HB_Script_Thai: - complexPlatformData = setupComplexFont(kThai_FallbackScript, platformData); - break; - default: - // HB_Script_Common; includes Ethiopic - complexPlatformData = &platformData; - break; - } + const FontPlatformData* complexPlatformData = setupComplexFont(m_item.item.script, platformData); + m_item.face = complexPlatformData->harfbuzzFace(); m_item.font->userData = const_cast<FontPlatformData*>(complexPlatformData); diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp index dde7e9b..438d96c 100644 --- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp @@ -289,6 +289,9 @@ void LayerAndroid::addDirtyArea() IntRect dirtyArea(area.x(), area.y(), area.width(), area.height()); state()->addDirtyArea(dirtyArea); + + for (int i = 0; i < countChildren(); i++) + getChild(i)->addDirtyArea(); } void LayerAndroid::addAnimation(PassRefPtr<AndroidAnimation> prpAnim) diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h index 312ad7b..b28daef 100644 --- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h @@ -273,7 +273,9 @@ public: void setIntrinsicallyComposited(bool intCom) { m_intrinsicallyComposited = intCom; } virtual bool needsIsolatedSurface() { - return (needsTexture() && m_intrinsicallyComposited) || m_animations.size(); + return (needsTexture() && m_intrinsicallyComposited) + || m_animations.size() + || m_imageCRC; } int setHwAccelerated(bool hwAccelerated); diff --git a/Source/WebCore/platform/graphics/android/layers/MediaLayer.h b/Source/WebCore/platform/graphics/android/layers/MediaLayer.h index 2f39d74..8e04681 100644 --- a/Source/WebCore/platform/graphics/android/layers/MediaLayer.h +++ b/Source/WebCore/platform/graphics/android/layers/MediaLayer.h @@ -39,6 +39,7 @@ public: virtual bool drawGL(bool layerTilesDisabled); virtual void paintBitmapGL() const { }; virtual bool needsTexture() { return false; } + virtual bool needsIsolatedSurface() { return true; } virtual bool isMedia() const { return true; } virtual LayerAndroid* copy() const { return new MediaLayer(*this); } diff --git a/Source/WebCore/platform/graphics/android/layers/VideoLayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/VideoLayerAndroid.h index dd88a85..5ebf615 100644 --- a/Source/WebCore/platform/graphics/android/layers/VideoLayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/layers/VideoLayerAndroid.h @@ -55,9 +55,10 @@ public: virtual bool isVideo() const { return true; } virtual LayerAndroid* copy() const { return new VideoLayerAndroid(*this); } - // The following 3 functions are called in UI thread only. + // The following functions are called in UI thread only. virtual bool drawGL(bool layerTilesDisabled); void setSurfaceTexture(sp<SurfaceTexture> texture, int textureName, PlayerState playerState); + virtual bool needsIsolatedSurface() { return true; } private: void init(); |