diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-16 14:15:02 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-16 14:15:02 +0000 |
commit | d5f20797e1f4781b8a0e5baa55ecaaf68fa7980b (patch) | |
tree | 17c59ce9d285679f067f33785ec8986f80d85afe | |
parent | a584aed5f709ff9655fd3326e23cd6f602ac7ae4 (diff) |
can't make the compute-bounds methods private yet :(
git-svn-id: http://skia.googlecode.com/svn/trunk@3969 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | include/core/SkPaint.h | 83 |
1 files changed, 40 insertions, 43 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index 8fcfda26ba..134d4bf6d8 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -829,47 +829,9 @@ public: // mean that we need not draw at all (e.g. SrcOver + 0-alpha) bool nothingToDraw() const; -private: - SkTypeface* fTypeface; - SkScalar fTextSize; - SkScalar fTextScaleX; - SkScalar fTextSkewX; - - SkPathEffect* fPathEffect; - SkShader* fShader; - SkXfermode* fXfermode; - SkMaskFilter* fMaskFilter; - SkColorFilter* fColorFilter; - SkRasterizer* fRasterizer; - SkDrawLooper* fLooper; - SkImageFilter* fImageFilter; - - SkColor fColor; - SkScalar fWidth; - SkScalar fMiterLimit; - unsigned fFlags : 15; - unsigned fTextAlign : 2; - unsigned fCapType : 2; - unsigned fJoinType : 2; - unsigned fStyle : 2; - unsigned fTextEncoding : 2; // 3 values - unsigned fHinting : 2; - - 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; - - SkGlyphCache* detachCache(const SkMatrix*) const; - - void descriptorProc(const SkMatrix* deviceMatrix, - void (*proc)(const SkDescriptor*, void*), - void* context, bool ignoreGamma = false) const; - /////////////////////////////////////////////////////////////////////////// - + // would prefer to make these private... + /** Returns true if the current paint settings allow for fast computation of bounds (i.e. there is nothing complex like a patheffect that would make the bounds computation expensive. @@ -926,8 +888,45 @@ private: // without having to make a copy of the paint just to change that field. const SkRect& doComputeFastBounds(const SkRect& orig, SkRect* storage, Style) const; + +private: + SkTypeface* fTypeface; + SkScalar fTextSize; + SkScalar fTextScaleX; + SkScalar fTextSkewX; - /////////////////////////////////////////////////////////////////////////// + SkPathEffect* fPathEffect; + SkShader* fShader; + SkXfermode* fXfermode; + SkMaskFilter* fMaskFilter; + SkColorFilter* fColorFilter; + SkRasterizer* fRasterizer; + SkDrawLooper* fLooper; + SkImageFilter* fImageFilter; + + SkColor fColor; + SkScalar fWidth; + SkScalar fMiterLimit; + unsigned fFlags : 15; + unsigned fTextAlign : 2; + unsigned fCapType : 2; + unsigned fJoinType : 2; + unsigned fStyle : 2; + unsigned fTextEncoding : 2; // 3 values + unsigned fHinting : 2; + + 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; + + SkGlyphCache* detachCache(const SkMatrix*) const; + + void descriptorProc(const SkMatrix* deviceMatrix, + void (*proc)(const SkDescriptor*, void*), + void* context, bool ignoreGamma = false) const; enum { kCanonicalTextSizeForPaths = 64 @@ -935,8 +934,6 @@ private: friend class SkAutoGlyphCache; friend class SkCanvas; friend class SkDraw; - friend class SkDrawLooper; // computeFastBounds - friend class SkPictureRecord; // computeFastBounds friend class SkPDFDevice; friend class SkTextToPathIter; |