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

Side by Side Diff: src/effects/SkPictureImageFilter.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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698