OLD | NEW |
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 GrTextureAccess_DEFINED | 8 #ifndef GrTextureAccess_DEFINED |
9 #define GrTextureAccess_DEFINED | 9 #define GrTextureAccess_DEFINED |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 public: | 24 public: |
25 /** | 25 /** |
26 * A default GrTextureAccess must have reset() called on it in a GrProcessor
subclass's | 26 * A default GrTextureAccess must have reset() called on it in a GrProcessor
subclass's |
27 * constructor if it will be accessible via GrProcessor::textureAccess(). | 27 * constructor if it will be accessible via GrProcessor::textureAccess(). |
28 */ | 28 */ |
29 GrTextureAccess(); | 29 GrTextureAccess(); |
30 | 30 |
31 /** | 31 /** |
32 * Uses the default swizzle, "rgba". | 32 * Uses the default swizzle, "rgba". |
33 */ | 33 */ |
34 GrTextureAccess(GrTexture*, const GrTextureParams&); | 34 GrTextureAccess(GrTexture*, const GrTextureParams&, GrRenderTarget* dst); |
35 explicit GrTextureAccess(GrTexture*, | 35 explicit GrTextureAccess(GrTexture*, |
36 GrTextureParams::FilterMode = GrTextureParams::kNon
e_FilterMode, | 36 GrTextureParams::FilterMode, // = GrTextureParams::
kNone_FilterMode, |
37 SkShader::TileMode tileXAndY = SkShader::kClamp_Til
eMode); | 37 SkShader::TileMode tileXAndY, // = SkShader::kClamp
_TileMode, |
| 38 GrRenderTarget* dst); |
38 | 39 |
39 /** | 40 /** |
40 * swizzle must be a string between one and four (inclusive) characters cont
aining only 'r', | 41 * swizzle must be a string between one and four (inclusive) characters cont
aining only 'r', |
41 * 'g', 'b', and/or 'a'. | 42 * 'g', 'b', and/or 'a'. |
42 */ | 43 */ |
43 GrTextureAccess(GrTexture*, const char* swizzle, const GrTextureParams&); | 44 GrTextureAccess(GrTexture*, const char* swizzle, const GrTextureParams&, GrR
enderTarget* dst); |
44 GrTextureAccess(GrTexture*, | 45 GrTextureAccess(GrTexture*, |
45 const char* swizzle, | 46 const char* swizzle, |
46 GrTextureParams::FilterMode = GrTextureParams::kNone_FilterM
ode, | 47 GrTextureParams::FilterMode, // = GrTextureParams::kNone_Fil
terMode, |
47 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode); | 48 SkShader::TileMode tileXAndY, // = SkShader::kClamp_TileMode
, |
| 49 GrRenderTarget* dst); |
48 | 50 |
49 void reset(GrTexture*, const GrTextureParams&); | 51 void reset(GrTexture*, const GrTextureParams&, GrRenderTarget* dst); |
50 void reset(GrTexture*, | 52 void reset(GrTexture*, |
51 GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode, | 53 GrTextureParams::FilterMode, // = GrTextureParams::kNone_FilterMo
de, |
52 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode); | 54 SkShader::TileMode tileXAndY, // = SkShader::kClamp_TileMode, |
53 void reset(GrTexture*, const char* swizzle, const GrTextureParams&); | 55 GrRenderTarget* dst); |
| 56 void reset(GrTexture*, const char* swizzle, const GrTextureParams&, GrRender
Target* dst); |
54 void reset(GrTexture*, | 57 void reset(GrTexture*, |
55 const char* swizzle, | 58 const char* swizzle, |
56 GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode, | 59 GrTextureParams::FilterMode, // = GrTextureParams::kNone_FilterMo
de, |
57 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode); | 60 SkShader::TileMode tileXAndY, // = SkShader::kClamp_TileMode, |
| 61 GrRenderTarget* dst); |
58 | 62 |
59 bool operator== (const GrTextureAccess& other) const { | 63 bool operator== (const GrTextureAccess& other) const { |
60 #ifdef SK_DEBUG | 64 #ifdef SK_DEBUG |
61 // below assumes all chars in fSwizzle are initialized even if string is
< 4 chars long. | 65 // below assumes all chars in fSwizzle are initialized even if string is
< 4 chars long. |
62 SkASSERT(memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)-1) == | 66 SkASSERT(memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)-1) == |
63 strcmp(fSwizzle, other.fSwizzle)); | 67 strcmp(fSwizzle, other.fSwizzle)); |
64 #endif | 68 #endif |
65 return fParams == other.fParams && | 69 return fParams == other.fParams && |
66 (this->getTexture() == other.getTexture()) && | 70 (this->getTexture() == other.getTexture()) && |
67 (0 == memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)-1)); | 71 (0 == memcmp(fSwizzle, other.fSwizzle, sizeof(fSwizzle)-1)); |
(...skipping 26 matching lines...) Expand all Loading... |
94 | 98 |
95 ProgramTexture fTexture; | 99 ProgramTexture fTexture; |
96 GrTextureParams fParams; | 100 GrTextureParams fParams; |
97 uint32_t fSwizzleMask; | 101 uint32_t fSwizzleMask; |
98 char fSwizzle[5]; | 102 char fSwizzle[5]; |
99 | 103 |
100 typedef SkNoncopyable INHERITED; | 104 typedef SkNoncopyable INHERITED; |
101 }; | 105 }; |
102 | 106 |
103 #endif | 107 #endif |
OLD | NEW |