diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-13 15:22:15 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-13 15:22:15 +0000 |
commit | 5308c83a366f965c308862bed1b6acf594af3df9 (patch) | |
tree | b6b8947d87792731d7abb96422bdcbe11ccdc635 | |
parent | b5d887eebc39977ea1d69c6fa3053f386e03b764 (diff) |
drawPosTextOnPath is now deprecated, removing all overrides and impls
BUG=
R=djsollen@google.com
Review URL: https://codereview.chromium.org/61743017
git-svn-id: http://skia.googlecode.com/svn/trunk@12270 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | experimental/PdfViewer/SkTrackDevice.h | 9 | ||||
-rw-r--r-- | include/core/SkBitmapDevice.h | 5 | ||||
-rw-r--r-- | include/core/SkCanvas.h | 15 | ||||
-rw-r--r-- | include/core/SkDevice.h | 10 | ||||
-rw-r--r-- | include/core/SkDraw.h | 5 | ||||
-rw-r--r-- | src/core/SkBitmapDevice.cpp | 8 | ||||
-rw-r--r-- | src/core/SkCanvas.cpp | 17 | ||||
-rw-r--r-- | src/core/SkDraw.cpp | 63 | ||||
-rw-r--r-- | src/utils/SkDeferredCanvas.cpp | 8 |
9 files changed, 5 insertions, 135 deletions
diff --git a/experimental/PdfViewer/SkTrackDevice.h b/experimental/PdfViewer/SkTrackDevice.h index 6018fcd30c..a4f40bc578 100644 --- a/experimental/PdfViewer/SkTrackDevice.h +++ b/experimental/PdfViewer/SkTrackDevice.h @@ -148,15 +148,6 @@ protected: after(); } -#ifdef SK_BUILD_FOR_ANDROID - virtual void drawPosTextOnPath(const SkDraw& draw, const void* text, size_t len, - const SkPoint pos[], const SkPaint& paint, - const SkPath& path, const SkMatrix* matrix) { - before(); - INHERITED::drawPosTextOnPath(draw, text, len, pos, paint, path, matrix); - after(); - } -#endif virtual void drawVertices(const SkDraw& dummy1, SkCanvas::VertexMode dummy2, int vertexCount, const SkPoint verts[], const SkPoint texs[], const SkColor colors[], SkXfermode* xmode, diff --git a/include/core/SkBitmapDevice.h b/include/core/SkBitmapDevice.h index 530b85c9f8..691202004e 100644 --- a/include/core/SkBitmapDevice.h +++ b/include/core/SkBitmapDevice.h @@ -184,11 +184,6 @@ protected: virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, const SkPath& path, const SkMatrix* matrix, const SkPaint& paint) SK_OVERRIDE; -#ifdef SK_BUILD_FOR_ANDROID - virtual void drawPosTextOnPath(const SkDraw& draw, const void* text, size_t len, - const SkPoint pos[], const SkPaint& paint, - const SkPath& path, const SkMatrix* matrix) SK_OVERRIDE; -#endif virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCount, const SkPoint verts[], const SkPoint texs[], const SkColor colors[], SkXfermode* xmode, diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index d0b8fc94be..c963edcecc 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -811,21 +811,6 @@ public: const SkPath& path, const SkMatrix* matrix, const SkPaint& paint); -#ifdef SK_BUILD_FOR_ANDROID - /** Draw the text on path, with each character/glyph origin specified by the pos[] - array. The origin is interpreted by the Align setting in the paint. - @param text The text to be drawn - @param byteLength The number of bytes to read from the text parameter - @param pos Array of positions, used to position each character - @param paint The paint used for the text (e.g. color, size, style) - @param path The path to draw on - @param matrix The canvas matrix - */ - void drawPosTextOnPath(const void* text, size_t byteLength, - const SkPoint pos[], const SkPaint& paint, - const SkPath& path, const SkMatrix* matrix); -#endif - /** Draw the picture into this canvas. This method effective brackets the playback of the picture's draw calls with save/restore, so the state of this canvas will be unchanged after this call. diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h index 22a56d007d..8dce0a49e5 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -267,11 +267,6 @@ protected: virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, const SkPath& path, const SkMatrix* matrix, const SkPaint& paint) = 0; -#ifdef SK_BUILD_FOR_ANDROID - virtual void drawPosTextOnPath(const SkDraw& draw, const void* text, size_t len, - const SkPoint pos[], const SkPaint& paint, - const SkPath& path, const SkMatrix* matrix) = 0; -#endif virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCount, const SkPoint verts[], const SkPoint texs[], const SkColor colors[], SkXfermode* xmode, @@ -283,6 +278,11 @@ protected: virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, const SkPaint&) = 0; + // DEPRECATED -- will remove this once the subclass stop overriding it + virtual void drawPosTextOnPath(const SkDraw&, const void* text, size_t len, + const SkPoint pos[], const SkPaint&, + const SkPath&, const SkMatrix*) {} + /** * On success (returns true), copy the device pixels into the bitmap. * On failure, the bitmap parameter is left unchanged and false is diff --git a/include/core/SkDraw.h b/include/core/SkDraw.h index f7ae1c6208..8ccb1c0116 100644 --- a/include/core/SkDraw.h +++ b/include/core/SkDraw.h @@ -63,11 +63,6 @@ public: int scalarsPerPosition, const SkPaint& paint) const; void drawTextOnPath(const char text[], size_t byteLength, const SkPath&, const SkMatrix*, const SkPaint&) const; -#ifdef SK_BUILD_FOR_ANDROID - void drawPosTextOnPath(const char text[], size_t byteLength, - const SkPoint pos[], const SkPaint& paint, - const SkPath& path, const SkMatrix* matrix) const; -#endif void drawVertices(SkCanvas::VertexMode mode, int count, const SkPoint vertices[], const SkPoint textures[], const SkColor colors[], SkXfermode* xmode, diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp index 637048742a..7731a920dc 100644 --- a/src/core/SkBitmapDevice.cpp +++ b/src/core/SkBitmapDevice.cpp @@ -366,14 +366,6 @@ void SkBitmapDevice::drawTextOnPath(const SkDraw& draw, const void* text, draw.drawTextOnPath((const char*)text, len, path, matrix, paint); } -#ifdef SK_BUILD_FOR_ANDROID -void SkBitmapDevice::drawPosTextOnPath(const SkDraw& draw, const void* text, size_t len, - const SkPoint pos[], const SkPaint& paint, - const SkPath& path, const SkMatrix* matrix) { - draw.drawPosTextOnPath((const char*)text, len, pos, paint, path, matrix); -} -#endif - void SkBitmapDevice::drawVertices(const SkDraw& draw, SkCanvas::VertexMode vmode, int vertexCount, const SkPoint verts[], const SkPoint textures[], diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 32a6e09ba8..2efea724da 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -2030,23 +2030,6 @@ void SkCanvas::drawTextOnPath(const void* text, size_t byteLength, LOOPER_END } -#ifdef SK_BUILD_FOR_ANDROID -void SkCanvas::drawPosTextOnPath(const void* text, size_t byteLength, - const SkPoint pos[], const SkPaint& paint, - const SkPath& path, const SkMatrix* matrix) { - CHECK_SHADER_NOSETCONTEXT(paint); - - LOOPER_BEGIN(paint, SkDrawFilter::kText_Type) - - while (iter.next()) { - iter.fDevice->drawPosTextOnPath(iter, text, byteLength, pos, - looper.paint(), path, matrix); - } - - LOOPER_END -} -#endif - void SkCanvas::drawVertices(VertexMode vmode, int vertexCount, const SkPoint verts[], const SkPoint texs[], const SkColor colors[], SkXfermode* xmode, diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index afbb288909..112451920f 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -2279,69 +2279,6 @@ void SkDraw::drawTextOnPath(const char text[], size_t byteLength, } } -#ifdef SK_BUILD_FOR_ANDROID -void SkDraw::drawPosTextOnPath(const char text[], size_t byteLength, - const SkPoint pos[], const SkPaint& paint, - const SkPath& path, const SkMatrix* matrix) const { - // nothing to draw - if (text == NULL || byteLength == 0 || fRC->isEmpty()) { - return; - } - - SkMatrix scaledMatrix; - SkPathMeasure meas(path, false); - - SkMeasureCacheProc glyphCacheProc = paint.getMeasureCacheProc( - SkPaint::kForward_TextBufferDirection, true); - - // Copied (modified) from SkTextToPathIter constructor to setup paint - SkPaint tempPaint(paint); - - tempPaint.setLinearText(true); - tempPaint.setMaskFilter(NULL); // don't want this affecting our path-cache lookup - - if (tempPaint.getPathEffect() == NULL && !(tempPaint.getStrokeWidth() > 0 - && tempPaint.getStyle() != SkPaint::kFill_Style)) { - tempPaint.setStyle(SkPaint::kFill_Style); - tempPaint.setPathEffect(NULL); - } - // End copied from SkTextToPathIter constructor - - // detach cache - SkGlyphCache* cache = tempPaint.detachCache(NULL, NULL); - - // Must set scale, even if 1 - SkScalar scale = SK_Scalar1; - scaledMatrix.setScale(scale, scale); - - // Loop over all glyph ids - for (const char* stop = text + byteLength; text < stop; pos++) { - - const SkGlyph& glyph = glyphCacheProc(cache, &text); - SkPath tmp; - - const SkPath* glyphPath = cache->findPath(glyph); - if (glyphPath == NULL) { - continue; - } - - SkMatrix m(scaledMatrix); - m.postTranslate(pos->fX, 0); - - if (matrix) { - m.postConcat(*matrix); - } - - morphpath(&tmp, *glyphPath, meas, m); - this->drawPath(tmp, tempPaint); - - } - - // re-attach cache - SkGlyphCache::AttachCache(cache); -} -#endif - /////////////////////////////////////////////////////////////////////////////// struct VertState { diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index b94b2feac4..27627ab82e 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -224,14 +224,6 @@ protected: const SkMatrix* matrix, const SkPaint& paint) SK_OVERRIDE {SkASSERT(0);} -#ifdef SK_BUILD_FOR_ANDROID - virtual void drawPosTextOnPath(const SkDraw& draw, const void* text, - size_t len, const SkPoint pos[], - const SkPaint& paint, - const SkPath& path, - const SkMatrix* matrix) SK_OVERRIDE - {SkASSERT(0);} -#endif virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCount, const SkPoint verts[], const SkPoint texs[], const SkColor colors[], |