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

Unified Diff: src/gpu/GrAARectRenderer.h

Issue 683483004: aa rect renderer takes a gpu on construction (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 6 years, 2 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/GrAARectRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAARectRenderer.h
diff --git a/src/gpu/GrAARectRenderer.h b/src/gpu/GrAARectRenderer.h
index b276823434d0df28a52654fcf69447cbf870b9e9..c6e3976b7f741e785a2131ebc8263802c2fdec30 100644
--- a/src/gpu/GrAARectRenderer.h
+++ b/src/gpu/GrAARectRenderer.h
@@ -24,8 +24,9 @@ class GrAARectRenderer : public SkRefCnt {
public:
SK_DECLARE_INST_COUNT(GrAARectRenderer)
- GrAARectRenderer()
- : fAAFillRectIndexBuffer(NULL)
+ GrAARectRenderer(GrGpu* gpu)
+ : fGpu(gpu)
+ , fAAFillRectIndexBuffer(NULL)
, fAAMiterStrokeRectIndexBuffer(NULL)
, fAABevelStrokeRectIndexBuffer(NULL) {
}
@@ -39,8 +40,7 @@ public:
// TODO: potentialy fuse the fill & stroke methods and differentiate
// between them by passing in stroke (==NULL means fill).
- void fillAARect(GrGpu* gpu,
- GrDrawTarget* target,
+ void fillAARect(GrDrawTarget* target,
const SkRect& rect,
const SkMatrix& combinedMatrix,
const SkRect& devRect) {
@@ -53,54 +53,48 @@ public:
rect, combinedMatrix);
}
#else
- this->geometryFillAARect(gpu, target, rect, combinedMatrix, devRect);
+ this->geometryFillAARect(target, rect, combinedMatrix, devRect);
#endif
}
- void strokeAARect(GrGpu* gpu,
- GrDrawTarget* target,
+ void strokeAARect(GrDrawTarget* target,
const SkRect& rect,
const SkMatrix& combinedMatrix,
const SkRect& devRect,
const SkStrokeRec& stroke);
// First rect is outer; second rect is inner
- void fillAANestedRects(GrGpu* gpu,
- GrDrawTarget* target,
+ void fillAANestedRects(GrDrawTarget* target,
const SkRect rects[2],
const SkMatrix& combinedMatrix);
private:
- GrIndexBuffer* fAAFillRectIndexBuffer;
- GrIndexBuffer* fAAMiterStrokeRectIndexBuffer;
- GrIndexBuffer* fAABevelStrokeRectIndexBuffer;
-
- static int aaStrokeRectIndexCount(bool miterStroke);
- GrIndexBuffer* aaStrokeRectIndexBuffer(GrGpu* gpu, bool miterStroke);
+ GrIndexBuffer* aaStrokeRectIndexBuffer(bool miterStroke);
- void geometryFillAARect(GrGpu* gpu,
- GrDrawTarget* target,
+ void geometryFillAARect(GrDrawTarget* target,
const SkRect& rect,
const SkMatrix& combinedMatrix,
const SkRect& devRect);
- void shaderFillAARect(GrGpu* gpu,
- GrDrawTarget* target,
+ void shaderFillAARect(GrDrawTarget* target,
const SkRect& rect,
const SkMatrix& combinedMatrix);
- void shaderFillAlignedAARect(GrGpu* gpu,
- GrDrawTarget* target,
+ void shaderFillAlignedAARect(GrDrawTarget* target,
const SkRect& rect,
const SkMatrix& combinedMatrix);
- void geometryStrokeAARect(GrGpu* gpu,
- GrDrawTarget* target,
+ void geometryStrokeAARect(GrDrawTarget* target,
const SkRect& devOutside,
const SkRect& devOutsideAssist,
const SkRect& devInside,
bool miterStroke);
+ GrGpu* fGpu;
+ GrIndexBuffer* fAAFillRectIndexBuffer;
+ GrIndexBuffer* fAAMiterStrokeRectIndexBuffer;
+ GrIndexBuffer* fAABevelStrokeRectIndexBuffer;
+
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « no previous file | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698