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

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

Issue 656503002: Move willUseInputColor check to computeInvariantOutput (Closed) Base URL: https://skia.googlesource.com/skia.git@addMultFlag
Patch Set: Rebase2 Created 6 years, 2 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/SkLumaColorFilter.cpp ('k') | src/effects/SkTableColorFilter.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 "SkDither.h" 8 #include "SkDither.h"
9 #include "SkPerlinNoiseShader.h" 9 #include "SkPerlinNoiseShader.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 fNumOctaves == s.fNumOctaves && 580 fNumOctaves == s.fNumOctaves &&
581 fStitchTiles == s.fStitchTiles && 581 fStitchTiles == s.fStitchTiles &&
582 fCoordTransform.getMatrix() == s.fCoordTransform.getMatrix() && 582 fCoordTransform.getMatrix() == s.fCoordTransform.getMatrix() &&
583 fAlpha == s.fAlpha && 583 fAlpha == s.fAlpha &&
584 fPermutationsAccess.getTexture() == s.fPermutationsAccess.getText ure() && 584 fPermutationsAccess.getTexture() == s.fPermutationsAccess.getText ure() &&
585 fNoiseAccess.getTexture() == s.fNoiseAccess.getTexture() && 585 fNoiseAccess.getTexture() == s.fNoiseAccess.getTexture() &&
586 fPaintingData->fStitchDataInit == s.fPaintingData->fStitchDataIni t; 586 fPaintingData->fStitchDataInit == s.fPaintingData->fStitchDataIni t;
587 } 587 }
588 588
589 void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERRIDE { 589 void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERRIDE {
590 inout->setToUnknown(); 590 inout->setToUnknown(InvariantOutput::kWillNot_ReadInput);
591 } 591 }
592 592
593 GrPerlinNoiseEffect(SkPerlinNoiseShader::Type type, 593 GrPerlinNoiseEffect(SkPerlinNoiseShader::Type type,
594 int numOctaves, bool stitchTiles, 594 int numOctaves, bool stitchTiles,
595 SkPerlinNoiseShader::PaintingData* paintingData, 595 SkPerlinNoiseShader::PaintingData* paintingData,
596 GrTexture* permutationsTexture, GrTexture* noiseTexture, 596 GrTexture* permutationsTexture, GrTexture* noiseTexture,
597 const SkMatrix& matrix, uint8_t alpha) 597 const SkMatrix& matrix, uint8_t alpha)
598 : fType(type) 598 : fType(type)
599 , fNumOctaves(numOctaves) 599 , fNumOctaves(numOctaves)
600 , fStitchTiles(stitchTiles) 600 , fStitchTiles(stitchTiles)
601 , fAlpha(alpha) 601 , fAlpha(alpha)
602 , fPermutationsAccess(permutationsTexture) 602 , fPermutationsAccess(permutationsTexture)
603 , fNoiseAccess(noiseTexture) 603 , fNoiseAccess(noiseTexture)
604 , fPaintingData(paintingData) { 604 , fPaintingData(paintingData) {
605 this->addTextureAccess(&fPermutationsAccess); 605 this->addTextureAccess(&fPermutationsAccess);
606 this->addTextureAccess(&fNoiseAccess); 606 this->addTextureAccess(&fNoiseAccess);
607 fCoordTransform.reset(kLocal_GrCoordSet, matrix); 607 fCoordTransform.reset(kLocal_GrCoordSet, matrix);
608 this->addCoordTransform(&fCoordTransform); 608 this->addCoordTransform(&fCoordTransform);
609 this->setWillNotUseInputColor();
610 } 609 }
611 610
612 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; 611 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
613 612
614 SkPerlinNoiseShader::Type fType; 613 SkPerlinNoiseShader::Type fType;
615 GrCoordTransform fCoordTransform; 614 GrCoordTransform fCoordTransform;
616 int fNumOctaves; 615 int fNumOctaves;
617 bool fStitchTiles; 616 bool fStitchTiles;
618 uint8_t fAlpha; 617 uint8_t fAlpha;
619 GrTextureAccess fPermutationsAccess; 618 GrTextureAccess fPermutationsAccess;
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 str->append(" seed: "); 1052 str->append(" seed: ");
1054 str->appendScalar(fSeed); 1053 str->appendScalar(fSeed);
1055 str->append(" stitch tiles: "); 1054 str->append(" stitch tiles: ");
1056 str->append(fStitchTiles ? "true " : "false "); 1055 str->append(fStitchTiles ? "true " : "false ");
1057 1056
1058 this->INHERITED::toString(str); 1057 this->INHERITED::toString(str);
1059 1058
1060 str->append(")"); 1059 str->append(")");
1061 } 1060 }
1062 #endif 1061 #endif
OLDNEW
« no previous file with comments | « src/effects/SkLumaColorFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698