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

Unified Diff: include/gpu/GrTextureAccess.h

Issue 1785873003: Implement GL support for buffer textures (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_glTexBuffer
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrTexture.h ('k') | include/gpu/GrTypesPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTextureAccess.h
diff --git a/include/gpu/GrTextureAccess.h b/include/gpu/GrTextureAccess.h
index 237485a9e2798072c9339bb227477fb86181bbe2..047a86636eac35d9eb2ef12b9967bae4cac7b65e 100644
--- a/include/gpu/GrTextureAccess.h
+++ b/include/gpu/GrTextureAccess.h
@@ -33,6 +33,9 @@ public:
GrShaderFlags visibility = kFragment_GrShaderFlag,
GrSLPrecision = kDefault_GrSLPrecision);
+ // This constructor is only for textures that do not support texture params.
+ explicit GrTextureAccess(GrTexture*, GrShaderFlags visibility, GrSLPrecision);
+
void reset(GrTexture*, const GrTextureParams&,
GrShaderFlags visibility = kFragment_GrShaderFlag,
GrSLPrecision = kDefault_GrSLPrecision);
@@ -42,6 +45,9 @@ public:
GrShaderFlags visibility = kFragment_GrShaderFlag,
GrSLPrecision = kDefault_GrSLPrecision);
+ // This version is only for textures that do not support texture params.
+ void reset(GrTexture*, GrShaderFlags visibility, GrSLPrecision);
+
bool operator==(const GrTextureAccess& that) const {
return this->getTexture() == that.getTexture() &&
fParams == that.fParams &&
@@ -60,7 +66,10 @@ public:
*/
const GrGpuResourceRef* getProgramTexture() const { return &fTexture; }
- const GrTextureParams& getParams() const { return fParams; }
+ const GrTextureParams& getParams() const {
+ SkASSERT(this->getTexture()->supportsTextureParams());
+ return fParams;
+ }
private:
« no previous file with comments | « include/gpu/GrTexture.h ('k') | include/gpu/GrTypesPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698