aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/batches
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-06-30 13:09:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-30 13:09:48 -0700
commitb8cbd2098225ee2ec1bd96b3e2b1cf3f5164d2d8 (patch)
tree4c04c4e63ccedbebfe4e997c7288bcda594b3471 /src/gpu/batches
parent08d141534cb24a491edbf5db31cdc7b966ec8d72 (diff)
Remove unused batch rect append functions
Diffstat (limited to 'src/gpu/batches')
-rw-r--r--src/gpu/batches/GrAAFillRectBatch.cpp55
-rw-r--r--src/gpu/batches/GrAAFillRectBatch.h13
-rw-r--r--src/gpu/batches/GrNonAAFillRectBatch.cpp80
-rw-r--r--src/gpu/batches/GrNonAAFillRectBatch.h6
4 files changed, 27 insertions, 127 deletions
diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp
index b2a3de9ee8..cba91c67e6 100644
--- a/src/gpu/batches/GrAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrAAFillRectBatch.cpp
@@ -526,27 +526,6 @@ private:
typedef GrVertexBatch INHERITED;
};
-inline static void append_to_batch(AAFillRectNoLocalMatrixBatch* batch, GrColor color,
- const SkMatrix& viewMatrix, const SkRect& rect,
- const SkRect& devRect) {
- AAFillRectNoLocalMatrixBatch::Geometry& geo = batch->geoData()->push_back();
- geo.fColor = color;
- geo.fViewMatrix = viewMatrix;
- geo.fRect = rect;
- geo.fDevRect = devRect;
-}
-
-inline static void append_to_batch(AAFillRectLocalMatrixBatch* batch, GrColor color,
- const SkMatrix& viewMatrix, const SkMatrix& localMatrix,
- const SkRect& rect, const SkRect& devRect) {
- AAFillRectLocalMatrixBatch::Geometry& geo = batch->geoData()->push_back();
- geo.fColor = color;
- geo.fViewMatrix = viewMatrix;
- geo.fLocalMatrix = localMatrix;
- geo.fRect = rect;
- geo.fDevRect = devRect;
-}
-
namespace GrAAFillRectBatch {
GrDrawBatch* Create(GrColor color,
@@ -554,7 +533,11 @@ GrDrawBatch* Create(GrColor color,
const SkRect& rect,
const SkRect& devRect) {
AAFillRectNoLocalMatrixBatch* batch = AAFillRectNoLocalMatrixBatch::Create();
- append_to_batch(batch, color, viewMatrix, rect, devRect);
+ AAFillRectNoLocalMatrixBatch::Geometry& geo = batch->geoData()->push_back();
+ geo.fColor = color;
+ geo.fViewMatrix = viewMatrix;
+ geo.fRect = rect;
+ geo.fDevRect = devRect;
batch->init();
return batch;
}
@@ -565,7 +548,12 @@ GrDrawBatch* Create(GrColor color,
const SkRect& rect,
const SkRect& devRect) {
AAFillRectLocalMatrixBatch* batch = AAFillRectLocalMatrixBatch::Create();
- append_to_batch(batch, color, viewMatrix, localMatrix, rect, devRect);
+ AAFillRectLocalMatrixBatch::Geometry& geo = batch->geoData()->push_back();
+ geo.fColor = color;
+ geo.fViewMatrix = viewMatrix;
+ geo.fLocalMatrix = localMatrix;
+ geo.fRect = rect;
+ geo.fDevRect = devRect;
batch->init();
return batch;
}
@@ -592,27 +580,6 @@ GrDrawBatch* CreateWithLocalRect(GrColor color,
return Create(color, viewMatrix, localMatrix, rect, devRect);
}
-void Append(GrBatch* origBatch,
- GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkRect& devRect) {
- AAFillRectNoLocalMatrixBatch* batch = origBatch->cast<AAFillRectNoLocalMatrixBatch>();
- append_to_batch(batch, color, viewMatrix, rect, devRect);
- batch->updateBoundsAfterAppend();
-}
-
-void Append(GrBatch* origBatch,
- GrColor color,
- const SkMatrix& viewMatrix,
- const SkMatrix& localMatrix,
- const SkRect& rect,
- const SkRect& devRect) {
- AAFillRectLocalMatrixBatch* batch = origBatch->cast<AAFillRectLocalMatrixBatch>();
- append_to_batch(batch, color, viewMatrix, localMatrix, rect, devRect);
- batch->updateBoundsAfterAppend();
-}
-
};
///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/batches/GrAAFillRectBatch.h b/src/gpu/batches/GrAAFillRectBatch.h
index 6f6f0d0398..1dbec995f7 100644
--- a/src/gpu/batches/GrAAFillRectBatch.h
+++ b/src/gpu/batches/GrAAFillRectBatch.h
@@ -36,19 +36,6 @@ GrDrawBatch* CreateWithLocalRect(GrColor color,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkRect& localRect);
-
-void Append(GrBatch*,
- GrColor,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkRect& devRect);
-
-void Append(GrBatch*,
- GrColor,
- const SkMatrix& viewMatrix,
- const SkMatrix& localMatrix,
- const SkRect& rect,
- const SkRect& devRect);
};
#endif
diff --git a/src/gpu/batches/GrNonAAFillRectBatch.cpp b/src/gpu/batches/GrNonAAFillRectBatch.cpp
index 186c935c70..b9865740a2 100644
--- a/src/gpu/batches/GrNonAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrNonAAFillRectBatch.cpp
@@ -424,9 +424,14 @@ private:
typedef GrVertexBatch INHERITED;
};
-inline static void append_to_batch(NonAAFillRectBatch* batch, GrColor color,
- const SkMatrix& viewMatrix, const SkRect& rect,
- const SkRect* localRect, const SkMatrix* localMatrix) {
+namespace GrNonAAFillRectBatch {
+
+GrDrawBatch* Create(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ const SkRect* localRect,
+ const SkMatrix* localMatrix) {
+ NonAAFillRectBatch* batch = NonAAFillRectBatch::Create();
SkASSERT(!viewMatrix.hasPerspective() && (!localMatrix || !localMatrix->hasPerspective()));
NonAAFillRectBatch::Geometry& geo = batch->geoData()->push_back();
@@ -443,11 +448,16 @@ inline static void append_to_batch(NonAAFillRectBatch* batch, GrColor color,
} else {
geo.fLocalQuad.set(rect);
}
+ batch->init();
+ return batch;
}
-inline static void append_to_batch(NonAAFillRectPerspectiveBatch* batch, GrColor color,
- const SkMatrix& viewMatrix, const SkRect& rect,
- const SkRect* localRect, const SkMatrix* localMatrix) {
+GrDrawBatch* CreateWithPerspective(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ const SkRect* localRect,
+ const SkMatrix* localMatrix) {
+ NonAAFillRectPerspectiveBatch* batch = NonAAFillRectPerspectiveBatch::Create();
SkASSERT(viewMatrix.hasPerspective() || (localMatrix && localMatrix->hasPerspective()));
NonAAFillRectPerspectiveBatch::Geometry& geo = batch->geoData()->push_back();
@@ -462,68 +472,10 @@ inline static void append_to_batch(NonAAFillRectPerspectiveBatch* batch, GrColor
if (localRect) {
geo.fLocalRect = *localRect;
}
-
-}
-
-namespace GrNonAAFillRectBatch {
-
-GrDrawBatch* Create(GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkRect* localRect,
- const SkMatrix* localMatrix) {
- NonAAFillRectBatch* batch = NonAAFillRectBatch::Create();
- append_to_batch(batch, color, viewMatrix, rect, localRect, localMatrix);
- batch->init();
- return batch;
-}
-
-GrDrawBatch* CreateWithPerspective(GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkRect* localRect,
- const SkMatrix* localMatrix) {
- NonAAFillRectPerspectiveBatch* batch = NonAAFillRectPerspectiveBatch::Create();
- append_to_batch(batch, color, viewMatrix, rect, localRect, localMatrix);
batch->init();
return batch;
}
-bool Append(GrBatch* origBatch,
- GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkRect* localRect,
- const SkMatrix* localMatrix) {
- bool usePerspective = viewMatrix.hasPerspective() ||
- (localMatrix && localMatrix->hasPerspective());
-
- if (usePerspective && origBatch->classID() != NonAAFillRectPerspectiveBatch::ClassID()) {
- return false;
- }
-
- if (!usePerspective) {
- NonAAFillRectBatch* batch = origBatch->cast<NonAAFillRectBatch>();
- append_to_batch(batch, color, viewMatrix, rect, localRect, localMatrix);
- batch->updateBoundsAfterAppend();
- } else {
- NonAAFillRectPerspectiveBatch* batch = origBatch->cast<NonAAFillRectPerspectiveBatch>();
- const NonAAFillRectPerspectiveBatch::Geometry& geo = batch->geoData()->back();
-
- if (!geo.fViewMatrix.cheapEqualTo(viewMatrix) ||
- geo.fHasLocalRect != SkToBool(localRect) ||
- geo.fHasLocalMatrix != SkToBool(localMatrix) ||
- (geo.fHasLocalMatrix && !geo.fLocalMatrix.cheapEqualTo(*localMatrix))) {
- return false;
- }
-
- append_to_batch(batch, color, viewMatrix, rect, localRect, localMatrix);
- batch->updateBoundsAfterAppend();
- }
-
- return true;
-}
-
};
///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/batches/GrNonAAFillRectBatch.h b/src/gpu/batches/GrNonAAFillRectBatch.h
index aeb388f510..ac28d0fb46 100644
--- a/src/gpu/batches/GrNonAAFillRectBatch.h
+++ b/src/gpu/batches/GrNonAAFillRectBatch.h
@@ -28,12 +28,6 @@ GrDrawBatch* CreateWithPerspective(GrColor color,
const SkRect* localRect,
const SkMatrix* localMatrix);
-bool Append(GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkRect* localRect,
- const SkMatrix* localMatrix);
-
};
#endif