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

Side by Side Diff: include/gpu/GrTextureAccess.h

Issue 1782583002: Add support for vertex and geometry shader textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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
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 GrTextureAccess_DEFINED 8 #ifndef GrTextureAccess_DEFINED
9 #define GrTextureAccess_DEFINED 9 #define GrTextureAccess_DEFINED
10 10
(...skipping 11 matching lines...) Expand all
22 public: 22 public:
23 /** 23 /**
24 * Must be initialized before adding to a GrProcessor's texture access list. 24 * Must be initialized before adding to a GrProcessor's texture access list.
25 */ 25 */
26 GrTextureAccess(); 26 GrTextureAccess();
27 27
28 GrTextureAccess(GrTexture*, const GrTextureParams&); 28 GrTextureAccess(GrTexture*, const GrTextureParams&);
29 29
30 explicit GrTextureAccess(GrTexture*, 30 explicit GrTextureAccess(GrTexture*,
31 GrTextureParams::FilterMode = GrTextureParams::kNon e_FilterMode, 31 GrTextureParams::FilterMode = GrTextureParams::kNon e_FilterMode,
32 SkShader::TileMode tileXAndY = SkShader::kClamp_Til eMode); 32 SkShader::TileMode tileXAndY = SkShader::kClamp_Til eMode,
33 GrShaderFlags visibility = kFragment_GrShaderFlag);
33 34
34 void reset(GrTexture*, const GrTextureParams&); 35 void reset(GrTexture*, const GrTextureParams&,
36 GrShaderFlags visibility = kFragment_GrShaderFlag);
35 void reset(GrTexture*, 37 void reset(GrTexture*,
36 GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode, 38 GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode,
37 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode); 39 SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode,
40 GrShaderFlags visibility = kFragment_GrShaderFlag);
38 41
39 bool operator==(const GrTextureAccess& that) const { 42 bool operator==(const GrTextureAccess& that) const {
40 return this->getTexture() == that.getTexture() && fParams == that.fParam s; 43 return this->getTexture() == that.getTexture() &&
44 fParams == that.fParams &&
45 fVisibility == that.fVisibility;
41 } 46 }
42 47
43 bool operator!=(const GrTextureAccess& other) const { return !(*this == othe r); } 48 bool operator!=(const GrTextureAccess& other) const { return !(*this == othe r); }
44 49
45 GrTexture* getTexture() const { return fTexture.get(); } 50 GrTexture* getTexture() const { return fTexture.get(); }
51 GrSLType getSamplerType() const { return this->getTexture()->getSamplerType( ); }
52 GrShaderFlags getVisibility() const { return fVisibility; }
46 53
47 /** 54 /**
48 * For internal use by GrProcessor. 55 * For internal use by GrProcessor.
49 */ 56 */
50 const GrGpuResourceRef* getProgramTexture() const { return &fTexture; } 57 const GrGpuResourceRef* getProgramTexture() const { return &fTexture; }
51 58
52 const GrTextureParams& getParams() const { return fParams; } 59 const GrTextureParams& getParams() const { return fParams; }
53 60
54 private: 61 private:
55 62
56 typedef GrTGpuResourceRef<GrTexture> ProgramTexture; 63 typedef GrTGpuResourceRef<GrTexture> ProgramTexture;
57 64
58 ProgramTexture fTexture; 65 ProgramTexture fTexture;
59 GrTextureParams fParams; 66 GrTextureParams fParams;
67 GrShaderFlags fVisibility;
60 68
61 typedef SkNoncopyable INHERITED; 69 typedef SkNoncopyable INHERITED;
62 }; 70 };
63 71
64 #endif 72 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698