| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 The Android Open Source Project | 2 * Copyright 2013 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkPictureImageFilter.h" | 8 #include "SkPictureImageFilter.h" |
| 9 | 9 |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } else { | 80 } else { |
| 81 filterQuality = (SkFilterQuality)buffer.readInt(); | 81 filterQuality = (SkFilterQuality)buffer.readInt(); |
| 82 } | 82 } |
| 83 return MakeForLocalSpace(picture, cropRect, filterQuality); | 83 return MakeForLocalSpace(picture, cropRect, filterQuality); |
| 84 } | 84 } |
| 85 return Make(picture, cropRect); | 85 return Make(picture, cropRect); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const { | 88 void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const { |
| 89 if (buffer.isCrossProcess() && SkPicture::PictureIOSecurityPrecautionsEnable
d()) { | 89 if (buffer.isCrossProcess() && SkPicture::PictureIOSecurityPrecautionsEnable
d()) { |
| 90 buffer.writeBool(false); | 90 buffer.writeBool("hasPicture", false); |
| 91 } else { | 91 } else { |
| 92 bool hasPicture = (fPicture != nullptr); | 92 bool hasPicture = (fPicture != nullptr); |
| 93 buffer.writeBool(hasPicture); | 93 buffer.writeBool("hasPicture", hasPicture); |
| 94 if (hasPicture) { | 94 if (hasPicture) { |
| 95 fPicture->flatten(buffer); | 95 fPicture->flatten(buffer); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 buffer.writeRect(fCropRect); | 98 buffer.writeRect("fCropRect", fCropRect); |
| 99 buffer.writeInt(fPictureResolution); | 99 buffer.writeInt("fPictureResolution", fPictureResolution); |
| 100 if (kLocalSpace_PictureResolution == fPictureResolution) { | 100 if (kLocalSpace_PictureResolution == fPictureResolution) { |
| 101 buffer.writeInt(fFilterQuality); | 101 buffer.writeInt("fFilterQuality", fFilterQuality); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 sk_sp<SkSpecialImage> SkPictureImageFilter::onFilterImage(SkSpecialImage* source
, | 105 sk_sp<SkSpecialImage> SkPictureImageFilter::onFilterImage(SkSpecialImage* source
, |
| 106 const Context& ctx, | 106 const Context& ctx, |
| 107 SkIPoint* offset) cons
t { | 107 SkIPoint* offset) cons
t { |
| 108 if (!fPicture) { | 108 if (!fPicture) { |
| 109 return nullptr; | 109 return nullptr; |
| 110 } | 110 } |
| 111 | 111 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 str->appendf("crop: (%f,%f,%f,%f) ", | 205 str->appendf("crop: (%f,%f,%f,%f) ", |
| 206 fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fB
ottom); | 206 fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fB
ottom); |
| 207 if (fPicture) { | 207 if (fPicture) { |
| 208 str->appendf("picture: (%f,%f,%f,%f)", | 208 str->appendf("picture: (%f,%f,%f,%f)", |
| 209 fPicture->cullRect().fLeft, fPicture->cullRect().fTop, | 209 fPicture->cullRect().fLeft, fPicture->cullRect().fTop, |
| 210 fPicture->cullRect().fRight, fPicture->cullRect().fBottom); | 210 fPicture->cullRect().fRight, fPicture->cullRect().fBottom); |
| 211 } | 211 } |
| 212 str->append(")"); | 212 str->append(")"); |
| 213 } | 213 } |
| 214 #endif | 214 #endif |
| OLD | NEW |