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

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

Issue 1301203002: Revert "fill rect batch refactor into separate batches" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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.cpp » ('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 2554db614610353b5ed15938b422ca73318ad4af..8760896604c60c2d99cfc224cbee6c09f1884bb5 100644
--- a/src/gpu/batches/GrAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrAAFillRectBatch.cpp
@@ -187,14 +187,9 @@ public:
static const int kVertsPerInstance = kVertsPerAAFillRect;
static const int kIndicesPerInstance = kIndicesPerAAFillRect;
- static const GrIndexBuffer* GetIndexBuffer(GrResourceProvider* rp) {
+ inline 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 {
@@ -206,18 +201,18 @@ public:
GrColor fColor;
};
- static const char* Name() { return "AAFillRectBatchNoLocalMatrix"; }
+ inline static const char* Name() { return "AAFillRectBatchNoLocalMatrix"; }
- static bool CanCombine(const Geometry& mine, const Geometry& theirs,
- const GrPipelineOptimizations& opts) {
+ inline 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);
}
- static const GrGeometryProcessor* CreateGP(const Geometry& geo,
- const GrPipelineOptimizations& opts) {
+ inline static const GrGeometryProcessor* CreateGP(const Geometry& geo,
+ const GrPipelineOptimizations& opts) {
const GrGeometryProcessor* gp =
create_fill_rect_gp(geo.fViewMatrix, opts,
GrDefaultGeoProcFactory::LocalCoords::kUsePosition_Type);
@@ -229,8 +224,8 @@ public:
return gp;
}
- static void Tesselate(intptr_t vertices, size_t vertexStride, const Geometry& geo,
- const GrPipelineOptimizations& opts) {
+ inline 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);
@@ -247,15 +242,15 @@ public:
GrColor fColor;
};
- static const char* Name() { return "AAFillRectBatchLocalMatrix"; }
+ inline static const char* Name() { return "AAFillRectBatchLocalMatrix"; }
- static bool CanCombine(const Geometry& mine, const Geometry& theirs,
- const GrPipelineOptimizations&) {
+ inline static bool CanCombine(const Geometry& mine, const Geometry& theirs,
+ const GrPipelineOptimizations&) {
return true;
}
- static const GrGeometryProcessor* CreateGP(const Geometry& geo,
- const GrPipelineOptimizations& opts) {
+ inline static const GrGeometryProcessor* CreateGP(const Geometry& geo,
+ const GrPipelineOptimizations& opts) {
const GrGeometryProcessor* gp =
create_fill_rect_gp(geo.fViewMatrix, opts,
GrDefaultGeoProcFactory::LocalCoords::kHasExplicit_Type);
@@ -268,8 +263,8 @@ public:
return gp;
}
- static void Tesselate(intptr_t vertices, size_t vertexStride, const Geometry& geo,
- const GrPipelineOptimizations& opts) {
+ inline 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.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698