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

Unified Diff: src/gpu/GrDrawTarget.h

Issue 1166553002: Remove GrContext from GrDrawTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove comment Created 5 years, 7 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 | « no previous file | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.h
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 8b9c0ee5f0900acfd435835e1f36b10d2c65e303..a7402023859532b26778b2ca346a9df23352df23 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -46,9 +46,9 @@ public:
// The context may not be fully constructed and should not be used during GrDrawTarget
// construction.
- GrDrawTarget(GrContext* context);
+ GrDrawTarget(GrGpu* gpu, GrResourceProvider*);
- virtual ~GrDrawTarget() {}
+ virtual ~GrDrawTarget();
/**
* Empties the draw buffer of any queued up draws.
@@ -64,7 +64,7 @@ public:
/**
* Gets the capabilities of the draw target.
*/
- const GrCaps* caps() const { return fCaps.get(); }
+ const GrCaps* caps() const { return fCaps; }
void drawBatch(GrPipelineBuilder*, GrBatch*);
@@ -208,7 +208,7 @@ public:
*/
virtual void purgeResources() {};
- bool programUnitTest(int maxStages);
+ bool programUnitTest(GrContext* owner, int maxStages);
protected:
friend class GrCommandBuilder; // for PipelineInfo
@@ -216,17 +216,8 @@ protected:
friend class GrReorderCommandBuilder; // for PipelineInfo
friend class GrTargetCommands; // for PipelineInfo
- GrContext* getContext() { return fContext; }
- const GrContext* getContext() const { return fContext; }
-
- GrGpu* getGpu() {
- SkASSERT(fContext && fContext->getGpu());
- return fContext->getGpu();
- }
- const GrGpu* getGpu() const {
- SkASSERT(fContext && fContext->getGpu());
- return fContext->getGpu();
- }
+ GrGpu* getGpu() { return fGpu; }
+ const GrGpu* getGpu() const { return fGpu; }
const GrTraceMarkerSet& getActiveTraceMarkers() { return fActiveTraceMarkers; }
@@ -312,14 +303,14 @@ private:
GrScissorState*,
const SkRect* devBounds) = 0;
- // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTarget.
- GrContext* fContext;
- SkAutoTUnref<const GrCaps> fCaps;
+ GrGpu* fGpu;
+ const GrCaps* fCaps;
+ GrResourceProvider* fResourceProvider;
// To keep track that we always have at least as many debug marker adds as removes
- int fGpuTraceMarkerCount;
- GrTraceMarkerSet fActiveTraceMarkers;
- GrTraceMarkerSet fStoredTraceMarkers;
- bool fFlushing;
+ int fGpuTraceMarkerCount;
+ GrTraceMarkerSet fActiveTraceMarkers;
+ GrTraceMarkerSet fStoredTraceMarkers;
+ bool fFlushing;
typedef SkRefCnt INHERITED;
};
@@ -334,8 +325,8 @@ public:
/* Clip mask manager needs access to the context.
* TODO we only need a very small subset of context in the CMM.
*/
- GrContext* getContext() { return INHERITED::getContext(); }
- const GrContext* getContext() const { return INHERITED::getContext(); }
+ GrContext* getContext() { return fContext; }
+ const GrContext* getContext() const { return fContext; }
/**
* Clip Mask Manager(and no one else) needs to clear private stencil bits.
@@ -353,6 +344,7 @@ public:
protected:
SkAutoTDelete<GrClipMaskManager> fClipMaskManager;
+ GrContext* fContext;
private:
GrClipMaskManager* clipMaskManager() override { return fClipMaskManager; }
« no previous file with comments | « no previous file | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698