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

Unified Diff: src/gpu/GrInOrderDrawBuffer.cpp

Issue 1121463002: Move bounds to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 8 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
Index: src/gpu/GrInOrderDrawBuffer.cpp
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index cb1e741ec44ec704c194403ca782dc13583ccaf9..1e38762ab4395697dc4edf1a5daeb88964196668 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -212,6 +212,9 @@ private:
RectBatch(const Geometry& geometry) {
this->initClassID<RectBatch>();
fGeoData.push_back(geometry);
+
+ this->setBounds(geometry.fRect);
+ geometry.fViewMatrix.mapRect(this->getBounds());
}
GrColor color() const { return fBatch.fColor; }
@@ -248,6 +251,7 @@ private:
fBatch.fColor = GrColor_ILLEGAL;
}
fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin());
+ this->joinBounds(that->bounds());
return true;
}
@@ -291,10 +295,7 @@ void GrInOrderDrawBuffer::onDrawRect(GrPipelineBuilder* pipelineBuilder,
}
SkAutoTUnref<GrBatch> batch(RectBatch::Create(geometry));
-
- SkRect bounds = rect;
- viewMatrix.mapRect(&bounds);
- this->drawBatch(pipelineBuilder, batch, &bounds);
+ this->drawBatch(pipelineBuilder, batch);
}
void GrInOrderDrawBuffer::onDrawBatch(GrBatch* batch,

Powered by Google App Engine
This is Rietveld 408576698