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

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

Issue 804903006: add paint::getFontBounds() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/fontmgr.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 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 /** Return the path (outline) for the specified text. 914 /** Return the path (outline) for the specified text.
915 Note: just like SkCanvas::drawText, this will respect the Align setting 915 Note: just like SkCanvas::drawText, this will respect the Align setting
916 in the paint. 916 in the paint.
917 */ 917 */
918 void getTextPath(const void* text, size_t length, SkScalar x, SkScalar y, 918 void getTextPath(const void* text, size_t length, SkScalar x, SkScalar y,
919 SkPath* path) const; 919 SkPath* path) const;
920 920
921 void getPosTextPath(const void* text, size_t length, 921 void getPosTextPath(const void* text, size_t length,
922 const SkPoint pos[], SkPath* path) const; 922 const SkPoint pos[], SkPath* path) const;
923 923
924 /**
925 * Return a rectangle that represents the union of the bounds of all
926 * of the glyphs, but each one positioned at (0,0). This may be conservativ ely large, and
927 * will not take into account any hinting, but will respect any text-scale- x or text-skew-x
928 * on this paint.
929 */
930 SkRect getFontBounds() const;
931
924 // returns true if the paint's settings (e.g. xfermode + alpha) resolve to 932 // returns true if the paint's settings (e.g. xfermode + alpha) resolve to
925 // mean that we need not draw at all (e.g. SrcOver + 0-alpha) 933 // mean that we need not draw at all (e.g. SrcOver + 0-alpha)
926 bool nothingToDraw() const; 934 bool nothingToDraw() const;
927 935
928 /////////////////////////////////////////////////////////////////////////// 936 ///////////////////////////////////////////////////////////////////////////
929 // would prefer to make these private... 937 // would prefer to make these private...
930 938
931 /** Returns true if the current paint settings allow for fast computation of 939 /** Returns true if the current paint settings allow for fast computation of
932 bounds (i.e. there is nothing complex like a patheffect that would make 940 bounds (i.e. there is nothing complex like a patheffect that would make
933 the bounds computation expensive. 941 the bounds computation expensive.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 friend class GrBitmapTextContext; 1108 friend class GrBitmapTextContext;
1101 friend class GrDistanceFieldTextContext; 1109 friend class GrDistanceFieldTextContext;
1102 friend class GrStencilAndCoverTextContext; 1110 friend class GrStencilAndCoverTextContext;
1103 friend class GrPathRendering; 1111 friend class GrPathRendering;
1104 friend class GrGLPathRendering; 1112 friend class GrGLPathRendering;
1105 friend class SkTextToPathIter; 1113 friend class SkTextToPathIter;
1106 friend class SkCanonicalizePaint; 1114 friend class SkCanonicalizePaint;
1107 }; 1115 };
1108 1116
1109 #endif 1117 #endif
OLDNEW
« no previous file with comments | « gm/fontmgr.cpp ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698