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

Unified Diff: src/core/SkLightingShader.cpp

Issue 1911963008: DNC - JSON of flattenables, with field names. Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add names to call sites Created 4 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/core/SkLightingShader.cpp
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp
index f37f664d9859a537ff1f30a2550c552a90b74680..3796d7485a98493474c9dcb204e203784b8fbba0 100644
--- a/src/core/SkLightingShader.cpp
+++ b/src/core/SkLightingShader.cpp
@@ -619,27 +619,27 @@ void SkLightingShaderImpl::flatten(SkWriteBuffer& buf) const {
this->INHERITED::flatten(buf);
bool hasNormLocalM = !fNormLocalMatrix.isIdentity();
- buf.writeBool(hasNormLocalM);
+ buf.writeBool(SK_STRING_AND_VALUE(hasNormLocalM));
if (hasNormLocalM) {
- buf.writeMatrix(fNormLocalMatrix);
+ buf.writeMatrix(SK_STRING_AND_VALUE(fNormLocalMatrix));
}
- buf.writeBitmap(fDiffuseMap);
- buf.writeBitmap(fNormalMap);
+ buf.writeBitmap(SK_STRING_AND_VALUE(fDiffuseMap));
+ buf.writeBitmap(SK_STRING_AND_VALUE(fNormalMap));
- buf.writeInt(fLights->numLights());
+ buf.writeInt("numLights", fLights->numLights());
for (int l = 0; l < fLights->numLights(); ++l) {
const SkLight& light = fLights->light(l);
bool isAmbient = SkLight::kAmbient_LightType == light.type();
- buf.writeBool(isAmbient);
- buf.writeScalarArray(&light.color().fX, 3);
+ buf.writeBool(SK_STRING_AND_VALUE(isAmbient));
+ buf.writeScalarArray("lightColor", &light.color().fX, 3);
if (!isAmbient) {
- buf.writeScalarArray(&light.dir().fX, 3);
+ buf.writeScalarArray("lightDir", &light.dir().fX, 3);
}
}
- buf.writePoint(fInvNormRotation);
+ buf.writePoint(SK_STRING_AND_VALUE(fInvNormRotation));
}
bool SkLightingShaderImpl::computeNormTotalInverse(const ContextRec& rec,

Powered by Google App Engine
This is Rietveld 408576698