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

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

Issue 2106283003: Remove unused batch rect append functions (Closed) Base URL: https://chromium.googlesource.com/skia.git@rectgeoms
Patch Set: Created 4 years, 6 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 | « src/gpu/batches/GrNonAAFillRectBatch.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrNonAAFillRectBatch.cpp
diff --git a/src/gpu/batches/GrNonAAFillRectBatch.cpp b/src/gpu/batches/GrNonAAFillRectBatch.cpp
index 186c935c703fc905dc8f92bbbce21968a041fd7d..b9865740a2a2ec0aee0b443b2b3f15481b2c7b80 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;
-}
-
};
///////////////////////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/gpu/batches/GrNonAAFillRectBatch.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698