Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af1653a8 authored by Victoria Lease's avatar Victoria Lease
Browse files

resolved conflicts for merge of 6c18e2c8 to master

Change-Id: Idb4679247b201a1f453c63fee5b45b12b03a67a1
parents a38006d7 6c18e2c8
Loading
Loading
Loading
Loading
+9 −19
Original line number Original line Diff line number Diff line
@@ -338,23 +338,11 @@ uint32_t TextLayoutValue::getElapsedTime() {
}
}


TextLayoutShaper::TextLayoutShaper() {
TextLayoutShaper::TextLayoutShaper() {
    init();

    mBuffer = hb_buffer_create();
    mBuffer = hb_buffer_create();
}
}


void TextLayoutShaper::init() {
    mDefaultTypeface = SkTypeface::CreateFromName(NULL, SkTypeface::kNormal);
}

void TextLayoutShaper::unrefTypefaces() {
    SkSafeUnref(mDefaultTypeface);
}

TextLayoutShaper::~TextLayoutShaper() {
TextLayoutShaper::~TextLayoutShaper() {
    hb_buffer_destroy(mBuffer);
    hb_buffer_destroy(mBuffer);

    unrefTypefaces();
}
}


void TextLayoutShaper::computeValues(TextLayoutValue* value, const SkPaint* paint, const UChar* chars,
void TextLayoutShaper::computeValues(TextLayoutValue* value, const SkPaint* paint, const UChar* chars,
@@ -838,24 +826,28 @@ size_t TextLayoutShaper::shapeFontRun(const SkPaint* paint) {
    }
    }


    if (baseGlyphCount != 0) {
    if (baseGlyphCount != 0) {
        SkTypeface::Style style = SkTypeface::kNormal;
        if (typeface != NULL) {
            style = typeface->style();
        }
        typeface = typefaceForScript(paint, typeface, hb_buffer_get_script(mBuffer));
        typeface = typefaceForScript(paint, typeface, hb_buffer_get_script(mBuffer));
        if (!typeface) {
        if (!typeface) {
            baseGlyphCount = 0;
            baseGlyphCount = 0;
            typeface = mDefaultTypeface;
            typeface = SkTypeface::CreateFromName(NULL, style);
            SkSafeRef(typeface);
#if DEBUG_GLYPHS
#if DEBUG_GLYPHS
            ALOGD("Using Default Typeface");
            ALOGD("Using Default Typeface");
#endif
#endif
        }
        }
    } else {
    } else {
        if (!typeface) {
        if (!typeface) {
            typeface = mDefaultTypeface;
            typeface = SkTypeface::CreateFromName(NULL, SkTypeface::kNormal);
#if DEBUG_GLYPHS
#if DEBUG_GLYPHS
            ALOGD("Using Default Typeface");
            ALOGD("Using Default Typeface (normal style)");
#endif
#endif
        }
        } else {
            SkSafeRef(typeface);
            SkSafeRef(typeface);
        }
        }
    }


    mShapingPaint.setTypeface(typeface);
    mShapingPaint.setTypeface(typeface);
    hb_face_t* face = referenceCachedHBFace(typeface);
    hb_face_t* face = referenceCachedHBFace(typeface);
@@ -898,8 +890,6 @@ void TextLayoutShaper::purgeCaches() {
        hb_face_destroy(mCachedHBFaces.valueAt(i));
        hb_face_destroy(mCachedHBFaces.valueAt(i));
    }
    }
    mCachedHBFaces.clear();
    mCachedHBFaces.clear();
    unrefTypefaces();
    init();
}
}


TextLayoutEngine::TextLayoutEngine() {
TextLayoutEngine::TextLayoutEngine() {
+0 −9
Original line number Original line Diff line number Diff line
@@ -196,19 +196,11 @@ private:
     */
     */
    SkPaint mShapingPaint;
    SkPaint mShapingPaint;


    /**
     * Skia default typeface to be returned if we cannot resolve script
     */
    SkTypeface* mDefaultTypeface;

    /**
    /**
     * Cache of Harfbuzz faces
     * Cache of Harfbuzz faces
     */
     */
    KeyedVector<SkFontID, hb_face_t*> mCachedHBFaces;
    KeyedVector<SkFontID, hb_face_t*> mCachedHBFaces;


    void init();
    void unrefTypefaces();

    SkTypeface* typefaceForScript(const SkPaint* paint, SkTypeface* typeface,
    SkTypeface* typefaceForScript(const SkPaint* paint, SkTypeface* typeface,
        hb_script_t script);
        hb_script_t script);


@@ -228,7 +220,6 @@ private:
    hb_face_t* referenceCachedHBFace(SkTypeface* typeface);
    hb_face_t* referenceCachedHBFace(SkTypeface* typeface);


    bool isComplexScript(hb_script_t script);
    bool isComplexScript(hb_script_t script);

}; // TextLayoutShaper
}; // TextLayoutShaper


/**
/**