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

Side by Side Diff: src/effects/SkDisplacementMapEffect.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 "SkDisplacementMapEffect.h" 8 #include "SkDisplacementMapEffect.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 ChannelSelectorType xsel = (ChannelSelectorType)buffer.readInt(); 199 ChannelSelectorType xsel = (ChannelSelectorType)buffer.readInt();
200 ChannelSelectorType ysel = (ChannelSelectorType)buffer.readInt(); 200 ChannelSelectorType ysel = (ChannelSelectorType)buffer.readInt();
201 SkScalar scale = buffer.readScalar(); 201 SkScalar scale = buffer.readScalar();
202 return Make(xsel, ysel, scale, 202 return Make(xsel, ysel, scale,
203 common.getInput(0), common.getInput(1), 203 common.getInput(0), common.getInput(1),
204 &common.cropRect()); 204 &common.cropRect());
205 } 205 }
206 206
207 void SkDisplacementMapEffect::flatten(SkWriteBuffer& buffer) const { 207 void SkDisplacementMapEffect::flatten(SkWriteBuffer& buffer) const {
208 this->INHERITED::flatten(buffer); 208 this->INHERITED::flatten(buffer);
209 buffer.writeInt((int) fXChannelSelector); 209 buffer.writeInt("ffXChannelSelector", (int) fXChannelSelector);
210 buffer.writeInt((int) fYChannelSelector); 210 buffer.writeInt("fYChannelSelector", (int) fYChannelSelector);
211 buffer.writeScalar(fScale); 211 buffer.writeScalar("fScale", fScale);
212 } 212 }
213 213
214 #if SK_SUPPORT_GPU 214 #if SK_SUPPORT_GPU
215 class GrDisplacementMapEffect : public GrFragmentProcessor { 215 class GrDisplacementMapEffect : public GrFragmentProcessor {
216 public: 216 public:
217 static GrFragmentProcessor* Create( 217 static GrFragmentProcessor* Create(
218 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector, 218 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector,
219 SkDisplacementMapEffect::ChannelSelectorType yChannelSelector, S kVector scale, 219 SkDisplacementMapEffect::ChannelSelectorType yChannelSelector, S kVector scale,
220 GrTexture* displacement, const SkMatrix& offsetMatrix, GrTexture * color, 220 GrTexture* displacement, const SkMatrix& offsetMatrix, GrTexture * color,
221 const SkISize& colorDimensions) { 221 const SkISize& colorDimensions) {
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 void GrGLDisplacementMapEffect::GenKey(const GrProcessor& proc, 626 void GrGLDisplacementMapEffect::GenKey(const GrProcessor& proc,
627 const GrGLSLCaps&, GrProcessorKeyBuilder* b) { 627 const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
628 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>(); 628 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>();
629 629
630 uint32_t xKey = displacementMap.xChannelSelector(); 630 uint32_t xKey = displacementMap.xChannelSelector();
631 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s; 631 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s;
632 632
633 b->add32(xKey | yKey); 633 b->add32(xKey | yKey);
634 } 634 }
635 #endif 635 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698