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

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

Issue 1293583002: Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove duplicated fields in GrVertexBatch 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 | « src/gpu/batches/GrAAFillRectBatch.h ('k') | src/gpu/batches/GrAAStrokeRectBatch.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 4cea65ac56451dd309d068a3ebb01b6cad305989..9b190283ffc68572ad64396842aaa1c782ac81d8 100644
--- a/src/gpu/batches/GrAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrAAFillRectBatch.cpp
@@ -62,7 +62,7 @@ const GrIndexBuffer* get_index_buffer(GrResourceProvider* resourceProvider) {
* SkPoint* fan0Position, const Geometry&)
*/
template <typename Base>
-class AAFillRectBatch : public GrBatch {
+class AAFillRectBatch : public GrVertexBatch {
public:
typedef typename Base::Geometry Geometry;
@@ -165,12 +165,12 @@ private:
bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
- if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline(), t->bounds(),
- caps)) {
+ AAFillRectBatch* that = t->cast<AAFillRectBatch>();
+ if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
+ that->bounds(), caps)) {
return false;
}
- AAFillRectBatch* that = t->cast<AAFillRectBatch>();
if (!Base::CanCombineLocalCoords(this->viewMatrix(), that->viewMatrix(),
this->usesLocalCoords())) {
return false;
@@ -399,10 +399,10 @@ typedef AAFillRectBatch<AAFillRectBatchLocalMatrixImp> AAFillRectBatchLocalMatri
namespace GrAAFillRectBatch {
-GrBatch* Create(GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkRect& devRect) {
+GrDrawBatch* Create(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ const SkRect& devRect) {
AAFillRectBatchNoLocalMatrix* batch = AAFillRectBatchNoLocalMatrix::Create();
AAFillRectBatchNoLocalMatrix::Geometry& geo = *batch->geometry();
geo.fColor = color;
@@ -412,11 +412,11 @@ GrBatch* Create(GrColor color,
return batch;
}
-GrBatch* Create(GrColor color,
- const SkMatrix& viewMatrix,
- const SkMatrix& localMatrix,
- const SkRect& rect,
- const SkRect& devRect) {
+GrDrawBatch* Create(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkMatrix& localMatrix,
+ const SkRect& rect,
+ const SkRect& devRect) {
AAFillRectBatchLocalMatrix* batch = AAFillRectBatchLocalMatrix::Create();
AAFillRectBatchLocalMatrix::Geometry& geo = *batch->geometry();
geo.fColor = color;
@@ -435,7 +435,7 @@ GrBatch* Create(GrColor color,
#include "GrBatchTest.h"
-BATCH_TEST_DEFINE(AAFillRectBatch) {
+DRAW_BATCH_TEST_DEFINE(AAFillRectBatch) {
AAFillRectBatchNoLocalMatrix* batch = AAFillRectBatchNoLocalMatrix::Create();
AAFillRectBatchNoLocalMatrix::Geometry& geo = *batch->geometry();
geo.fColor = GrRandomColor(random);
@@ -445,7 +445,7 @@ BATCH_TEST_DEFINE(AAFillRectBatch) {
return batch;
}
-BATCH_TEST_DEFINE(AAFillRectBatchLocalMatrix) {
+DRAW_BATCH_TEST_DEFINE(AAFillRectBatchLocalMatrix) {
AAFillRectBatchLocalMatrix* batch = AAFillRectBatchLocalMatrix::Create();
AAFillRectBatchLocalMatrix::Geometry& geo = *batch->geometry();
geo.fColor = GrRandomColor(random);
« no previous file with comments | « src/gpu/batches/GrAAFillRectBatch.h ('k') | src/gpu/batches/GrAAStrokeRectBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698