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

Unified Diff: include/gpu/GrContext.h

Issue 15821008: Make GrContext track the current matrix, render target, and clip directly rather than using GrDrawS… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: put back wideopen check Created 7 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 | include/gpu/GrEffectStage.h » ('j') | src/gpu/GrContext.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrContext.h
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 560d440cafbf5aa32336bedb685d95c326dfd6e0..cca476bee45493c6b4dd7f1bc5fb9724c5f15f2e 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -257,16 +257,18 @@ public:
/**
* Sets the render target.
- * @param target the render target to set. (should not be NULL.)
+ * @param target the render target to set.
*/
- void setRenderTarget(GrRenderTarget* target);
+ void setRenderTarget(GrRenderTarget* target) {
+ fRenderTarget.reset(SkSafeRef(target));
+ }
/**
* Gets the current render target.
- * @return the currently bound render target. Should never be NULL.
+ * @return the currently bound render target.
*/
- const GrRenderTarget* getRenderTarget() const;
- GrRenderTarget* getRenderTarget();
+ const GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); }
+ GrRenderTarget* getRenderTarget() { return fRenderTarget.get(); }
GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; }
@@ -321,25 +323,25 @@ public:
* Gets the current transformation matrix.
* @return the current matrix.
*/
- const SkMatrix& getMatrix() const;
+ const SkMatrix& getMatrix() const { return fViewMatrix; }
/**
* Sets the transformation matrix.
* @param m the matrix to set.
*/
- void setMatrix(const SkMatrix& m);
+ void setMatrix(const SkMatrix& m) { fViewMatrix = m; }
/**
* Sets the current transformation matrix to identity.
*/
- void setIdentityMatrix();
+ void setIdentityMatrix() { fViewMatrix.reset(); }
/**
* Concats the current matrix. The passed matrix is applied before the
* current matrix.
* @param m the matrix to concat.
*/
- void concatMatrix(const SkMatrix& m) const;
+ void concatMatrix(const SkMatrix& m) { fViewMatrix.preConcat(m); }
///////////////////////////////////////////////////////////////////////////
@@ -348,13 +350,13 @@ public:
* Gets the current clip.
* @return the current clip.
*/
- const GrClipData* getClip() const;
+ const GrClipData* getClip() const { return fClip; }
/**
* Sets the clip.
* @param clipData the clip to set.
*/
- void setClip(const GrClipData* clipData);
+ void setClip(const GrClipData* clipData) { fClip = clipData; }
///////////////////////////////////////////////////////////////////////////
// Draws
@@ -864,25 +866,28 @@ private:
};
BufferedDraw fLastDrawWasBuffered;
- GrGpu* fGpu;
- GrDrawState* fDrawState;
+ GrGpu* fGpu;
+ SkMatrix fViewMatrix;
+ SkAutoTUnref<GrRenderTarget> fRenderTarget;
+ const GrClipData* fClip; // TODO: make this ref counted
+ GrDrawState* fDrawState;
- GrResourceCache* fTextureCache;
- GrFontCache* fFontCache;
+ GrResourceCache* fTextureCache;
+ GrFontCache* fFontCache;
- GrPathRendererChain* fPathRendererChain;
- GrSoftwarePathRenderer* fSoftwarePathRenderer;
+ GrPathRendererChain* fPathRendererChain;
+ GrSoftwarePathRenderer* fSoftwarePathRenderer;
- GrVertexBufferAllocPool* fDrawBufferVBAllocPool;
- GrIndexBufferAllocPool* fDrawBufferIBAllocPool;
- GrInOrderDrawBuffer* fDrawBuffer;
+ GrVertexBufferAllocPool* fDrawBufferVBAllocPool;
+ GrIndexBufferAllocPool* fDrawBufferIBAllocPool;
+ GrInOrderDrawBuffer* fDrawBuffer;
- GrAARectRenderer* fAARectRenderer;
- GrOvalRenderer* fOvalRenderer;
+ GrAARectRenderer* fAARectRenderer;
+ GrOvalRenderer* fOvalRenderer;
- bool fDidTestPMConversions;
- int fPMToUPMConversion;
- int fUPMToPMConversion;
+ bool fDidTestPMConversions;
+ int fPMToUPMConversion;
+ int fUPMToPMConversion;
struct CleanUpData {
PFCleanUpFunc fFunc;
« no previous file with comments | « no previous file | include/gpu/GrEffectStage.h » ('j') | src/gpu/GrContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698