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

Unified Diff: include/gpu/GrAARectRenderer.h

Issue 14314004: Axis aligned shader-based rect drawing (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Addressed code review issues (renaming & API change) Created 7 years, 8 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: include/gpu/GrAARectRenderer.h
===================================================================
--- include/gpu/GrAARectRenderer.h (revision 8955)
+++ include/gpu/GrAARectRenderer.h (working copy)
@@ -38,20 +38,26 @@
// TODO: potentialy fuse the fill & stroke methods and differentiate
// between them by passing in strokeWidth (<0 means fill).
- // TODO: Remove the useVertexCoverage boolean. Just use it all the time
- // since we now have a coverage vertex attribute
void fillAARect(GrGpu* gpu,
GrDrawTarget* target,
+ const GrRect& rect,
+ const SkMatrix& combinedMatrix,
const GrRect& devRect,
- bool useVertexCoverage);
+ bool useVertexCoverage) {
+#ifdef SHADER_AA_FILL_RECT
+ if (combinedMatrix.rectStaysRect()) {
+ this->shaderFillAlignedAARect(gpu, target,
+ combinedMatrix, devRect);
+ } else {
+ this->shaderFillAARect(gpu, target,
+ rect, combinedMatrix, devRect);
+ }
+#else
+ this->geometryFillAARect(gpu, target,
+ devRect, useVertexCoverage);
+#endif
+ }
- void shaderFillAARect(GrGpu* gpu,
- GrDrawTarget* target,
- const GrRect& rect,
- const SkMatrix& combinedMatrix,
- const GrRect& devRect,
- bool useVertexCoverage);
-
void strokeAARect(GrGpu* gpu,
GrDrawTarget* target,
const GrRect& devRect,
@@ -67,6 +73,25 @@
static int aaStrokeRectIndexCount();
GrIndexBuffer* aaStrokeRectIndexBuffer(GrGpu* gpu);
+ // TODO: Remove the useVertexCoverage boolean. Just use it all the time
+ // since we now have a coverage vertex attribute
+ void geometryFillAARect(GrGpu* gpu,
+ GrDrawTarget* target,
+ const GrRect& devRect,
+ bool useVertexCoverage);
+
+ void shaderFillAARect(GrGpu* gpu,
+ GrDrawTarget* target,
+ const GrRect& rect,
+ const SkMatrix& combinedMatrix,
+ const GrRect& devRect);
+
+ void shaderFillAlignedAARect(GrGpu* gpu,
+ GrDrawTarget* target,
+ const GrRect& rect,
+ const SkMatrix& combinedMatrix,
+ const GrRect& devRect);
+
typedef GrRefCnt 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