| Index: Source/core/platform/graphics/skia/PlatformContextSkia.h
|
| diff --git a/Source/core/platform/graphics/skia/PlatformContextSkia.h b/Source/core/platform/graphics/skia/PlatformContextSkia.h
|
| index 2823cf0b9033d7c30012a5f298e5650dd257cf1f..ffe182ebdc82f3f9257e872cde96b509acf0dc73 100644
|
| --- a/Source/core/platform/graphics/skia/PlatformContextSkia.h
|
| +++ b/Source/core/platform/graphics/skia/PlatformContextSkia.h
|
| @@ -187,6 +187,10 @@ public:
|
| // This will be an empty region unless tracking is enabled.
|
| const OpaqueRegionSkia& opaqueRegion() const { return m_opaqueRegion; }
|
|
|
| + void setTrackTextRegion(bool track) { m_trackTextRegion = track; }
|
| + // This will be an empty region unless tracking is enabled.
|
| + const SkRect& textRegion() const { return m_textRegion; }
|
| +
|
| // After drawing directly to the context's canvas, use this function to notify the context so
|
| // it can track the opaque region.
|
| // FIXME: this is still needed only because ImageSkia::paintSkBitmap() may need to notify for a
|
| @@ -239,10 +243,10 @@ public:
|
| void drawRect(const SkRect&, const SkPaint&);
|
| void drawIRect(const SkIRect&, const SkPaint&);
|
| void drawRRect(const SkRRect&, const SkPaint&);
|
| - void drawPosText(const void* text, size_t byteLength, const SkPoint pos[], const SkPaint&);
|
| + void drawPosText(const void* text, size_t byteLength, const SkPoint pos[], const SkRect& textRect, const SkPaint&);
|
| void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], SkScalar constY,
|
| - const SkPaint&);
|
| - void drawTextOnPath(const void* text, size_t byteLength, const SkPath&,
|
| + const SkRect& textRect, const SkPaint&);
|
| + void drawTextOnPath(const void* text, size_t byteLength, const SkPath&, const SkRect& textRect,
|
| const SkMatrix*, const SkPaint&);
|
|
|
| private:
|
| @@ -256,6 +260,8 @@ private:
|
|
|
| void realizeSave(SkCanvas::SaveFlags);
|
|
|
| + void didDrawTextInRect(const SkRect& textRect);
|
| +
|
| struct DeferredSaveState;
|
|
|
| // NULL indicates painting is disabled. Never delete this object.
|
| @@ -280,6 +286,10 @@ private:
|
| OpaqueRegionSkia m_opaqueRegion;
|
| bool m_trackOpaqueRegion;
|
|
|
| + // Tracks the region where text is painted via GraphicsContext.
|
| + bool m_trackTextRegion;
|
| + SkRect m_textRegion;
|
| +
|
| bool m_printing;
|
| bool m_accelerated;
|
| bool m_drawingToImageBuffer;
|
| @@ -474,30 +484,44 @@ inline void PlatformContextSkia::drawRRect(const SkRRect& rect, const SkPaint& p
|
| m_opaqueRegion.didDrawBounded(this, rect.getBounds(), paint);
|
| }
|
|
|
| -inline void PlatformContextSkia::drawPosText(const void* text, size_t byteLength,
|
| - const SkPoint pos[], const SkPaint& paint)
|
| +inline void PlatformContextSkia::drawPosText(const void* text,
|
| + size_t byteLength,
|
| + const SkPoint pos[],
|
| + const SkRect& textRect,
|
| + const SkPaint& paint)
|
| {
|
| m_canvas->drawPosText(text, byteLength, pos, paint);
|
| + didDrawTextInRect(textRect);
|
|
|
| // FIXME: compute bounds for positioned text.
|
| if (m_trackOpaqueRegion)
|
| m_opaqueRegion.didDrawUnbounded(this, paint, OpaqueRegionSkia::FillOrStroke);
|
| }
|
|
|
| -inline void PlatformContextSkia::drawPosTextH(const void* text, size_t byteLength,
|
| - const SkScalar xpos[], SkScalar constY, const SkPaint& paint)
|
| +inline void PlatformContextSkia::drawPosTextH(const void* text,
|
| + size_t byteLength,
|
| + const SkScalar xpos[],
|
| + SkScalar constY,
|
| + const SkRect& textRect,
|
| + const SkPaint& paint)
|
| {
|
| m_canvas->drawPosTextH(text, byteLength, xpos, constY, paint);
|
| + didDrawTextInRect(textRect);
|
|
|
| // FIXME: compute bounds for positioned text.
|
| if (m_trackOpaqueRegion)
|
| m_opaqueRegion.didDrawUnbounded(this, paint, OpaqueRegionSkia::FillOrStroke);
|
| }
|
|
|
| -inline void PlatformContextSkia::drawTextOnPath(const void* text, size_t byteLength,
|
| - const SkPath& path, const SkMatrix* matrix, const SkPaint& paint)
|
| +inline void PlatformContextSkia::drawTextOnPath(const void* text,
|
| + size_t byteLength,
|
| + const SkPath& path,
|
| + const SkRect& textRect,
|
| + const SkMatrix* matrix,
|
| + const SkPaint& paint)
|
| {
|
| m_canvas->drawTextOnPath(text, byteLength, path, matrix, paint);
|
| + didDrawTextInRect(textRect);
|
|
|
| // FIXME: compute bounds for positioned text.
|
| if (m_trackOpaqueRegion)
|
|
|