aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/core/SkPicture.h3
-rw-r--r--src/core/SkLightingShader.cpp8
-rw-r--r--src/core/SkReadBuffer.h1
-rw-r--r--tools/dm_flags.json60
-rwxr-xr-xtools/dm_flags.py1
5 files changed, 10 insertions, 63 deletions
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index 808944b5ef..78067b3a89 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -206,10 +206,11 @@ private:
// V42: Added a bool to SkPictureShader serialization to indicate did-we-serialize-a-picture?
// V43: Added DRAW_IMAGE and DRAW_IMAGE_RECT opt codes to serialized data
// V44: Move annotations from paint to drawAnnotation
+ // V45: Add invNormRotation to SkLightingShader.
// Only SKPs within the min/current picture version range (inclusive) can be read.
static const uint32_t MIN_PICTURE_VERSION = 35; // Produced by Chrome M39.
- static const uint32_t CURRENT_PICTURE_VERSION = 44;
+ static const uint32_t CURRENT_PICTURE_VERSION = 45;
static_assert(MIN_PICTURE_VERSION <= 41,
"Remove kFontFileName and related code from SkFontDescriptor.cpp.");
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp
index eba7d652eb..bc47af60ee 100644
--- a/src/core/SkLightingShader.cpp
+++ b/src/core/SkLightingShader.cpp
@@ -606,7 +606,12 @@ sk_sp<SkFlattenable> SkLightingShaderImpl::CreateProc(SkReadBuffer& buf) {
SkAutoTUnref<const SkLightingShader::Lights> lights(builder.finish());
- return sk_make_sp<SkLightingShaderImpl>(diffuse, normal, lights, SkVector::Make(1.0f, 0.0f),
+ SkVector invNormRotation = {1,0};
+ if (!buf.isVersionLT(SkReadBuffer::kLightingShaderWritesInvNormRotation)) {
+ invNormRotation = buf.readPoint();
+ }
+
+ return sk_make_sp<SkLightingShaderImpl>(diffuse, normal, lights, invNormRotation,
&diffLocalM, &normLocalM);
}
@@ -634,6 +639,7 @@ void SkLightingShaderImpl::flatten(SkWriteBuffer& buf) const {
buf.writeScalarArray(&light.dir().fX, 3);
}
}
+ buf.writePoint(fInvNormRotation);
}
bool SkLightingShaderImpl::computeNormTotalInverse(const ContextRec& rec,
diff --git a/src/core/SkReadBuffer.h b/src/core/SkReadBuffer.h
index e77d1adfe3..faf853aef5 100644
--- a/src/core/SkReadBuffer.h
+++ b/src/core/SkReadBuffer.h
@@ -61,6 +61,7 @@ public:
kPictureShaderHasPictureBool_Version = 42,
kHasDrawImageOpCodes_Version = 43,
kAnnotationsMovedToCanvas_Version = 44,
+ kLightingShaderWritesInvNormRotation = 45,
};
/**
diff --git a/tools/dm_flags.json b/tools/dm_flags.json
index 7a45492d9d..d636c37beb 100644
--- a/tools/dm_flags.json
+++ b/tools/dm_flags.json
@@ -133,10 +133,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -293,10 +289,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -550,10 +542,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -805,10 +793,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -1063,10 +1047,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -1314,10 +1294,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -1567,10 +1543,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -1816,10 +1788,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -2012,10 +1980,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -2301,10 +2265,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -2466,10 +2426,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -2634,10 +2590,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -2819,10 +2771,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -3003,10 +2951,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
@@ -3313,10 +3257,6 @@
"serialize-8888",
"gm",
"_",
- "lightingshader",
- "serialize-8888",
- "gm",
- "_",
"verylargebitmap",
"serialize-8888",
"gm",
diff --git a/tools/dm_flags.py b/tools/dm_flags.py
index 688d1ac8c1..41a8510f76 100755
--- a/tools/dm_flags.py
+++ b/tools/dm_flags.py
@@ -167,7 +167,6 @@ def get_args(bot):
'fontmgr_bounds',
'fontmgr_match',
'fontmgr_iter',
- 'lightingshader',
'verylargebitmap', # Windows only.
'verylarge_picture_image']: # Windows only.
blacklist.extend(['serialize-8888', 'gm', '_', test])