Use timestamp to detect when client GL calls could cause Gr's cache of glTexParam values to be invalid.
git-svn-id: http://skia.googlecode.com/svn/trunk@2609 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGLTexture.cpp b/src/gpu/GrGLTexture.cpp
index 7ff6588..34ddb85 100644
--- a/src/gpu/GrGLTexture.cpp
+++ b/src/gpu/GrGLTexture.cpp
@@ -37,12 +37,12 @@
void GrGLTexture::init(GrGpuGL* gpu,
const Desc& textureDesc,
- const GrGLRenderTarget::Desc* rtDesc,
- const TexParams& initialTexParams) {
+ const GrGLRenderTarget::Desc* rtDesc) {
GrAssert(0 != textureDesc.fTextureID);
- fTexParams = initialTexParams;
+ fTexParams.invalidate();
+ fTexParamsTimestamp = GrGpu::kExpiredTimestamp;
fTexIDObj = new GrGLTexID(GPUGL->glInterface(),
textureDesc.fTextureID,
textureDesc.fOwnsID);
@@ -67,28 +67,26 @@
}
GrGLTexture::GrGLTexture(GrGpuGL* gpu,
- const Desc& textureDesc,
- const TexParams& initialTexParams)
+ const Desc& textureDesc)
: INHERITED(gpu,
textureDesc.fContentWidth,
textureDesc.fContentHeight,
textureDesc.fAllocWidth,
textureDesc.fAllocHeight,
textureDesc.fConfig) {
- this->init(gpu, textureDesc, NULL, initialTexParams);
+ this->init(gpu, textureDesc, NULL);
}
GrGLTexture::GrGLTexture(GrGpuGL* gpu,
const Desc& textureDesc,
- const GrGLRenderTarget::Desc& rtDesc,
- const TexParams& initialTexParams)
+ const GrGLRenderTarget::Desc& rtDesc)
: INHERITED(gpu,
textureDesc.fContentWidth,
textureDesc.fContentHeight,
textureDesc.fAllocWidth,
textureDesc.fAllocHeight,
textureDesc.fConfig) {
- this->init(gpu, textureDesc, &rtDesc, initialTexParams);
+ this->init(gpu, textureDesc, &rtDesc);
}
void GrGLTexture::onRelease() {