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

Unified Diff: src/gpu/batches/GrAAFillRectBatch.cpp

Issue 1295773003: fill rect batch refactor into separate batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 4 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/batches/GrBWFillRectBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAAFillRectBatch.cpp
diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp
index 8760896604c60c2d99cfc224cbee6c09f1884bb5..7ca24ea8f4bc641851f3dde38c383335af68b404 100644
--- a/src/gpu/batches/GrAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrAAFillRectBatch.cpp
@@ -187,9 +187,18 @@ public:
static const int kVertsPerInstance = kVertsPerAAFillRect;
static const int kIndicesPerInstance = kIndicesPerAAFillRect;
- inline static const GrIndexBuffer* GetIndexBuffer(GrResourceProvider* rp) {
+ static void InitInvariantOutputCoverage(GrInitInvariantOutput* out) {
+ out->setUnknownSingleComponent();
+ }
+
+ static const GrIndexBuffer* GetIndexBuffer(GrResourceProvider* rp) {
return get_index_buffer(rp);
}
+
+ template <class Geometry>
+ static void SetBounds(const Geometry& geo, SkRect* outBounds) {
+ *outBounds = geo.fDevRect;
+ }
};
class AAFillRectBatchNoLocalMatrixImp : public AAFillRectBatchBase {
@@ -201,18 +210,18 @@ public:
GrColor fColor;
};
- inline static const char* Name() { return "AAFillRectBatchNoLocalMatrix"; }
+ static const char* Name() { return "AAFillRectBatchNoLocalMatrix"; }
- inline static bool CanCombine(const Geometry& mine, const Geometry& theirs,
- const GrPipelineOptimizations& opts) {
+ static bool CanCombine(const Geometry& mine, const Geometry& theirs,
+ const GrPipelineOptimizations& opts) {
// We apply the viewmatrix to the rect points on the cpu. However, if the pipeline uses
// local coords then we won't be able to batch. We could actually upload the viewmatrix
// using vertex attributes in these cases, but haven't investigated that
return !opts.readsLocalCoords() || mine.fViewMatrix.cheapEqualTo(theirs.fViewMatrix);
}
- inline static const GrGeometryProcessor* CreateGP(const Geometry& geo,
- const GrPipelineOptimizations& opts) {
+ static const GrGeometryProcessor* CreateGP(const Geometry& geo,
+ const GrPipelineOptimizations& opts) {
const GrGeometryProcessor* gp =
create_fill_rect_gp(geo.fViewMatrix, opts,
GrDefaultGeoProcFactory::LocalCoords::kUsePosition_Type);
@@ -224,8 +233,8 @@ public:
return gp;
}
- inline static void Tesselate(intptr_t vertices, size_t vertexStride, const Geometry& geo,
- const GrPipelineOptimizations& opts) {
+ static void Tesselate(intptr_t vertices, size_t vertexStride, const Geometry& geo,
+ const GrPipelineOptimizations& opts) {
generate_aa_fill_rect_geometry(vertices, vertexStride,
geo.fColor, geo.fViewMatrix, geo.fRect, geo.fDevRect, opts,
NULL);
@@ -242,15 +251,15 @@ public:
GrColor fColor;
};
- inline static const char* Name() { return "AAFillRectBatchLocalMatrix"; }
+ static const char* Name() { return "AAFillRectBatchLocalMatrix"; }
- inline static bool CanCombine(const Geometry& mine, const Geometry& theirs,
- const GrPipelineOptimizations&) {
+ static bool CanCombine(const Geometry& mine, const Geometry& theirs,
+ const GrPipelineOptimizations&) {
return true;
}
- inline static const GrGeometryProcessor* CreateGP(const Geometry& geo,
- const GrPipelineOptimizations& opts) {
+ static const GrGeometryProcessor* CreateGP(const Geometry& geo,
+ const GrPipelineOptimizations& opts) {
const GrGeometryProcessor* gp =
create_fill_rect_gp(geo.fViewMatrix, opts,
GrDefaultGeoProcFactory::LocalCoords::kHasExplicit_Type);
@@ -263,8 +272,8 @@ public:
return gp;
}
- inline static void Tesselate(intptr_t vertices, size_t vertexStride, const Geometry& geo,
- const GrPipelineOptimizations& opts) {
+ static void Tesselate(intptr_t vertices, size_t vertexStride, const Geometry& geo,
+ const GrPipelineOptimizations& opts) {
generate_aa_fill_rect_geometry(vertices, vertexStride,
geo.fColor, geo.fViewMatrix, geo.fRect, geo.fDevRect, opts,
&geo.fLocalMatrix);
« no previous file with comments | « no previous file | src/gpu/batches/GrBWFillRectBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698