gfx/skia/patches/archive/0001-Bug-687189-Implement-SkPaint-getPosTextPath.patch

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/patches/archive/0001-Bug-687189-Implement-SkPaint-getPosTextPath.patch	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,66 @@
     1.4 +From 27a914815e757ed12523edf968c9da134dabeaf8 Mon Sep 17 00:00:00 2001
     1.5 +From: George Wright <gwright@mozilla.com>
     1.6 +Date: Fri, 18 May 2012 14:10:44 -0400
     1.7 +Subject: [PATCH 01/10]     Bug 755869 - [4] Re-apply bug 687189 - Implement
     1.8 + SkPaint::getPosTextPath r=mattwoodrow
     1.9 +
    1.10 +---
    1.11 + gfx/skia/include/core/SkPaint.h |    3 +++
    1.12 + gfx/skia/src/core/SkPaint.cpp   |   27 +++++++++++++++++++++++++++
    1.13 + 2 files changed, 30 insertions(+), 0 deletions(-)
    1.14 +
    1.15 +diff --git a/gfx/skia/include/core/SkPaint.h b/gfx/skia/include/core/SkPaint.h
    1.16 +index 1930db1..ff37d77 100644
    1.17 +--- a/gfx/skia/include/core/SkPaint.h
    1.18 ++++ b/gfx/skia/include/core/SkPaint.h
    1.19 +@@ -813,6 +813,9 @@ public:
    1.20 +     void getTextPath(const void* text, size_t length, SkScalar x, SkScalar y,
    1.21 +                      SkPath* path) const;
    1.22 + 
    1.23 ++    void getPosTextPath(const void* text, size_t length, 
    1.24 ++                        const SkPoint pos[], SkPath* path) const;
    1.25 ++
    1.26 + #ifdef SK_BUILD_FOR_ANDROID
    1.27 +     const SkGlyph& getUnicharMetrics(SkUnichar);
    1.28 +     const SkGlyph& getGlyphMetrics(uint16_t);
    1.29 +diff --git a/gfx/skia/src/core/SkPaint.cpp b/gfx/skia/src/core/SkPaint.cpp
    1.30 +index 1b74fa1..4c119aa 100644
    1.31 +--- a/gfx/skia/src/core/SkPaint.cpp
    1.32 ++++ b/gfx/skia/src/core/SkPaint.cpp
    1.33 +@@ -1355,6 +1355,33 @@ void SkPaint::getTextPath(const void* textData, size_t length,
    1.34 +     }
    1.35 + }
    1.36 + 
    1.37 ++void SkPaint::getPosTextPath(const void* textData, size_t length,
    1.38 ++                             const SkPoint pos[], SkPath* path) const {
    1.39 ++    SkASSERT(length == 0 || textData != NULL);
    1.40 ++
    1.41 ++    const char* text = (const char*)textData;
    1.42 ++    if (text == NULL || length == 0 || path == NULL) {
    1.43 ++        return;
    1.44 ++    }
    1.45 ++
    1.46 ++    SkTextToPathIter    iter(text, length, *this, false);
    1.47 ++    SkMatrix            matrix;
    1.48 ++    SkPoint             prevPos;
    1.49 ++    prevPos.set(0, 0);
    1.50 ++
    1.51 ++    matrix.setScale(iter.getPathScale(), iter.getPathScale());
    1.52 ++    path->reset();
    1.53 ++
    1.54 ++    unsigned int    i = 0;
    1.55 ++    const SkPath*   iterPath;
    1.56 ++    while ((iterPath = iter.next(NULL)) != NULL) {
    1.57 ++        matrix.postTranslate(pos[i].fX - prevPos.fX, pos[i].fY - prevPos.fY);
    1.58 ++        path->addPath(*iterPath, matrix);
    1.59 ++        prevPos = pos[i];
    1.60 ++        i++;
    1.61 ++    }
    1.62 ++}
    1.63 ++
    1.64 + static void add_flattenable(SkDescriptor* desc, uint32_t tag,
    1.65 +                             SkFlattenableWriteBuffer* buffer) {
    1.66 +     buffer->flatten(desc->addEntry(tag, buffer->size(), NULL));
    1.67 +-- 
    1.68 +1.7.5.4
    1.69 +

mercurial