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

Side by Side Diff: src/effects/SkDropShadowImageFilter.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 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkDropShadowImageFilter.h" 8 #include "SkDropShadowImageFilter.h"
9 9
10 #include "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 SkScalar sigmaY = buffer.readScalar(); 46 SkScalar sigmaY = buffer.readScalar();
47 SkColor color = buffer.readColor(); 47 SkColor color = buffer.readColor();
48 ShadowMode shadowMode = buffer.isVersionLT(SkReadBuffer::kDropShadowMode_Ver sion) ? 48 ShadowMode shadowMode = buffer.isVersionLT(SkReadBuffer::kDropShadowMode_Ver sion) ?
49 kDrawShadowAndForeground_ShadowMode : 49 kDrawShadowAndForeground_ShadowMode :
50 static_cast<ShadowMode>(buffer.readInt()); 50 static_cast<ShadowMode>(buffer.readInt());
51 return Make(dx, dy, sigmaX, sigmaY, color, shadowMode, common.getInput(0), & common.cropRect()); 51 return Make(dx, dy, sigmaX, sigmaY, color, shadowMode, common.getInput(0), & common.cropRect());
52 } 52 }
53 53
54 void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const { 54 void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const {
55 this->INHERITED::flatten(buffer); 55 this->INHERITED::flatten(buffer);
56 buffer.writeScalar(fDx); 56 buffer.writeScalar("fDx", fDx);
57 buffer.writeScalar(fDy); 57 buffer.writeScalar("fDy", fDy);
58 buffer.writeScalar(fSigmaX); 58 buffer.writeScalar("fSigmaX", fSigmaX);
59 buffer.writeScalar(fSigmaY); 59 buffer.writeScalar("fSigmaY", fSigmaY);
60 buffer.writeColor(fColor); 60 buffer.writeColor("fColor", fColor);
61 buffer.writeInt(static_cast<int>(fShadowMode)); 61 buffer.writeInt("fShadowMode", static_cast<int>(fShadowMode));
62 } 62 }
63 63
64 sk_sp<SkSpecialImage> SkDropShadowImageFilter::onFilterImage(SkSpecialImage* sou rce, 64 sk_sp<SkSpecialImage> SkDropShadowImageFilter::onFilterImage(SkSpecialImage* sou rce,
65 const Context& ctx, 65 const Context& ctx,
66 SkIPoint* offset) c onst { 66 SkIPoint* offset) c onst {
67 SkIPoint inputOffset = SkIPoint::Make(0, 0); 67 SkIPoint inputOffset = SkIPoint::Make(0, 0);
68 sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset)) ; 68 sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset)) ;
69 if (!input) { 69 if (!input) {
70 return nullptr; 70 return nullptr;
71 } 71 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 "kDrawShadowAndForeground", "kDrawShadowOnly" 163 "kDrawShadowAndForeground", "kDrawShadowOnly"
164 }; 164 };
165 165
166 static_assert(kShadowModeCount == SK_ARRAY_COUNT(gModeStrings), "enum_mismat ch"); 166 static_assert(kShadowModeCount == SK_ARRAY_COUNT(gModeStrings), "enum_mismat ch");
167 167
168 str->appendf(" mode: %s", gModeStrings[fShadowMode]); 168 str->appendf(" mode: %s", gModeStrings[fShadowMode]);
169 169
170 str->append(")"); 170 str->append(")");
171 } 171 }
172 #endif 172 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698