Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: include/core/SkPaint.h

Issue 2186663004: SkPaint intercept API for SkTextBlob and horizontal text (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: GM size, comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/texteffects.cpp ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkPaint_DEFINED 8 #ifndef SkPaint_DEFINED
9 #define SkPaint_DEFINED 9 #define SkPaint_DEFINED
10 10
(...skipping 15 matching lines...) Expand all
26 class SkGlyphCache; 26 class SkGlyphCache;
27 class SkImageFilter; 27 class SkImageFilter;
28 class SkMaskFilter; 28 class SkMaskFilter;
29 class SkPath; 29 class SkPath;
30 class SkPathEffect; 30 class SkPathEffect;
31 struct SkPoint; 31 struct SkPoint;
32 class SkRasterizer; 32 class SkRasterizer;
33 struct SkScalerContextEffects; 33 struct SkScalerContextEffects;
34 class SkShader; 34 class SkShader;
35 class SkSurfaceProps; 35 class SkSurfaceProps;
36 class SkTextBlob;
36 class SkTypeface; 37 class SkTypeface;
37 38
38 #define kBicubicFilterBitmap_Flag kHighQualityFilterBitmap_Flag 39 #define kBicubicFilterBitmap_Flag kHighQualityFilterBitmap_Flag
39 40
40 /** \class SkPaint 41 /** \class SkPaint
41 42
42 The SkPaint class holds the style and color information about how to draw 43 The SkPaint class holds the style and color information about how to draw
43 geometries, text and bitmaps. 44 geometries, text and bitmaps.
44 */ 45 */
45 class SK_API SkPaint { 46 class SK_API SkPaint {
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 * @param length number of bytes of text 958 * @param length number of bytes of text
958 * @param pos array of positions, used to position each character 959 * @param pos array of positions, used to position each character
959 * @param bounds The lower and upper line parallel to the advance. 960 * @param bounds The lower and upper line parallel to the advance.
960 * @param array If not null, the glyph bounds contained by the advan ce parallel lines. 961 * @param array If not null, the glyph bounds contained by the advan ce parallel lines.
961 * 962 *
962 * @return The number of intersections, which may be zero. 963 * @return The number of intersections, which may be zero.
963 */ 964 */
964 int getPosTextIntercepts(const void* text, size_t length, const SkPoint pos[ ], 965 int getPosTextIntercepts(const void* text, size_t length, const SkPoint pos[ ],
965 const SkScalar bounds[2], SkScalar* intervals) cons t; 966 const SkScalar bounds[2], SkScalar* intervals) cons t;
966 967
968 /** Return the number of intervals that intersect the intercept along the ax is of the advance.
969 * The return count is zero or a multiple of two, and is at most the number of glyphs * 2 in
970 * string. The caller may pass nullptr for intervals to determine the size of the interval
971 * array, or may conservatively pre-allocate an array with length * 2 entri es. The computed
972 * intervals are cached by glyph to improve performance for multiple calls.
973 * This permits constructing an underline that skips the descenders.
974 *
975 * @param text The text.
976 * @param length Number of bytes of text.
977 * @param xpos Array of x-positions, used to position each characte r.
978 * @param constY The shared Y coordinate for all of the positions.
979 * @param bounds The lower and upper line parallel to the advance.
980 * @param array If not null, the glyph bounds contained by the advan ce parallel lines.
981 *
982 * @return The number of intersections, which may be zero.
983 */
984 int getPosTextHIntercepts(const void* text, size_t length, const SkScalar xp os[],
985 SkScalar constY, const SkScalar bounds[2], SkScala r* intervals) const;
986
987 /** Return the number of intervals that intersect the intercept along the ax is of the advance.
988 * The return count is zero or a multiple of two, and is at most the number of glyphs * 2 in
989 * text blob. The caller may pass nullptr for intervals to determine the si ze of the interval
990 * array. The computed intervals are cached by glyph to improve performance for multiple calls.
991 * This permits constructing an underline that skips the descenders.
992 *
993 * @param blob The text blob.
994 * @param bounds The lower and upper line parallel to the advance.
995 * @param array If not null, the glyph bounds contained by the advan ce parallel lines.
996 *
997 * @return The number of intersections, which may be zero.
998 */
999 int getTextBlobIntercepts(const SkTextBlob* blob, const SkScalar bounds[2],
1000 SkScalar* intervals) const;
1001
967 /** 1002 /**
968 * Return a rectangle that represents the union of the bounds of all 1003 * Return a rectangle that represents the union of the bounds of all
969 * of the glyphs, but each one positioned at (0,0). This may be conservativ ely large, and 1004 * of the glyphs, but each one positioned at (0,0). This may be conservativ ely large, and
970 * will not take into account any hinting, but will respect any text-scale- x or text-skew-x 1005 * will not take into account any hinting, but will respect any text-scale- x or text-skew-x
971 * on this paint. 1006 * on this paint.
972 */ 1007 */
973 SkRect getFontBounds() const; 1008 SkRect getFontBounds() const;
974 1009
975 // returns true if the paint's settings (e.g. xfermode + alpha) resolve to 1010 // returns true if the paint's settings (e.g. xfermode + alpha) resolve to
976 // mean that we need not draw at all (e.g. SrcOver + 0-alpha) 1011 // mean that we need not draw at all (e.g. SrcOver + 0-alpha)
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 friend class GrStencilAndCoverTextContext; 1209 friend class GrStencilAndCoverTextContext;
1175 friend class GrPathRendering; 1210 friend class GrPathRendering;
1176 friend class GrTextUtils; 1211 friend class GrTextUtils;
1177 friend class GrGLPathRendering; 1212 friend class GrGLPathRendering;
1178 friend class SkScalerContext; 1213 friend class SkScalerContext;
1179 friend class SkTextBaseIter; 1214 friend class SkTextBaseIter;
1180 friend class SkCanonicalizePaint; 1215 friend class SkCanonicalizePaint;
1181 }; 1216 };
1182 1217
1183 #endif 1218 #endif
OLDNEW
« no previous file with comments | « gm/texteffects.cpp ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698