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

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 502533004: Revert of Make setVertexAttribs in GrDrawState take a stride parameter. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/GrDrawState.cpp ('k') | src/gpu/GrInOrderDrawBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 9605781d34d62f625fcb2c46efeff0d8238ed9b1..2d27859c3ee5fd61aef50ac5e64300e2dc66ac09 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -195,10 +195,10 @@
int indexCount,
void** vertices,
void** indices) {
- size_t vertexStride = this->drawState()->getVertexStride();
+ size_t vertexSize = this->drawState()->getVertexSize();
this->willReserveVertexAndIndexSpace(vertexCount, indexCount);
if (vertexCount) {
- if (!this->reserveVertexSpace(vertexStride, vertexCount, vertices)) {
+ if (!this->reserveVertexSpace(vertexSize, vertexCount, vertices)) {
if (indexCount) {
this->resetIndexSource();
}
@@ -278,7 +278,7 @@
this->releasePreviousVertexSource();
GeometrySrcState& geoSrc = fGeoSrcStateStack.back();
geoSrc.fVertexSrc = kArray_GeometrySrcType;
- geoSrc.fVertexSize = this->drawState()->getVertexStride();
+ geoSrc.fVertexSize = this->drawState()->getVertexSize();
geoSrc.fVertexCount = vertexCount;
this->onSetVertexSourceToArray(vertexArray, vertexCount);
}
@@ -298,7 +298,7 @@
geoSrc.fVertexSrc = kBuffer_GeometrySrcType;
geoSrc.fVertexBuffer = buffer;
buffer->ref();
- geoSrc.fVertexSize = this->drawState()->getVertexStride();
+ geoSrc.fVertexSize = this->drawState()->getVertexSize();
}
void GrDrawTarget::setIndexSourceToBuffer(const GrIndexBuffer* buffer) {
@@ -673,9 +673,9 @@
void set_vertex_attributes(GrDrawState* drawState, bool hasUVs) {
if (hasUVs) {
- drawState->setVertexAttribs<gBWRectPosUVAttribs>(2, 2 * sizeof(SkPoint));
+ drawState->setVertexAttribs<gBWRectPosUVAttribs>(2);
} else {
- drawState->setVertexAttribs<gBWRectPosUVAttribs>(1, sizeof(SkPoint));
+ drawState->setVertexAttribs<gBWRectPosUVAttribs>(1);
}
}
@@ -693,16 +693,16 @@
return;
}
- size_t vstride = this->drawState()->getVertexStride();
- geo.positions()->setRectFan(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, vstride);
+ size_t vsize = this->drawState()->getVertexSize();
+ geo.positions()->setRectFan(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, vsize);
if (NULL != localRect) {
SkPoint* coords = GrTCast<SkPoint*>(GrTCast<intptr_t>(geo.vertices()) +
sizeof(SkPoint));
coords->setRectFan(localRect->fLeft, localRect->fTop,
localRect->fRight, localRect->fBottom,
- vstride);
+ vsize);
if (NULL != localMatrix) {
- localMatrix->mapPointsWithStride(coords, vstride, 4);
+ localMatrix->mapPointsWithStride(coords, vsize, 4);
}
}
SkRect bounds;
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | src/gpu/GrInOrderDrawBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698