Logo Search packages:      
Sourcecode: chromium-browser version File versions  Download package

SkPaint Class Reference

#include <SkPaint.h>

List of all members.

Detailed Description

The SkPaint class holds the style and color information about how to draw geometries, text and bitmaps.

Definition at line 51 of file SkPaint.h.

Public Types

enum  Align { kLeft_Align, kCenter_Align, kRight_Align, kAlignCount }
enum  Cap {
  kButt_Cap, kRound_Cap, kSquare_Cap, kCapCount,
  kDefault_Cap = kButt_Cap
enum  Flags {
  kAntiAlias_Flag = 0x01, kFilterBitmap_Flag = 0x02, kDither_Flag = 0x04, kUnderlineText_Flag = 0x08,
  kStrikeThruText_Flag = 0x10, kFakeBoldText_Flag = 0x20, kLinearText_Flag = 0x40, kSubpixelText_Flag = 0x80,
  kDevKernText_Flag = 0x100, kLCDRenderText_Flag = 0x200, kEmbeddedBitmapText_Flag = 0x400, kAllFlags = 0x7FF
enum  Hinting { kNo_Hinting = 0, kSlight_Hinting = 1, kNormal_Hinting = 2, kFull_Hinting = 3 }
enum  Join {
  kMiter_Join, kRound_Join, kBevel_Join, kJoinCount,
  kDefault_Join = kMiter_Join
enum  Style { kFill_Style, kStroke_Style, kStrokeAndFill_Style, kStyleCount }
enum  TextBufferDirection { kForward_TextBufferDirection, kBackward_TextBufferDirection }
enum  TextEncoding { kUTF8_TextEncoding, kUTF16_TextEncoding, kGlyphID_TextEncoding }

Public Member Functions

size_t breakText (const void *text, size_t length, SkScalar maxWidth, SkScalar *measuredWidth=NULL, TextBufferDirection tbd=kForward_TextBufferDirection) const
bool canComputeFastBounds () const
const SkRect & computeFastBounds (const SkRect &orig, SkRect *storage) const
bool containsText (const void *text, size_t byteLength) const
int countText (const void *text, size_t byteLength) const
void flatten (SkFlattenableWriteBuffer &) const
uint8_t getAlpha () const
SkColor getColor () const
SkColorFilter * getColorFilter () const
bool getFillPath (const SkPath &src, SkPath *dst) const
uint32_t getFlags () const
SkScalar getFontMetrics (FontMetrics *metrics, SkScalar scale=0) const
SkScalar getFontSpacing () const
Hinting getHinting () const
SkDrawLoopergetLooper () const
SkMaskFiltergetMaskFilter () const
SkPathEffectgetPathEffect () const
SkRasterizer * getRasterizer () const
SkShadergetShader () const
Cap getStrokeCap () const
Join getStrokeJoin () const
SkScalar getStrokeMiter () const
SkScalar getStrokeWidth () const
Style getStyle () const
Align getTextAlign () const
TextEncoding getTextEncoding () const
void getTextPath (const void *text, size_t length, SkScalar x, SkScalar y, SkPath *path) const
SkScalar getTextScaleX () const
SkScalar getTextSize () const
SkScalar getTextSkewX () const
int getTextWidths (const void *text, size_t byteLength, SkScalar widths[], SkRect bounds[]=NULL) const
SkTypefacegetTypeface () const
SkXfermodegetXfermode () const
void glyphsToUnichars (const uint16_t glyphs[], int count, SkUnichar text[]) const
bool isAntiAlias () const
bool isDevKernText () const
bool isDither () const
bool isEmbeddedBitmapText () const
bool isFakeBoldText () const
bool isFilterBitmap () const
bool isLCDRenderText () const
bool isLinearText () const
bool isStrikeThruText () const
bool isSubpixelText () const
bool isUnderlineText () const
SkScalar measureText (const void *text, size_t length) const
SkScalar measureText (const void *text, size_t length, SkRect *bounds, SkScalar scale=0) const
SkPaintoperator= (const SkPaint &)
void reset ()
void setAlpha (U8CPU a)
void setAntiAlias (bool aa)
void setARGB (U8CPU a, U8CPU r, U8CPU g, U8CPU b)
void setColor (SkColor color)
SkColorFilter * setColorFilter (SkColorFilter *filter)
void setDevKernText (bool devKernText)
void setDither (bool dither)
void setEmbeddedBitmapText (bool useEmbeddedBitmapText)
void setFakeBoldText (bool fakeBoldText)
void setFilterBitmap (bool filterBitmap)
void setFlags (uint32_t flags)
void setHinting (Hinting hintingLevel)
void setLCDRenderText (bool subpixelRender)
void setLinearText (bool linearText)
SkDrawLoopersetLooper (SkDrawLooper *)
SkMaskFiltersetMaskFilter (SkMaskFilter *maskfilter)
SkPathEffectsetPathEffect (SkPathEffect *effect)
SkRasterizer * setRasterizer (SkRasterizer *rasterizer)
SkShadersetShader (SkShader *shader)
void setStrikeThruText (bool strikeThruText)
void setStrokeCap (Cap cap)
void setStrokeJoin (Join join)
void setStrokeMiter (SkScalar miter)
void setStrokeWidth (SkScalar width)
void setStyle (Style style)
void setSubpixelText (bool subpixelText)
void setTextAlign (Align align)
void setTextEncoding (TextEncoding encoding)
void setTextScaleX (SkScalar scaleX)
void setTextSize (SkScalar textSize)
void setTextSkewX (SkScalar skewX)
SkTypefacesetTypeface (SkTypeface *typeface)
void setUnderlineText (bool underlineText)
SkXfermodesetXfermode (SkXfermode *xfermode)
SkXfermodesetXfermodeMode (SkXfermode::Mode)
 SkPaint (const SkPaint &paint)
int textToGlyphs (const void *text, size_t byteLength, uint16_t glyphs[]) const
void unflatten (SkFlattenableReadBuffer &)

Private Types

enum  { kCanonicalTextSizeForPaths = 64 }

Private Member Functions

const SkRect & computeStrokeFastBounds (const SkRect &orig, SkRect *storage) const
void descriptorProc (const SkMatrix *deviceMatrix, void(*proc)(const SkDescriptor *, void *), void *context) const
SkGlyphCachedetachCache (const SkMatrix *) const
SkDrawCacheProc getDrawCacheProc () const
SkMeasureCacheProc getMeasureCacheProc (TextBufferDirection dir, bool needFullMetrics) const
SkScalar measure_text (SkGlyphCache *, const char *text, size_t length, int *count, SkRect *bounds) const

Private Attributes

unsigned fCapType: 2
SkColor fColor
SkColorFilter * fColorFilter
unsigned fFlags: 11
unsigned fHinting: 2
unsigned fJoinType: 2
SkScalar fMiterLimit
SkRasterizer * fRasterizer
unsigned fStyle: 2
unsigned fTextAlign: 2
unsigned fTextEncoding: 2
SkScalar fTextScaleX
SkScalar fTextSize
SkScalar fTextSkewX
SkScalar fWidth


int operator!= (const SkPaint &a, const SkPaint &b)
int operator== (const SkPaint &a, const SkPaint &b)
class SkAutoGlyphCache
class SkCanvas
class SkDraw
class SkTextToPathIter


struct  FontMetrics

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index