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

Side by Side Diff: src/gpu/effects/GrSingleTextureEffect.h

Issue 654313002: Auto-compare GrProcessors' texture accesses in isEqual(). (Closed) Base URL: https://skia.googlesource.com/skia.git@xformcomp
Patch Set: update 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/gpu/effects/GrSimpleTextureEffect.h ('k') | src/gpu/effects/GrTextureDomain.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 2012 Google Inc. 2 * Copyright 2012 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 #ifndef GrSingleTextureEffect_DEFINED 8 #ifndef GrSingleTextureEffect_DEFINED
9 #define GrSingleTextureEffect_DEFINED 9 #define GrSingleTextureEffect_DEFINED
10 10
(...skipping 16 matching lines...) Expand all
27 GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrCoordSet = kLocal_GrCoo rdSet); 27 GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrCoordSet = kLocal_GrCoo rdSet);
28 /** clamp mode */ 28 /** clamp mode */
29 GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrTextureParams::FilterMo de filterMode, 29 GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrTextureParams::FilterMo de filterMode,
30 GrCoordSet = kLocal_GrCoordSet); 30 GrCoordSet = kLocal_GrCoordSet);
31 GrSingleTextureEffect(GrTexture*, 31 GrSingleTextureEffect(GrTexture*,
32 const SkMatrix&, 32 const SkMatrix&,
33 const GrTextureParams&, 33 const GrTextureParams&,
34 GrCoordSet = kLocal_GrCoordSet); 34 GrCoordSet = kLocal_GrCoordSet);
35 35
36 /** 36 /**
37 * Helper for subclass onIsEqual() functions.
38 */
39 bool hasSameTextureParamsMatrixAndSourceCoords(const GrSingleTextureEffect& other) const {
40 // We don't have to check the accesses' swizzles because they are inferr ed from the texture.
41 return fTextureAccess == other.fTextureAccess;
42 }
43
44 /**
45 * Can be used as a helper to implement subclass onComputeInvariantOutput(). It assumes that 37 * Can be used as a helper to implement subclass onComputeInvariantOutput(). It assumes that
46 * the subclass output color will be a modulation of the input color with a value read from the 38 * the subclass output color will be a modulation of the input color with a value read from the
47 * texture. 39 * texture.
48 */ 40 */
49 void updateInvariantOutputForModulation(InvariantOutput* inout) const { 41 void updateInvariantOutputForModulation(InvariantOutput* inout) const {
50 if (GrPixelConfigIsOpaque(this->texture(0)->config())) { 42 if (GrPixelConfigIsOpaque(this->texture(0)->config())) {
51 inout->mulByUnknownOpaqueColor(); 43 inout->mulByUnknownOpaqueColor();
52 } else { 44 } else {
53 inout->mulByUnknownColor(); 45 inout->mulByUnknownColor();
54 } 46 }
55 } 47 }
56 48
57 private: 49 private:
58 GrCoordTransform fCoordTransform; 50 GrCoordTransform fCoordTransform;
59 GrTextureAccess fTextureAccess; 51 GrTextureAccess fTextureAccess;
60 52
61 typedef GrFragmentProcessor INHERITED; 53 typedef GrFragmentProcessor INHERITED;
62 }; 54 };
63 55
64 #endif 56 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.h ('k') | src/gpu/effects/GrTextureDomain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698