Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Unified Diff: src/gpu/GrTextContext.h

Issue 1015173002: Let text contexts fall back directly to paths (Closed) Base URL: https://skia.googlesource.com/skia.git@text-blob-to-context
Patch Set: move createTextContext to private Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.cpp ('k') | src/gpu/GrTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTextContext.h
diff --git a/src/gpu/GrTextContext.h b/src/gpu/GrTextContext.h
index d333c631413f751d3b89378f921b4dee815e9994..56a113daedbbec0ae2ba0fd1bc370dca014c211e 100644
--- a/src/gpu/GrTextContext.h
+++ b/src/gpu/GrTextContext.h
@@ -19,6 +19,7 @@ class GrClip;
class GrContext;
class GrDrawTarget;
class GrFontScaler;
+class SkGpuDevice;
/*
* This class wraps the state for a single text render
@@ -27,41 +28,56 @@ class GrTextContext {
public:
virtual ~GrTextContext();
- bool drawText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const SkPaint&,
+ void drawText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const SkPaint&,
const SkMatrix& viewMatrix, const char text[], size_t byteLength, SkScalar x,
- SkScalar y);
- bool drawPosText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const SkPaint&,
+ SkScalar y, const SkIRect& clipBounds);
+ void drawPosText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const SkPaint&,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
- const SkPoint& offset);
+ const SkPoint& offset, const SkIRect& clipBounds);
protected:
GrTextContext* fFallbackTextContext;
GrContext* fContext;
+ // TODO we probably don't really need to store a back pointer to the owning SkGpuDevice, except
+ // we need to be able to call drawPath on it in the event no other text context can draw the
+ // text. We might be able to move this logic to context though. This is unreffed because
+ // GrTextContext is completely owned by SkGpuDevice
+ SkGpuDevice* fGpuDevice;
SkDeviceProperties fDeviceProperties;
SkAutoTUnref<GrRenderTarget> fRenderTarget;
GrClip fClip;
GrDrawTarget* fDrawTarget;
SkIRect fClipRect;
+ SkIRect fRegionClipBounds;
GrPaint fPaint;
SkPaint fSkPaint;
- GrTextContext(GrContext*, const SkDeviceProperties&);
+ GrTextContext(GrContext*, SkGpuDevice*, const SkDeviceProperties&);
virtual bool canDraw(const SkPaint& paint, const SkMatrix& viewMatrix) = 0;
virtual void onDrawText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&,
const SkMatrix& viewMatrix, const char text[], size_t byteLength,
- SkScalar x, SkScalar y) = 0;
+ SkScalar x, SkScalar y, const SkIRect& clipBounds) = 0;
virtual void onDrawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
- const SkPoint& offset) = 0;
+ const SkPoint& offset, const SkIRect& clipBounds) = 0;
- void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&);
+ void drawTextAsPath(const SkPaint& origPaint, const SkMatrix& viewMatrix,
+ const char text[], size_t byteLength, SkScalar x, SkScalar y,
+ const SkIRect& clipBounds);
+ void drawPosTextAsPath(const SkPaint& origPaint, const SkMatrix& viewMatrix,
+ const char text[], size_t byteLength,
+ const SkScalar pos[], int scalarsPerPosition,
+ const SkPoint& offset, const SkIRect& clipBounds);
+
+ void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&,
+ const SkIRect& regionClipBounds);
void finish() { fDrawTarget = NULL; }
static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache);
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.cpp ('k') | src/gpu/GrTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698