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

Unified Diff: include/gpu/GrDrawContext.h

Issue 1178383003: Revert of Make GrTextContext be owned by the GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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 | « include/gpu/GrContext.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrDrawContext.h
diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h
index 7e711260cec282f46401c2a67f98c3ee0c1535ce..4b78c89f918379586266c024cb7dd5398eaab828 100644
--- a/include/gpu/GrDrawContext.h
+++ b/include/gpu/GrDrawContext.h
@@ -22,18 +22,14 @@
class GrRenderTarget;
class GrStrokeInfo;
class GrSurface;
-class GrTextContext;
-struct SkDeviceProperties;
-class SkDrawFilter;
struct SkIPoint;
struct SkIRect;
class SkMatrix;
-class SkPaint;
class SkPath;
struct SkPoint;
struct SkRect;
class SkRRect;
-class SkTextBlob;
+
/*
* A helper object to orchestrate draws
@@ -42,28 +38,14 @@
public:
SK_DECLARE_INST_COUNT(GrDrawContext)
- ~GrDrawContext() override;
-
void copySurface(GrRenderTarget* dst, GrSurface* src,
const SkIRect& srcRect, const SkIPoint& dstPoint);
- // TODO: it is odd that we need both the SkPaint in the following 3 methods.
- // We should extract the text parameters from SkPaint and pass them separately
- // akin to GrStrokeInfo (GrTextInfo?)
- void drawText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&,
- const SkMatrix& viewMatrix, const char text[], size_t byteLength,
- SkScalar x, SkScalar y, const SkIRect& clipBounds);
- void drawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&,
- const SkMatrix& viewMatrix, const char text[], size_t byteLength,
- const SkScalar pos[], int scalarsPerPosition,
- const SkPoint& offset, const SkIRect& clipBounds);
- void drawTextBlob(GrRenderTarget*, const GrClip&, const SkPaint&,
- const SkMatrix& viewMatrix, const SkTextBlob*,
- SkScalar x, SkScalar y,
- SkDrawFilter*, const SkIRect& clipBounds);
-
- // drawPaths is thanks to GrStencilAndCoverTextContext
- // TODO: remove
+ // drawText and drawPaths are thanks to the GrAtlasTextContext and the
+ // GrStencilAndCoverTextContext respectively
+ // TODO: remove these two
+ void drawText(GrPipelineBuilder* pipelineBuilder, GrBatch* batch);
+
void drawPaths(GrPipelineBuilder* pipelineBuilder,
const GrPathProcessor* pathProc,
const GrPathRange* pathRange,
@@ -241,17 +223,16 @@
private:
- friend class GrAtlasTextContext; // for access to drawBatch
friend class GrContext; // for ctor
- GrDrawContext(GrContext*, GrDrawTarget*, const SkDeviceProperties&, bool useDFT);
+ GrDrawContext(GrContext* context, GrDrawTarget* drawTarget);
+ ~GrDrawContext() override;
// Sets the paint. Returns true on success; false on failure.
bool prepareToDraw(GrPipelineBuilder*,
GrRenderTarget* rt,
const GrClip&,
const GrPaint* paint);
- GrTextContext* createTextContext(GrRenderTarget*, const SkDeviceProperties&, bool useDFT);
// A simpler version of the above which just returns true on success; false on failure.
// Clip is *NOT* set
@@ -265,16 +246,8 @@
const SkPath&,
const GrStrokeInfo&);
- // This entry point allows the GrTextContext-derived classes to add their batches to
- // the drawTarget.
- void drawBatch(GrPipelineBuilder* pipelineBuilder, GrBatch* batch);
-
- GrContext* fContext; // owning context -> no ref
- GrDrawTarget* fDrawTarget;
- GrTextContext* fTextContext; // lazily created
-
- SkDeviceProperties* fDevProps; // ptr b.c. SkDeviceProperties isn't public
- bool fUseDFT;
+ GrContext* fContext; // owning context -> no ref
+ GrDrawTarget* fDrawTarget;
};
#endif
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698