Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / src / gpu / GrTextContext.h
index c139e22..4f7207b 100644 (file)
@@ -23,26 +23,17 @@ class GrFontScaler;
  */
 class GrTextContext {
 public:
-    virtual ~GrTextContext() {}
-    virtual void drawText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength,
-                          SkScalar x, SkScalar y) = 0;
-    virtual void drawPosText(const GrPaint&, const SkPaint&,
-                             const char text[], size_t byteLength,
-                             const SkScalar pos[], SkScalar constY,
-                             int scalarsPerPosition) = 0;
+    virtual ~GrTextContext();
 
-    virtual bool canDraw(const SkPaint& paint) = 0;
+    bool drawText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength,
+                  SkScalar x, SkScalar y);
+    bool drawPosText(const GrPaint&, const SkPaint&,
+                     const char text[], size_t byteLength,
+                     const SkScalar pos[], int scalarsPerPosition,
+                     const SkPoint& offset);
 
 protected:
-    GrTextContext(GrContext*, const SkDeviceProperties&);
-
-    static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache);
-    static void MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc,
-                            const char text[], size_t byteLength, SkVector* stopVector);
-
-    void init(const GrPaint&, const SkPaint&);
-    void finish() { fDrawTarget = NULL; }
-
+    GrTextContext*     fFallbackTextContext;
     GrContext*         fContext;
     SkDeviceProperties fDeviceProperties;
 
@@ -50,6 +41,25 @@ protected:
     SkIRect            fClipRect;
     GrPaint            fPaint;
     SkPaint            fSkPaint;
+
+    GrTextContext(GrContext*, const SkDeviceProperties&);
+
+    virtual bool canDraw(const SkPaint& paint) = 0;
+
+    virtual void onDrawText(const GrPaint&, const SkPaint&, const char text[], size_t byteLength,
+                            SkScalar x, SkScalar y) = 0;
+    virtual void onDrawPosText(const GrPaint&, const SkPaint&,
+                               const char text[], size_t byteLength,
+                               const SkScalar pos[], int scalarsPerPosition,
+                               const SkPoint& offset) = 0;
+
+    void init(const GrPaint&, const SkPaint&);
+    void finish() { fDrawTarget = NULL; }
+
+    static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache);
+    // sets extent in stopVector and returns glyph count
+    static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc,
+                           const char text[], size_t byteLength, SkVector* stopVector);
 };
 
 #endif