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

Unified Diff: src/gpu/GrDrawState.cpp

Issue 498483002: Store vertex size in DrawState when setVertexAttribs is called (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawState.cpp
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index ba5d62876c6936fdf5279e9dc2e5001e61090f68..66db3380e1fe41cce67ba8366cb74b49949ea51a 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -28,6 +28,7 @@ GrDrawState::CombinedState GrDrawState::CombineIfPossible(
a.fBlendConstant != b.fBlendConstant ||
a.fFlagBits != b.fFlagBits ||
a.fVACount != b.fVACount ||
+ a.fVertexSize != b.fVertexSize ||
bsalomon 2014/08/21 19:28:30 Do we need this? Or is this making the current cod
egdaniel 2014/08/21 21:30:30 It is not necessary for the current drawstate. Giv
memcmp(a.fVAPtr, b.fVAPtr, a.fVACount * sizeof(GrVertexAttrib)) ||
a.fStencilSettings != b.fStencilSettings ||
a.fDrawFace != b.fDrawFace) {
@@ -112,6 +113,7 @@ GrDrawState& GrDrawState::operator=(const GrDrawState& that) {
fFlagBits = that.fFlagBits;
fVACount = that.fVACount;
fVAPtr = that.fVAPtr;
+ fVertexSize = that.fVertexSize;
fStencilSettings = that.fStencilSettings;
fCoverage = that.fCoverage;
fDrawFace = that.fDrawFace;
@@ -236,7 +238,7 @@ static size_t vertex_size(const GrVertexAttrib* attribs, int count) {
}
size_t GrDrawState::getVertexSize() const {
- return vertex_size(fVAPtr, fVACount);
+ return fVertexSize;
}
////////////////////////////////////////////////////////////////////////////////
@@ -246,6 +248,7 @@ void GrDrawState::setVertexAttribs(const GrVertexAttrib* attribs, int count) {
fVAPtr = attribs;
fVACount = count;
+ fVertexSize = vertex_size(fVAPtr, fVACount);
// Set all the indices to -1
memset(fFixedFunctionVertexAttribIndices,
@@ -283,6 +286,7 @@ void GrDrawState::setDefaultVertexAttribs() {
fVAPtr = &kPositionAttrib;
fVACount = 1;
+ fVertexSize = GrVertexAttribTypeSize(kVec2f_GrVertexAttribType);
// set all the fixed function indices to -1 except position.
memset(fFixedFunctionVertexAttribIndices,
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698