aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGlobalInitialization_core.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-08-02 06:12:06 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-02 06:12:06 -0700
commit320a40d7733979703bdf675c31108255e011e34e (patch)
tree8e8fd8cdd89e9d2a7c4f39077e2429ee130cef64 /src/core/SkGlobalInitialization_core.cpp
parentd6dd44140d8dd6d18aba1dfe9edc5582dcd73d2f (diff)
Always return ImageShader, even from SkShader::MakeBitmapShader
Lessons learned 1. ImageShader (correctly) always compresses (typically via PNG) during serialization. This has the surprise results of - if the image was marked opaque, but has some non-opaque pixels (i.e. bug in blitter or caller), then compressing may "fix" those pixels, making the deserialized version draw differently. bug filed. - 565 compressess/decompresses to 8888 (at least on Mac), which draws differently (esp. under some filters). bug filed. 2. BitmapShader did not enforce a copy for mutable bitmaps, but ImageShader does (since it creates an Image). Thus the former would see subsequent changes to the pixels after shader creation, while the latter does not, hence the change to the BlitRow test to avoid this modify-after-create pattern. I sure hope this prev. behavior was a bug/undefined-behavior, since this CL changes that. BUG=skia:5595 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2195893002 Review-Url: https://codereview.chromium.org/2195893002
Diffstat (limited to 'src/core/SkGlobalInitialization_core.cpp')
-rw-r--r--src/core/SkGlobalInitialization_core.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/SkGlobalInitialization_core.cpp b/src/core/SkGlobalInitialization_core.cpp
index 022c4972c4..21c4d16c4a 100644
--- a/src/core/SkGlobalInitialization_core.cpp
+++ b/src/core/SkGlobalInitialization_core.cpp
@@ -29,13 +29,11 @@
*/
void SkFlattenable::PrivateInitializer::InitCore() {
// Shader
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapProcShader)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorFilterShader)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorShader)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColor4Shader)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeShader)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmptyShader)
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkImageShader)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLocalMatrixShader)
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureShader)
@@ -48,6 +46,8 @@ void SkFlattenable::PrivateInitializer::InitCore() {
// ColorFilter
SkColorFilter::InitializeFlattenables();
+ SkShader::InitializeFlattenables();
+
// Xfermode
SkXfermode::InitializeFlattenables();