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

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

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 7 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.cpp ('k') | src/gpu/effects/GrSingleTextureEffect.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
11 #include "GrFragmentProcessor.h" 11 #include "GrFragmentProcessor.h"
12 #include "GrCoordTransform.h" 12 #include "GrCoordTransform.h"
13 #include "GrInvariantOutput.h" 13 #include "GrInvariantOutput.h"
14 #include "SkMatrix.h" 14 #include "SkMatrix.h"
15 15
16 class GrTexture; 16 class GrTexture;
17 17
18 /** 18 /**
19 * A base class for effects that draw a single texture with a texture matrix. Th is effect has no 19 * A base class for effects that draw a single texture with a texture matrix. Th is effect has no
20 * backend implementations. One must be provided by the subclass. 20 * backend implementations. One must be provided by the subclass.
21 */ 21 */
22 class GrSingleTextureEffect : public GrFragmentProcessor { 22 class GrSingleTextureEffect : public GrFragmentProcessor {
23 public: 23 public:
24 virtual ~GrSingleTextureEffect(); 24 virtual ~GrSingleTextureEffect();
25 25
26 protected: 26 protected:
27 /** unfiltered, clamp mode */ 27 /** unfiltered, clamp mode */
28 GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrCoordSet = kLocal_GrCoo rdSet); 28 GrSingleTextureEffect(GrTexture*, const SkMatrix&,
29 GrCoordSet,// = kLocal_GrCoordSet);
30 GrRenderTarget* dst);
29 /** clamp mode */ 31 /** clamp mode */
30 GrSingleTextureEffect(GrTexture*, const SkMatrix&, GrTextureParams::FilterMo de filterMode, 32 GrSingleTextureEffect(GrTexture*, const SkMatrix&,
31 GrCoordSet = kLocal_GrCoordSet); 33 GrTextureParams::FilterMode filterMode,
34 GrCoordSet, // = kLocal_GrCoordSet);
35 GrRenderTarget* dst);
32 GrSingleTextureEffect(GrTexture*, 36 GrSingleTextureEffect(GrTexture*,
33 const SkMatrix&, 37 const SkMatrix&,
34 const GrTextureParams&, 38 const GrTextureParams&,
35 GrCoordSet = kLocal_GrCoordSet); 39 GrCoordSet, // = kLocal_GrCoordSet);
40 GrRenderTarget* dst);
36 41
37 /** 42 /**
38 * Can be used as a helper to implement subclass onComputeInvariantOutput(). It assumes that 43 * Can be used as a helper to implement subclass onComputeInvariantOutput(). It assumes that
39 * the subclass output color will be a modulation of the input color with a value read from the 44 * the subclass output color will be a modulation of the input color with a value read from the
40 * texture. 45 * texture.
41 */ 46 */
42 void updateInvariantOutputForModulation(GrInvariantOutput* inout) const { 47 void updateInvariantOutputForModulation(GrInvariantOutput* inout) const {
43 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) { 48 if (GrPixelConfigIsAlphaOnly(this->texture(0)->config())) {
44 inout->mulByUnknownSingleComponent(); 49 inout->mulByUnknownSingleComponent();
45 } else if (GrPixelConfigIsOpaque(this->texture(0)->config())) { 50 } else if (GrPixelConfigIsOpaque(this->texture(0)->config())) {
46 inout->mulByUnknownOpaqueFourComponents(); 51 inout->mulByUnknownOpaqueFourComponents();
47 } else { 52 } else {
48 inout->mulByUnknownFourComponents(); 53 inout->mulByUnknownFourComponents();
49 } 54 }
50 } 55 }
51 56
52 private: 57 private:
53 GrCoordTransform fCoordTransform; 58 GrCoordTransform fCoordTransform;
54 GrTextureAccess fTextureAccess; 59 GrTextureAccess fTextureAccess;
55 60
56 typedef GrFragmentProcessor INHERITED; 61 typedef GrFragmentProcessor INHERITED;
57 }; 62 };
58 63
59 #endif 64 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrSimpleTextureEffect.cpp ('k') | src/gpu/effects/GrSingleTextureEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698