OLD | NEW |
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 #include "SkDevice.h" | 9 #include "SkDevice.h" |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector() const | 345 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector() const |
346 { return fXChannelSelector; } | 346 { return fXChannelSelector; } |
347 SkDisplacementMapEffect::ChannelSelectorType yChannelSelector() const | 347 SkDisplacementMapEffect::ChannelSelectorType yChannelSelector() const |
348 { return fYChannelSelector; } | 348 { return fYChannelSelector; } |
349 const SkVector& scale() const { return fScale; } | 349 const SkVector& scale() const { return fScale; } |
350 | 350 |
351 const char* name() const override { return "DisplacementMap"; } | 351 const char* name() const override { return "DisplacementMap"; } |
352 const GrTextureDomain& domain() const { return fDomain; } | 352 const GrTextureDomain& domain() const { return fDomain; } |
353 | 353 |
354 private: | 354 private: |
355 GrGLSLFragmentProcessor* onCreateGLInstance() const override { | 355 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override { |
356 return new GrGLDisplacementMapEffect(*this); | 356 return new GrGLDisplacementMapEffect(*this); |
357 } | 357 } |
358 | 358 |
359 virtual void onGetGLProcessorKey(const GrGLSLCaps& caps, | 359 virtual void onGetGLSLProcessorKey(const GrGLSLCaps& caps, |
360 GrProcessorKeyBuilder* b) const override { | 360 GrProcessorKeyBuilder* b) const override
{ |
361 GrGLDisplacementMapEffect::GenKey(*this, caps, b); | 361 GrGLDisplacementMapEffect::GenKey(*this, caps, b); |
362 } | 362 } |
363 | 363 |
364 bool onIsEqual(const GrFragmentProcessor&) const override; | 364 bool onIsEqual(const GrFragmentProcessor&) const override; |
365 | 365 |
366 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; | 366 void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
367 | 367 |
368 GrDisplacementMapEffect(SkDisplacementMapEffect::ChannelSelectorType xChanne
lSelector, | 368 GrDisplacementMapEffect(SkDisplacementMapEffect::ChannelSelectorType xChanne
lSelector, |
369 SkDisplacementMapEffect::ChannelSelectorType yChanne
lSelector, | 369 SkDisplacementMapEffect::ChannelSelectorType yChanne
lSelector, |
370 const SkVector& scale, | 370 const SkVector& scale, |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 const GrGLSLCaps&, GrProcessorKeyBuilder*
b) { | 628 const GrGLSLCaps&, GrProcessorKeyBuilder*
b) { |
629 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap
Effect>(); | 629 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap
Effect>(); |
630 | 630 |
631 uint32_t xKey = displacementMap.xChannelSelector(); | 631 uint32_t xKey = displacementMap.xChannelSelector(); |
632 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit
s; | 632 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit
s; |
633 | 633 |
634 b->add32(xKey | yKey); | 634 b->add32(xKey | yKey); |
635 } | 635 } |
636 #endif | 636 #endif |
637 | 637 |
OLD | NEW |