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

Side by Side Diff: src/effects/SkDisplacementMapEffect.cpp

Issue 1316513002: Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* (Closed) Base URL: https://skia.googlesource.com/skia.git@things
Patch Set: Address comments, fix roll(?) Created 5 years, 3 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
« no previous file with comments | « src/effects/SkColorMatrixFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "SkReadBuffer.h" 9 #include "SkReadBuffer.h"
10 #include "SkWriteBuffer.h" 10 #include "SkWriteBuffer.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 // and no displacement offset push any texture coordinates out of bounds OR if the constant 510 // and no displacement offset push any texture coordinates out of bounds OR if the constant
511 // alpha is 0. Since this isn't trivial to compute at this point, let's assu me the output is 511 // alpha is 0. Since this isn't trivial to compute at this point, let's assu me the output is
512 // not of constant color when a displacement effect is applied. 512 // not of constant color when a displacement effect is applied.
513 inout->setToUnknown(GrInvariantOutput::kWillNot_ReadInput); 513 inout->setToUnknown(GrInvariantOutput::kWillNot_ReadInput);
514 } 514 }
515 515
516 /////////////////////////////////////////////////////////////////////////////// 516 ///////////////////////////////////////////////////////////////////////////////
517 517
518 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDisplacementMapEffect); 518 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDisplacementMapEffect);
519 519
520 GrFragmentProcessor* GrDisplacementMapEffect::TestCreate(GrProcessorTestData* d) { 520 const GrFragmentProcessor* GrDisplacementMapEffect::TestCreate(GrProcessorTestDa ta* d) {
521 int texIdxDispl = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextu reIdx : 521 int texIdxDispl = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextu reIdx :
522 GrProcessorUnitTest::kAlphaTextur eIdx; 522 GrProcessorUnitTest::kAlphaTextur eIdx;
523 int texIdxColor = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextu reIdx : 523 int texIdxColor = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextu reIdx :
524 GrProcessorUnitTest::kAlphaTextur eIdx; 524 GrProcessorUnitTest::kAlphaTextur eIdx;
525 static const int kMaxComponent = 4; 525 static const int kMaxComponent = 4;
526 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector = 526 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector =
527 static_cast<SkDisplacementMapEffect::ChannelSelectorType>( 527 static_cast<SkDisplacementMapEffect::ChannelSelectorType>(
528 d->fRandom->nextRangeU(1, kMaxComponent)); 528 d->fRandom->nextRangeU(1, kMaxComponent));
529 SkDisplacementMapEffect::ChannelSelectorType yChannelSelector = 529 SkDisplacementMapEffect::ChannelSelectorType yChannelSelector =
530 static_cast<SkDisplacementMapEffect::ChannelSelectorType>( 530 static_cast<SkDisplacementMapEffect::ChannelSelectorType>(
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 const GrGLSLCaps&, GrProcessorKeyBuilder* b) { 633 const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
634 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>(); 634 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>();
635 635
636 uint32_t xKey = displacementMap.xChannelSelector(); 636 uint32_t xKey = displacementMap.xChannelSelector();
637 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s; 637 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s;
638 638
639 b->add32(xKey | yKey); 639 b->add32(xKey | yKey);
640 } 640 }
641 #endif 641 #endif
642 642
OLDNEW
« no previous file with comments | « src/effects/SkColorMatrixFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698