diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/private/graphics/Canvas.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/include/private/graphics/Canvas.h b/include/private/graphics/Canvas.h index 3cd57f4..ae79907 100644 --- a/include/private/graphics/Canvas.h +++ b/include/private/graphics/Canvas.h @@ -28,6 +28,16 @@ public: virtual ~Canvas() {}; static Canvas* create_canvas(SkBitmap* bitmap); + + /** + * Create a new Canvas object which delegates to an SkCanvas. + * + * @param skiaCanvas Must not be NULL. All drawing calls will be + * delegated to this object. This function will call ref() on the + * SkCanvas, and the returned Canvas will unref() it upon + * destruction. + * @return new Canvas object. Will not return NULL. + */ static Canvas* create_canvas(SkCanvas* skiaCanvas); // TODO: enable HWUI to either create similar canvas wrapper or subclass @@ -121,15 +131,23 @@ public: const float* vertices, const int* colors, const SkPaint* paint) = 0; // Text - virtual void drawText(const uint16_t* text, const float* positions, int count, + /** + * drawText: count is of glyphs + * totalAdvance is ignored in software renderering, used by hardware renderer for + * text decorations (underlines, strikethroughs). + */ + virtual void drawText(const uint16_t* glyphs, const float* positions, int count, const SkPaint& paint, float x, float y, - float boundsLeft, float boundsTop, float boundsRight, float boundsBottom) = 0; + float boundsLeft, float boundsTop, float boundsRight, float boundsBottom, + float totalAdvance) = 0; + /** drawPosText: count is of UTF16 characters, posCount is floats (2 * glyphs) */ virtual void drawPosText(const uint16_t* text, const float* positions, int count, int posCount, const SkPaint& paint) = 0; + /** drawTextOnPath: count is of glyphs */ virtual void drawTextOnPath(const uint16_t* glyphs, int count, const SkPath& path, float hOffset, float vOffset, const SkPaint& paint) = 0; - /* + /** * Specifies if the positions passed to ::drawText are absolute or relative * to the (x,y) value provided. * |